diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..30fdb7b9 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,10 @@ +# Code owners file. +# This file controls who is tagged for review for any given pull request. + +# For syntax help see: +# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax + +* @googleapis/yoshi-java + +# The java-samples-reviewers team is the default owner for samples changes +samples/**/*.java @googleapis/java-samples-reviewers diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..9b0b8f6b --- /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-networkconnectivity/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. networkconnectivity 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..97c74d24 --- /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-networkconnectivity/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/blunderbuss.yml b/.github/blunderbuss.yml new file mode 100644 index 00000000..1a23ea42 --- /dev/null +++ b/.github/blunderbuss.yml @@ -0,0 +1,7 @@ +# Configuration for the Blunderbuss GitHub app. For more info see +# https://github.com/googleapis/repo-automation-bots/tree/master/packages/blunderbuss +assign_prs_by: +- labels: + - samples + to: + - googleapis/java-samples-reviewers \ No newline at end of file diff --git a/.github/generated-files-bot.yml b/.github/generated-files-bot.yml new file mode 100644 index 00000000..47c2ba13 --- /dev/null +++ b/.github/generated-files-bot.yml @@ -0,0 +1,11 @@ +externalManifests: +- type: json + file: 'synth.metadata' + jsonpath: '$.generatedFiles[*]' +- type: json + file: '.github/readme/synth.metadata/synth.metadata' + jsonpath: '$.generatedFiles[*]' +ignoreAuthors: +- 'renovate-bot' +- 'yoshi-automation' +- 'release-please[bot]' diff --git a/.github/readme/synth.py b/.github/readme/synth.py new file mode 100644 index 00000000..7b48cc28 --- /dev/null +++ b/.github/readme/synth.py @@ -0,0 +1,19 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.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 the README for this library.""" + +from synthtool.languages import java + +java.custom_templates(["java_library/README.md"]) 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/snippet-bot.yml b/.github/snippet-bot.yml new file mode 100644 index 00000000..e69de29b 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/.github/workflows/approve-readme.yaml b/.github/workflows/approve-readme.yaml new file mode 100644 index 00000000..7513acae --- /dev/null +++ b/.github/workflows/approve-readme.yaml @@ -0,0 +1,54 @@ +on: + pull_request: +name: auto-merge-readme +jobs: + approve: + runs-on: ubuntu-latest + if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme' + steps: + - uses: actions/github-script@v3 + with: + github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} + script: | + // only approve PRs from yoshi-automation + if (context.payload.pull_request.user.login !== "yoshi-automation") { + return; + } + + // only approve PRs like "chore: release " + if (!context.payload.pull_request.title === "chore: regenerate README") { + return; + } + + // only approve PRs with README.md and synth.metadata changes + const files = new Set( + ( + await github.paginate( + github.pulls.listFiles.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + }) + ) + ).map(file => file.filename) + ); + if (files.size != 2 || !files.has("README.md") || !files.has(".github/readme/synth.metadata/synth.metadata")) { + return; + } + + // approve README regeneration PR + await github.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Rubber stamped PR!', + pull_number: context.payload.pull_request.number, + event: 'APPROVE' + }); + + // attach automerge label + await github.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: ['automerge'] + }); diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml new file mode 100644 index 00000000..2b6cdbc9 --- /dev/null +++ b/.github/workflows/auto-release.yaml @@ -0,0 +1,88 @@ +on: + pull_request: +name: auto-release +jobs: + approve: + runs-on: ubuntu-latest + if: contains(github.head_ref, 'release-v') + steps: + - uses: actions/github-script@v3 + with: + github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} + debug: true + script: | + // only approve PRs from release-please[bot] + if (context.payload.pull_request.user.login !== "release-please[bot]") { + return; + } + + // only approve PRs like "chore: release " + if ( !context.payload.pull_request.title.startsWith("chore: release") ) { + return; + } + + // only approve PRs with pom.xml and versions.txt changes + const filesPromise = github.pulls.listFiles.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + }); + const changed_files = await github.paginate(filesPromise) + + if ( changed_files.length < 1 ) { + console.log( "Not proceeding since PR is empty!" ) + return; + } + + if ( !changed_files.some(v => v.filename.includes("pom")) || !changed_files.some(v => v.filename.includes("versions.txt")) ) { + console.log( "PR file changes do not have pom.xml or versions.txt -- something is wrong. PTAL!" ) + return; + } + + // trigger auto-release when + // 1) it is a SNAPSHOT release (auto-generated post regular release) + // 2) there are dependency updates only + // 3) there are no open dependency update PRs in this repo (to avoid multiple releases) + if ( + context.payload.pull_request.body.includes("Fix") || + context.payload.pull_request.body.includes("Build") || + context.payload.pull_request.body.includes("Documentation") || + context.payload.pull_request.body.includes("BREAKING CHANGES") || + context.payload.pull_request.body.includes("Features") + ) { + console.log( "Not auto-releasing since it is not a dependency-update-only release." ); + return; + } + + const promise = github.pulls.list.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open' + }); + const open_pulls = await github.paginate(promise) + + if ( open_pulls.length > 1 && !context.payload.pull_request.title.includes("SNAPSHOT") ) { + for ( const pull of open_pulls ) { + if ( pull.title.startsWith("deps: update dependency") ) { + console.log( "Not auto-releasing yet since there are dependency update PRs open in this repo." ); + return; + } + } + } + + // approve release PR + await github.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Rubber stamped release!', + pull_number: context.payload.pull_request.number, + event: 'APPROVE' + }); + + // attach kokoro:force-run and automerge labels + await github.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: ['kokoro:force-run', 'automerge'] + }); diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..68302207 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,79 @@ +on: + push: + branches: + - master + pull_request: +name: ci +jobs: + units: + runs-on: ubuntu-latest + strategy: + matrix: + java: [7, 8, 11] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: test + - name: coverage + uses: codecov/codecov-action@v1 + with: + name: actions ${{matrix.java}} + windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.bat + env: + JOB_TYPE: test + dependencies: + runs-on: ubuntu-latest + strategy: + matrix: + java: [8, 11] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/dependencies.sh + linkage-monitor: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/linkage-monitor.sh + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: lint + clirr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: clirr \ No newline at end of file diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml new file mode 100644 index 00000000..c46230a7 --- /dev/null +++ b/.github/workflows/samples.yaml @@ -0,0 +1,14 @@ +on: + pull_request: +name: samples +jobs: + checkstyle: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - name: Run checkstyle + run: mvn -P lint --quiet --batch-mode checkstyle:check + working-directory: samples/snippets diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..cc0bc34a --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +# Maven +target/ + +# Eclipse +.classpath +.project +.settings + +# Intellij +*.iml +.idea/ + +# python utilities +*.pyc +__pycache__ + +.flattened-pom.xml \ No newline at end of file diff --git a/.kokoro/build.bat b/.kokoro/build.bat new file mode 100644 index 00000000..05826ad9 --- /dev/null +++ b/.kokoro/build.bat @@ -0,0 +1,3 @@ +:: See documentation in type-shell-output.bat + +"C:\Program Files\Git\bin\bash.exe" %~dp0build.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh new file mode 100755 index 00000000..7015d576 --- /dev/null +++ b/.kokoro/build.sh @@ -0,0 +1,118 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Java version +java -version +echo ${JOB_TYPE} + +# attempt to install 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true \ + -T 1C + +# if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it +if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then + export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS}) +fi + +RETURN_CODE=0 +set +e + +case ${JOB_TYPE} in +test) + mvn test -B -Dclirr.skip=true -Denforcer.skip=true + RETURN_CODE=$? + ;; +lint) + mvn com.coveo:fmt-maven-plugin:check + RETURN_CODE=$? + ;; +javadoc) + mvn javadoc:javadoc javadoc:test-javadoc + RETURN_CODE=$? + ;; +integration) + mvn -B ${INTEGRATION_TEST_ARGS} \ + -Penable-integration-tests \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + ;; +samples) + SAMPLES_DIR=samples + # only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise. + if [[ ! -z ${KOKORO_GITHUB_PULL_REQUEST_NUMBER} ]] + then + SAMPLES_DIR=samples/snapshot + fi + + if [[ -f ${SAMPLES_DIR}/pom.xml ]] + then + pushd ${SAMPLES_DIR} + 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-networkconnectivity +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..479c2df1 --- /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-networkconnectivity/.kokoro/trampoline.sh" + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-networkconnectivity/.kokoro/build.sh" +} diff --git a/.kokoro/common.sh b/.kokoro/common.sh new file mode 100644 index 00000000..ace89f45 --- /dev/null +++ b/.kokoro/common.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +function retry_with_backoff { + attempts_left=$1 + sleep_seconds=$2 + shift 2 + command=$@ + + + # store current flag state + flags=$- + + # allow a failures to continue + set +e + ${command} + exit_code=$? + + # restore "e" flag + if [[ ${flags} =~ e ]] + then set -e + else set +e + fi + + if [[ $exit_code == 0 ]] + then + return 0 + fi + + # failure + if [[ ${attempts_left} > 0 ]] + then + echo "failure (${exit_code}), sleeping ${sleep_seconds}..." + sleep ${sleep_seconds} + new_attempts=$((${attempts_left} - 1)) + new_sleep=$((${sleep_seconds} * 2)) + retry_with_backoff ${new_attempts} ${new_sleep} ${command} + fi + + return $exit_code +} + +## Helper functionss +function now() { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n'; } +function msg() { println "$*" >&2; } +function println() { printf '%s\n' "$(now) $*"; } \ No newline at end of file diff --git a/.kokoro/continuous/common.cfg b/.kokoro/continuous/common.cfg new file mode 100644 index 00000000..a7670d9e --- /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-networkconnectivity/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-networkconnectivity/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/continuous/java8.cfg b/.kokoro/continuous/java8.cfg new file mode 100644 index 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/readme.cfg b/.kokoro/continuous/readme.cfg new file mode 100644 index 00000000..f154dc4c --- /dev/null +++ b/.kokoro/continuous/readme.cfg @@ -0,0 +1,55 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.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. + +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-networkconnectivity/.kokoro/readme.sh" +} + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.log" + } +} + +# The github token is stored here. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "yoshi-automation-github-key" + # TODO(theacodes): remove this after secrets have globally propagated + backend_type: FASTCONFIGPUSH + } + } +} + +# Common env vars for all repositories and builds. +env_vars: { + key: "GITHUB_USER" + value: "yoshi-automation" +} +env_vars: { + key: "GITHUB_EMAIL" + value: "yoshi-automation@google.com" +} diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh new file mode 100755 index 00000000..c91e5a56 --- /dev/null +++ b/.kokoro/dependencies.sh @@ -0,0 +1,89 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Java +java -version +echo $JOB_TYPE + +export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" + +# this should run maven enforcer +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true + +mvn -B dependency:analyze -DfailOnWarning=true + +echo "****************** DEPENDENCY LIST COMPLETENESS CHECK *******************" +## Run dependency list completeness check +function completenessCheck() { + # Output dep list with compile scope generated using the original pom + # Running mvn dependency:list on Java versions that support modules will also include the module of the dependency. + # This is stripped from the output as it is not present in the flattened pom. + # Only dependencies with 'compile' or 'runtime' scope are included from original dependency list. + msg "Generating dependency list using original pom..." + mvn dependency:list -f pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e s/\\s--\\smodule.*// >.org-list.txt + + # Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes) + msg "Generating dependency list using flattened pom..." + mvn dependency:list -f .flattened-pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt + + # Compare two dependency lists + msg "Comparing dependency lists..." + diff .org-list.txt .new-list.txt >.diff.txt + if [[ $? == 0 ]] + then + msg "Success. No diff!" + else + msg "Diff found. See below: " + msg "You can also check .diff.txt file located in $1." + cat .diff.txt + return 1 + fi +} + +# Allow failures to continue running the script +set +e + +error_count=0 +for path in $(find -name ".flattened-pom.xml") +do + # Check flattened pom in each dir that contains it for completeness + dir=$(dirname "$path") + pushd "$dir" + completenessCheck "$dir" + error_count=$(($error_count + $?)) + popd +done + +if [[ $error_count == 0 ]] +then + msg "All checks passed." + exit 0 +else + msg "Errors found. See log statements above." + exit 1 +fi \ No newline at end of file diff --git a/.kokoro/linkage-monitor.sh b/.kokoro/linkage-monitor.sh new file mode 100755 index 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..a7670d9e --- /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-networkconnectivity/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-networkconnectivity/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg new file mode 100644 index 00000000..0048c8ec --- /dev/null +++ b/.kokoro/nightly/integration.cfg @@ -0,0 +1,37 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/.kokoro/nightly/java11.cfg b/.kokoro/nightly/java11.cfg new file mode 100644 index 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..d18378d1 --- /dev/null +++ b/.kokoro/nightly/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-networkconnectivity/.kokoro/build.sh" diff --git a/.kokoro/nightly/java8-win.cfg b/.kokoro/nightly/java8-win.cfg new file mode 100644 index 00000000..d1c9c447 --- /dev/null +++ b/.kokoro/nightly/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-networkconnectivity/.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/samples.cfg b/.kokoro/nightly/samples.cfg new file mode 100644 index 00000000..f2542931 --- /dev/null +++ b/.kokoro/nightly/samples.cfg @@ -0,0 +1,38 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-docs-samples-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-docs-samples-service-account" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} diff --git a/.kokoro/populate-secrets.sh b/.kokoro/populate-secrets.sh new file mode 100755 index 00000000..f5251425 --- /dev/null +++ b/.kokoro/populate-secrets.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# Copyright 2020 Google LLC. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;} +function msg { println "$*" >&2 ;} +function println { printf '%s\n' "$(now) $*" ;} + + +# Populates requested secrets set in SECRET_MANAGER_KEYS from service account: +# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com +SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager" +msg "Creating folder on disk for secrets: ${SECRET_LOCATION}" +mkdir -p ${SECRET_LOCATION} +for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g") +do + msg "Retrieving secret ${key}" + docker run --entrypoint=gcloud \ + --volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \ + gcr.io/google.com/cloudsdktool/cloud-sdk \ + secrets versions access latest \ + --project cloud-devrel-kokoro-resources \ + --secret ${key} > \ + "${SECRET_LOCATION}/${key}" + if [[ $? == 0 ]]; then + msg "Secret written to ${SECRET_LOCATION}/${key}" + else + msg "Error retrieving secret ${key}" + fi +done diff --git a/.kokoro/presubmit/clirr.cfg b/.kokoro/presubmit/clirr.cfg new file mode 100644 index 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..7f50fb93 --- /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-networkconnectivity/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-networkconnectivity/.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..ff158746 --- /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-networkconnectivity/.kokoro/dependencies.sh" +} diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg new file mode 100644 index 00000000..dded67a9 --- /dev/null +++ b/.kokoro/presubmit/integration.cfg @@ -0,0 +1,33 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/.kokoro/presubmit/java11.cfg b/.kokoro/presubmit/java11.cfg new file mode 100644 index 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..d18378d1 --- /dev/null +++ b/.kokoro/presubmit/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-networkconnectivity/.kokoro/build.sh" diff --git a/.kokoro/presubmit/java8-win.cfg b/.kokoro/presubmit/java8-win.cfg new file mode 100644 index 00000000..d1c9c447 --- /dev/null +++ b/.kokoro/presubmit/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-networkconnectivity/.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..f1882249 --- /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-networkconnectivity/.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..01e09600 --- /dev/null +++ b/.kokoro/presubmit/samples.cfg @@ -0,0 +1,33 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-docs-samples-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-docs-samples-service-account" +} \ No newline at end of file diff --git a/.kokoro/readme.sh b/.kokoro/readme.sh new file mode 100755 index 00000000..49a036ee --- /dev/null +++ b/.kokoro/readme.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +cd ${KOKORO_ARTIFACTS_DIR}/github/java-networkconnectivity + +# Disable buffering, so that the logs stream through. +export PYTHONUNBUFFERED=1 + +# Kokoro exposes this as a file, but the scripts expect just a plain variable. +export GITHUB_TOKEN=$(cat ${KOKORO_KEYSTORE_DIR}/73713_yoshi-automation-github-key) + +# Setup git credentials +echo "https://${GITHUB_TOKEN}:@github.com" >> ~/.git-credentials +git config --global credential.helper 'store --file ~/.git-credentials' + +python3.6 -m pip install git+https://github.com/googleapis/synthtool.git#egg=gcp-synthtool + +set +e +python3.6 -m autosynth.synth \ + --repository=googleapis/java-networkconnectivity \ + --synth-file-name=.github/readme/synth.py \ + --metadata-path=.github/readme/synth.metadata \ + --pr-title="chore: regenerate README" \ + --branch-suffix="readme" + +# autosynth returns 28 to signal there are no changes +RETURN_CODE=$? +if [[ ${RETURN_CODE} -ne 0 && ${RETURN_CODE} -ne 28 ]] +then + exit ${RETURN_CODE} +fi diff --git a/.kokoro/release/bump_snapshot.cfg b/.kokoro/release/bump_snapshot.cfg new file mode 100644 index 00000000..76798614 --- /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-networkconnectivity/.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-networkconnectivity/.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..651fa54e --- /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-networkconnectivity/.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..43efb71a --- /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-networkconnectivity/.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..6f2bdd92 --- /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-networkconnectivity/.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..d677bcae --- /dev/null +++ b/.kokoro/release/publish_javadoc.cfg @@ -0,0 +1,29 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/doc-templates/" + +env_vars: { + key: "STAGING_BUCKET" + value: "docs-staging" +} + +env_vars: { + key: "STAGING_BUCKET_V2" + value: "docs-staging-v2" + # Production will be at: docs-staging-v2 +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-networkconnectivity/.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..217dc68c --- /dev/null +++ b/.kokoro/release/publish_javadoc.sh @@ -0,0 +1,77 @@ +#!/bin/bash +# Copyright 2019 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +if [[ -z "${CREDENTIALS}" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +fi + +if [[ -z "${STAGING_BUCKET}" ]]; then + echo "Need to set STAGING_BUCKET environment variable" + exit 1 +fi + +if [[ -z "${STAGING_BUCKET_V2}" ]]; then + echo "Need to set STAGING_BUCKET_V2 environment variable" + exit 1 +fi + +# work from the git root directory +pushd $(dirname "$0")/../../ + +# install docuploader package +python3 -m pip install gcp-docuploader + +# compile all packages +mvn clean install -B -q -DskipTests=true + +export NAME=google-cloud-networkconnectivity +export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# build the docs +mvn site -B -q + +pushd target/site/apidocs + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --language java + +# upload docs +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET} + +popd + +# V2 due to problems w/ the released javadoc plugin doclava, Java 8 is required. Beware of accidental updates. + +mvn clean site -B -q -Ddevsite.template="${KOKORO_GFILE_DIR}/java/" + +pushd target/devsite/reference + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --language java + +# upload docs +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET_V2} diff --git a/.kokoro/release/snapshot.cfg b/.kokoro/release/snapshot.cfg new file mode 100644 index 00000000..b0b1edaf --- /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-networkconnectivity/.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..eb0af0fb --- /dev/null +++ b/.kokoro/release/stage.cfg @@ -0,0 +1,19 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-networkconnectivity/.kokoro/release/stage.sh" +} + +# Need to save the properties file +action { + define_artifacts { + regex: "github/java-networkconnectivity/target/nexus-staging/staging/*.properties" + strip_prefix: "github/java-networkconnectivity" + } +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" +} diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh new file mode 100755 index 00000000..16126d2e --- /dev/null +++ b/.kokoro/release/stage.sh @@ -0,0 +1,45 @@ +#!/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 +source $(dirname "$0")/../common.sh +MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +# attempt to stage 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn clean 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..9da0f839 --- /dev/null +++ b/.kokoro/trampoline.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -eo pipefail +# Always run the cleanup script, regardless of the success of bouncing into +# the container. +function cleanup() { + chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + echo "cleanup"; +} +trap cleanup EXIT + +$(dirname $0)/populate-secrets.sh # Secret Manager secrets. +python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/.repo-metadata.json b/.repo-metadata.json new file mode 100644 index 00000000..d4708222 --- /dev/null +++ b/.repo-metadata.json @@ -0,0 +1,15 @@ +{ + "name": "networkconnectivity", + "name_pretty": "Network Connectivity Center", + "product_documentation": "https://cloud.google.com/network-connectivity/docs", + "api_description": "Google's suite of products that provide enterprise connectivity from your on-premises network or from another cloud provider to your Virtual Private Cloud (VPC) network", + "client_documentation": "https://googleapis.dev/java/google-cloud-networkconnectivity/latest/index.html", + "release_level": "alpha", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-networkconnectivity", + "repo_short": "java-networkconnectivity", + "distribution_name": "com.google.cloud:google-cloud-networkconnectivity", + "api_id": "networkconnectivity.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..2add2547 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# 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 *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. 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 to 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..f2dbdee0 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,139 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. There are +just a few small guidelines you need to follow. + +## Contributor License Agreement + +Contributions to this project must be accompanied by a Contributor License +Agreement. You (or your employer) retain the copyright to your contribution; +this simply gives us permission to use and redistribute your contributions as +part of the project. Head over to to see +your current agreements on file or to sign a new one. + +You generally only need to submit a CLA once, so if you've already submitted one +(even if it was for a different project), you probably don't need to do it +again. + +## Code reviews + +All submissions, including submissions by project members, require review. We +use GitHub pull requests for this purpose. Consult +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more +information on using pull requests. + +## Community Guidelines + +This project follows +[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/). + +## Building the project + +To build, package, and run all unit tests run the command + +``` +mvn clean verify +``` + +### Running Integration tests + +To include integration tests when building the project, you need access to +a GCP Project with a valid service account. + +For instructions on how to generate a service account and corresponding +credentials JSON see: [Creating a Service Account][1]. + +Then run the following to build, package, run all unit tests and run all +integration tests. + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn -Penable-integration-tests clean verify +``` + +## Code Samples + +Code Samples must be bundled in separate Maven modules, and guarded by a +Maven profile with the name `enable-samples`. + +The samples must be separate from the primary project for a few reasons: +1. Primary projects have a minimum Java version of Java 7 whereas samples have + a minimum Java version of Java 8. Due to this we need the ability to + selectively exclude samples from a build run. +2. Many code samples depend on external GCP services and need + credentials to access the service. +3. Code samples are not released as Maven artifacts and must be excluded from + release builds. + +### Building + +```bash +mvn -Penable-samples clean verify +``` + +Some samples require access to GCP services and require a service account: + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn -Penable-samples clean verify +``` + +### Profile Config + +1. To add samples in a profile to your Maven project, add the following to your +`pom.xml` + + ```xml + + [...] + + + enable-samples + + sample + + + + [...] + + ``` + +2. [Activate](#profile-activation) the profile. +3. Define your samples in a normal Maven project in the `samples/` directory. + +### Code Formatting + +Code in this repo is formatted with +[google-java-format](https://github.com/google/google-java-format). +To run formatting on your project, you can run: +``` +mvn com.coveo:fmt-maven-plugin:format +``` + +### Profile Activation + +To include code samples when building and testing the project, enable the +`enable-samples` Maven profile. + +#### Command line + +To activate the Maven profile on the command line add `-Penable-samples` to your +Maven command. + +#### Maven `settings.xml` + +To activate the Maven profile in your `~/.m2/settings.xml` add an entry of +`enable-samples` following the instructions in [Active Profiles][2]. + +This method has the benefit of applying to all projects you build (and is +respected by IntelliJ IDEA) and is recommended if you are going to be +contributing samples to several projects. + +#### IntelliJ IDEA + +To activate the Maven Profile inside IntelliJ IDEA, follow the instructions in +[Activate Maven profiles][3] to activate `enable-samples`. + +[1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account +[2]: https://maven.apache.org/settings.html#Active_Profiles +[3]: https://www.jetbrains.com/help/idea/work-with-maven-profiles.html#activate_maven_profiles diff --git a/LICENSE b/LICENSE new file mode 100644 index 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/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-networkconnectivity-bom/pom.xml b/google-cloud-networkconnectivity-bom/pom.xml new file mode 100644 index 00000000..3fef85ce --- /dev/null +++ b/google-cloud-networkconnectivity-bom/pom.xml @@ -0,0 +1,97 @@ + + + 4.0.0 + com.google.cloud + google-cloud-networkconnectivity-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-shared-config + 0.9.2 + + + Google Network Connectivity Center BOM + https://github.com/googleapis/java-networkconnectivity + + BOM for Network Connectivity Center + + + + Google LLC + + + + + chingor13 + Jeff Ching + chingor@google.com + Google LLC + + Developer + + + + + + scm:git:https://github.com/googleapis/java-networkconnectivity.git + scm:git:git@github.com:googleapis/java-networkconnectivity.git + https://github.com/googleapis/java-networkconnectivity + + + + true + + + + + sonatype-nexus-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + sonatype-nexus-staging + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + + + com.google.cloud + google-cloud-networkconnectivity + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-networkconnectivity-v1alpha1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-networkconnectivity-v1alpha1 + 0.0.1-SNAPSHOT + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + \ No newline at end of file diff --git a/google-cloud-networkconnectivity/pom.xml b/google-cloud-networkconnectivity/pom.xml new file mode 100644 index 00000000..f1ee1cf2 --- /dev/null +++ b/google-cloud-networkconnectivity/pom.xml @@ -0,0 +1,111 @@ + + + 4.0.0 + com.google.cloud + google-cloud-networkconnectivity + 0.0.1-SNAPSHOT + jar + Google Network Connectivity Center + https://github.com/googleapis/java-networkconnectivity + Google's suite of products that provide enterprise connectivity from your on-premises network or from another cloud provider to your Virtual Private Cloud (VPC) network + + com.google.cloud + google-cloud-networkconnectivity-parent + 0.0.1-SNAPSHOT + + + google-cloud-networkconnectivity + + + + 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-networkconnectivity-v1alpha1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + org.threeten + threetenbp + + + + + junit + junit + test + 4.13 + + + + com.google.api.grpc + grpc-google-cloud-networkconnectivity-v1alpha1 + 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-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceClient.java b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceClient.java new file mode 100644 index 00000000..cdff2369 --- /dev/null +++ b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceClient.java @@ -0,0 +1,901 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.networkconnectivity.v1alpha1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.networkconnectivity.v1alpha1.stub.HubServiceStub; +import com.google.cloud.networkconnectivity.v1alpha1.stub.HubServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Connectivity Hub is a hub-and-spoke abstraction for network connectivity + * management in Google Cloud. The Hub aims to reduce operational complexity through a simple, + * centralized connectivity management model. + * + *

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

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

To customize credentials: + * + *

{@code
+ * HubServiceSettings hubServiceSettings =
+ *     HubServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * HubServiceClient hubServiceClient = HubServiceClient.create(hubServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * HubServiceSettings hubServiceSettings =
+ *     HubServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * HubServiceClient hubServiceClient = HubServiceClient.create(hubServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HubServiceClient implements BackgroundResource { + private final HubServiceSettings settings; + private final HubServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of HubServiceClient with default settings. */ + public static final HubServiceClient create() throws IOException { + return create(HubServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of HubServiceClient, 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 HubServiceClient create(HubServiceSettings settings) throws IOException { + return new HubServiceClient(settings); + } + + /** + * Constructs an instance of HubServiceClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(HubServiceSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final HubServiceClient create(HubServiceStub stub) { + return new HubServiceClient(stub); + } + + /** + * Constructs an instance of HubServiceClient, 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 HubServiceClient(HubServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((HubServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected HubServiceClient(HubServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final HubServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public HubServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Hubs in a given project and location. + * + * @param parent Required. The parent resource's name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListHubsPagedResponse listHubs(LocationName parent) { + ListHubsRequest request = + ListHubsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listHubs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Hubs in a given project and location. + * + * @param parent Required. The parent resource's name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListHubsPagedResponse listHubs(String parent) { + ListHubsRequest request = ListHubsRequest.newBuilder().setParent(parent).build(); + return listHubs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Hubs in a given project and location. + * + * @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 ListHubsPagedResponse listHubs(ListHubsRequest request) { + return listHubsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Hubs in a given project and location. + * + *

Sample code: + */ + public final UnaryCallable listHubsPagedCallable() { + return stub.listHubsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Hubs in a given project and location. + * + *

Sample code: + */ + public final UnaryCallable listHubsCallable() { + return stub.listHubsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Hub. + * + * @param name Required. Name of the Hub resource to get. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Hub getHub(HubName name) { + GetHubRequest request = + GetHubRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getHub(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Hub. + * + * @param name Required. Name of the Hub resource to get. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Hub getHub(String name) { + GetHubRequest request = GetHubRequest.newBuilder().setName(name).build(); + return getHub(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Hub. + * + * @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 Hub getHub(GetHubRequest request) { + return getHubCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Hub. + * + *

Sample code: + */ + public final UnaryCallable getHubCallable() { + return stub.getHubCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Hub in a given project and location. + * + * @param parent Required. The parent resource's name of the Hub. + * @param hub Required. Initial values for a new Hub. + * @param hubId Optional. Unique id for the Hub to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createHubAsync( + LocationName parent, Hub hub, String hubId) { + CreateHubRequest request = + CreateHubRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setHub(hub) + .setHubId(hubId) + .build(); + return createHubAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Hub in a given project and location. + * + * @param parent Required. The parent resource's name of the Hub. + * @param hub Required. Initial values for a new Hub. + * @param hubId Optional. Unique id for the Hub to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createHubAsync( + String parent, Hub hub, String hubId) { + CreateHubRequest request = + CreateHubRequest.newBuilder().setParent(parent).setHub(hub).setHubId(hubId).build(); + return createHubAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Hub in a given project and location. + * + * @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 OperationFuture createHubAsync(CreateHubRequest request) { + return createHubOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Hub in a given project and location. + * + *

Sample code: + */ + public final OperationCallable + createHubOperationCallable() { + return stub.createHubOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Hub in a given project and location. + * + *

Sample code: + */ + public final UnaryCallable createHubCallable() { + return stub.createHubCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Hub. + * + * @param hub Required. The state that the Hub should be in after the update. + * @param updateMask Optional. Field mask is used to specify the fields to be overwritten in the + * Hub resource by the update. The fields specified in the update_mask are relative to the + * resource, not the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateHubAsync( + Hub hub, FieldMask updateMask) { + UpdateHubRequest request = + UpdateHubRequest.newBuilder().setHub(hub).setUpdateMask(updateMask).build(); + return updateHubAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Hub. + * + * @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 OperationFuture updateHubAsync(UpdateHubRequest request) { + return updateHubOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Hub. + * + *

Sample code: + */ + public final OperationCallable + updateHubOperationCallable() { + return stub.updateHubOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Hub. + * + *

Sample code: + */ + public final UnaryCallable updateHubCallable() { + return stub.updateHubCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Hub. + * + * @param name Required. The name of the Hub to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteHubAsync(HubName name) { + DeleteHubRequest request = + DeleteHubRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteHubAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Hub. + * + * @param name Required. The name of the Hub to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteHubAsync(String name) { + DeleteHubRequest request = DeleteHubRequest.newBuilder().setName(name).build(); + return deleteHubAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Hub. + * + * @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 OperationFuture deleteHubAsync(DeleteHubRequest request) { + return deleteHubOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Hub. + * + *

Sample code: + */ + public final OperationCallable + deleteHubOperationCallable() { + return stub.deleteHubOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Hub. + * + *

Sample code: + */ + public final UnaryCallable deleteHubCallable() { + return stub.deleteHubCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Spokes in a given project and location. + * + * @param parent Required. The parent's resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSpokesPagedResponse listSpokes(LocationName parent) { + ListSpokesRequest request = + ListSpokesRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listSpokes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Spokes in a given project and location. + * + * @param parent Required. The parent's resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSpokesPagedResponse listSpokes(String parent) { + ListSpokesRequest request = ListSpokesRequest.newBuilder().setParent(parent).build(); + return listSpokes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Spokes in a given project and location. + * + * @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 ListSpokesPagedResponse listSpokes(ListSpokesRequest request) { + return listSpokesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Spokes in a given project and location. + * + *

Sample code: + */ + public final UnaryCallable listSpokesPagedCallable() { + return stub.listSpokesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Spokes in a given project and location. + * + *

Sample code: + */ + public final UnaryCallable listSpokesCallable() { + return stub.listSpokesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Spoke. + * + * @param name Required. The name of Spoke resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Spoke getSpoke(SpokeName name) { + GetSpokeRequest request = + GetSpokeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getSpoke(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Spoke. + * + * @param name Required. The name of Spoke resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Spoke getSpoke(String name) { + GetSpokeRequest request = GetSpokeRequest.newBuilder().setName(name).build(); + return getSpoke(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Spoke. + * + * @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 Spoke getSpoke(GetSpokeRequest request) { + return getSpokeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Spoke. + * + *

Sample code: + */ + public final UnaryCallable getSpokeCallable() { + return stub.getSpokeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Spoke in a given project and location. + * + * @param parent Required. The parent's resource name of the Spoke. + * @param spoke Required. Initial values for a new Hub. + * @param spokeId Optional. Unique id for the Spoke to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSpokeAsync( + LocationName parent, Spoke spoke, String spokeId) { + CreateSpokeRequest request = + CreateSpokeRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSpoke(spoke) + .setSpokeId(spokeId) + .build(); + return createSpokeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Spoke in a given project and location. + * + * @param parent Required. The parent's resource name of the Spoke. + * @param spoke Required. Initial values for a new Hub. + * @param spokeId Optional. Unique id for the Spoke to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSpokeAsync( + String parent, Spoke spoke, String spokeId) { + CreateSpokeRequest request = + CreateSpokeRequest.newBuilder() + .setParent(parent) + .setSpoke(spoke) + .setSpokeId(spokeId) + .build(); + return createSpokeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Spoke in a given project and location. + * + * @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 OperationFuture createSpokeAsync( + CreateSpokeRequest request) { + return createSpokeOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Spoke in a given project and location. + * + *

Sample code: + */ + public final OperationCallable + createSpokeOperationCallable() { + return stub.createSpokeOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Spoke in a given project and location. + * + *

Sample code: + */ + public final UnaryCallable createSpokeCallable() { + return stub.createSpokeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Spoke. + * + * @param spoke Required. The state that the Spoke should be in after the update. + * @param updateMask Optional. Field mask is used to specify the fields to be overwritten in the + * Spoke resource by the update. The fields specified in the update_mask are relative to the + * resource, not the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateSpokeAsync( + Spoke spoke, FieldMask updateMask) { + UpdateSpokeRequest request = + UpdateSpokeRequest.newBuilder().setSpoke(spoke).setUpdateMask(updateMask).build(); + return updateSpokeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Spoke. + * + * @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 OperationFuture updateSpokeAsync( + UpdateSpokeRequest request) { + return updateSpokeOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Spoke. + * + *

Sample code: + */ + public final OperationCallable + updateSpokeOperationCallable() { + return stub.updateSpokeOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Spoke. + * + *

Sample code: + */ + public final UnaryCallable updateSpokeCallable() { + return stub.updateSpokeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Spoke. + * + * @param name Required. The name of the Spoke to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteSpokeAsync(SpokeName name) { + DeleteSpokeRequest request = + DeleteSpokeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteSpokeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Spoke. + * + * @param name Required. The name of the Spoke to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteSpokeAsync(String name) { + DeleteSpokeRequest request = DeleteSpokeRequest.newBuilder().setName(name).build(); + return deleteSpokeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Spoke. + * + * @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 OperationFuture deleteSpokeAsync( + DeleteSpokeRequest request) { + return deleteSpokeOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Spoke. + * + *

Sample code: + */ + public final OperationCallable + deleteSpokeOperationCallable() { + return stub.deleteSpokeOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Spoke. + * + *

Sample code: + */ + public final UnaryCallable deleteSpokeCallable() { + return stub.deleteSpokeCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListHubsPagedResponse + extends AbstractPagedListResponse< + ListHubsRequest, ListHubsResponse, Hub, ListHubsPage, ListHubsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListHubsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListHubsPagedResponse apply(ListHubsPage input) { + return new ListHubsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListHubsPagedResponse(ListHubsPage page) { + super(page, ListHubsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListHubsPage + extends AbstractPage { + + private ListHubsPage( + PageContext context, ListHubsResponse response) { + super(context, response); + } + + private static ListHubsPage createEmptyPage() { + return new ListHubsPage(null, null); + } + + @Override + protected ListHubsPage createPage( + PageContext context, ListHubsResponse response) { + return new ListHubsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListHubsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListHubsRequest, ListHubsResponse, Hub, ListHubsPage, ListHubsFixedSizeCollection> { + + private ListHubsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListHubsFixedSizeCollection createEmptyCollection() { + return new ListHubsFixedSizeCollection(null, 0); + } + + @Override + protected ListHubsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListHubsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListSpokesPagedResponse + extends AbstractPagedListResponse< + ListSpokesRequest, + ListSpokesResponse, + Spoke, + ListSpokesPage, + ListSpokesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSpokesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListSpokesPagedResponse apply(ListSpokesPage input) { + return new ListSpokesPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListSpokesPagedResponse(ListSpokesPage page) { + super(page, ListSpokesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSpokesPage + extends AbstractPage { + + private ListSpokesPage( + PageContext context, + ListSpokesResponse response) { + super(context, response); + } + + private static ListSpokesPage createEmptyPage() { + return new ListSpokesPage(null, null); + } + + @Override + protected ListSpokesPage createPage( + PageContext context, + ListSpokesResponse response) { + return new ListSpokesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSpokesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSpokesRequest, + ListSpokesResponse, + Spoke, + ListSpokesPage, + ListSpokesFixedSizeCollection> { + + private ListSpokesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSpokesFixedSizeCollection createEmptyCollection() { + return new ListSpokesFixedSizeCollection(null, 0); + } + + @Override + protected ListSpokesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSpokesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceSettings.java b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceSettings.java new file mode 100644 index 00000000..486c60e3 --- /dev/null +++ b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceSettings.java @@ -0,0 +1,355 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.networkconnectivity.v1alpha1; + +import static com.google.cloud.networkconnectivity.v1alpha1.HubServiceClient.ListHubsPagedResponse; +import static com.google.cloud.networkconnectivity.v1alpha1.HubServiceClient.ListSpokesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.networkconnectivity.v1alpha1.stub.HubServiceStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link HubServiceClient}. + * + *

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

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

{@code
+ * HubServiceSettings.Builder hubServiceSettingsBuilder = HubServiceSettings.newBuilder();
+ * hubServiceSettingsBuilder
+ *     .getHubSettings()
+ *     .setRetrySettings(
+ *         hubServiceSettingsBuilder
+ *             .getHubSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * HubServiceSettings hubServiceSettings = hubServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class HubServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listHubs. */ + public PagedCallSettings + listHubsSettings() { + return ((HubServiceStubSettings) getStubSettings()).listHubsSettings(); + } + + /** Returns the object with the settings used for calls to getHub. */ + public UnaryCallSettings getHubSettings() { + return ((HubServiceStubSettings) getStubSettings()).getHubSettings(); + } + + /** Returns the object with the settings used for calls to createHub. */ + public UnaryCallSettings createHubSettings() { + return ((HubServiceStubSettings) getStubSettings()).createHubSettings(); + } + + /** Returns the object with the settings used for calls to createHub. */ + public OperationCallSettings + createHubOperationSettings() { + return ((HubServiceStubSettings) getStubSettings()).createHubOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateHub. */ + public UnaryCallSettings updateHubSettings() { + return ((HubServiceStubSettings) getStubSettings()).updateHubSettings(); + } + + /** Returns the object with the settings used for calls to updateHub. */ + public OperationCallSettings + updateHubOperationSettings() { + return ((HubServiceStubSettings) getStubSettings()).updateHubOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteHub. */ + public UnaryCallSettings deleteHubSettings() { + return ((HubServiceStubSettings) getStubSettings()).deleteHubSettings(); + } + + /** Returns the object with the settings used for calls to deleteHub. */ + public OperationCallSettings + deleteHubOperationSettings() { + return ((HubServiceStubSettings) getStubSettings()).deleteHubOperationSettings(); + } + + /** Returns the object with the settings used for calls to listSpokes. */ + public PagedCallSettings + listSpokesSettings() { + return ((HubServiceStubSettings) getStubSettings()).listSpokesSettings(); + } + + /** Returns the object with the settings used for calls to getSpoke. */ + public UnaryCallSettings getSpokeSettings() { + return ((HubServiceStubSettings) getStubSettings()).getSpokeSettings(); + } + + /** Returns the object with the settings used for calls to createSpoke. */ + public UnaryCallSettings createSpokeSettings() { + return ((HubServiceStubSettings) getStubSettings()).createSpokeSettings(); + } + + /** Returns the object with the settings used for calls to createSpoke. */ + public OperationCallSettings + createSpokeOperationSettings() { + return ((HubServiceStubSettings) getStubSettings()).createSpokeOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateSpoke. */ + public UnaryCallSettings updateSpokeSettings() { + return ((HubServiceStubSettings) getStubSettings()).updateSpokeSettings(); + } + + /** Returns the object with the settings used for calls to updateSpoke. */ + public OperationCallSettings + updateSpokeOperationSettings() { + return ((HubServiceStubSettings) getStubSettings()).updateSpokeOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteSpoke. */ + public UnaryCallSettings deleteSpokeSettings() { + return ((HubServiceStubSettings) getStubSettings()).deleteSpokeSettings(); + } + + /** Returns the object with the settings used for calls to deleteSpoke. */ + public OperationCallSettings + deleteSpokeOperationSettings() { + return ((HubServiceStubSettings) getStubSettings()).deleteSpokeOperationSettings(); + } + + public static final HubServiceSettings create(HubServiceStubSettings stub) throws IOException { + return new HubServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return HubServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return HubServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return HubServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return HubServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return HubServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return HubServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return HubServiceStubSettings.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 HubServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for HubServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(HubServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(HubServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(HubServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(HubServiceStubSettings.newBuilder()); + } + + public HubServiceStubSettings.Builder getStubSettingsBuilder() { + return ((HubServiceStubSettings.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 listHubs. */ + public PagedCallSettings.Builder + listHubsSettings() { + return getStubSettingsBuilder().listHubsSettings(); + } + + /** Returns the builder for the settings used for calls to getHub. */ + public UnaryCallSettings.Builder getHubSettings() { + return getStubSettingsBuilder().getHubSettings(); + } + + /** Returns the builder for the settings used for calls to createHub. */ + public UnaryCallSettings.Builder createHubSettings() { + return getStubSettingsBuilder().createHubSettings(); + } + + /** Returns the builder for the settings used for calls to createHub. */ + public OperationCallSettings.Builder + createHubOperationSettings() { + return getStubSettingsBuilder().createHubOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateHub. */ + public UnaryCallSettings.Builder updateHubSettings() { + return getStubSettingsBuilder().updateHubSettings(); + } + + /** Returns the builder for the settings used for calls to updateHub. */ + public OperationCallSettings.Builder + updateHubOperationSettings() { + return getStubSettingsBuilder().updateHubOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteHub. */ + public UnaryCallSettings.Builder deleteHubSettings() { + return getStubSettingsBuilder().deleteHubSettings(); + } + + /** Returns the builder for the settings used for calls to deleteHub. */ + public OperationCallSettings.Builder + deleteHubOperationSettings() { + return getStubSettingsBuilder().deleteHubOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listSpokes. */ + public PagedCallSettings.Builder + listSpokesSettings() { + return getStubSettingsBuilder().listSpokesSettings(); + } + + /** Returns the builder for the settings used for calls to getSpoke. */ + public UnaryCallSettings.Builder getSpokeSettings() { + return getStubSettingsBuilder().getSpokeSettings(); + } + + /** Returns the builder for the settings used for calls to createSpoke. */ + public UnaryCallSettings.Builder createSpokeSettings() { + return getStubSettingsBuilder().createSpokeSettings(); + } + + /** Returns the builder for the settings used for calls to createSpoke. */ + public OperationCallSettings.Builder + createSpokeOperationSettings() { + return getStubSettingsBuilder().createSpokeOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateSpoke. */ + public UnaryCallSettings.Builder updateSpokeSettings() { + return getStubSettingsBuilder().updateSpokeSettings(); + } + + /** Returns the builder for the settings used for calls to updateSpoke. */ + public OperationCallSettings.Builder + updateSpokeOperationSettings() { + return getStubSettingsBuilder().updateSpokeOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSpoke. */ + public UnaryCallSettings.Builder deleteSpokeSettings() { + return getStubSettingsBuilder().deleteSpokeSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSpoke. */ + public OperationCallSettings.Builder + deleteSpokeOperationSettings() { + return getStubSettingsBuilder().deleteSpokeOperationSettings(); + } + + @Override + public HubServiceSettings build() throws IOException { + return new HubServiceSettings(this); + } + } +} diff --git a/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/package-info.java b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/package-info.java new file mode 100644 index 00000000..2b2e5cea --- /dev/null +++ b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/package-info.java @@ -0,0 +1,31 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The interfaces provided are listed below, along with usage samples. + * + *

======================= HubServiceClient ======================= + * + *

Service Description: Connectivity Hub is a hub-and-spoke abstraction for network connectivity + * management in Google Cloud. The Hub aims to reduce operational complexity through a simple, + * centralized connectivity management model. + * + *

Sample for HubServiceClient: + */ +@Generated("by gapic-generator-java") +package com.google.cloud.networkconnectivity.v1alpha1; + +import javax.annotation.Generated; diff --git a/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/GrpcHubServiceCallableFactory.java b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/GrpcHubServiceCallableFactory.java new file mode 100644 index 00000000..665ed40d --- /dev/null +++ b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/GrpcHubServiceCallableFactory.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.networkconnectivity.v1alpha1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the HubService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcHubServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/GrpcHubServiceStub.java b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/GrpcHubServiceStub.java new file mode 100644 index 00000000..ab4f2082 --- /dev/null +++ b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/GrpcHubServiceStub.java @@ -0,0 +1,532 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.networkconnectivity.v1alpha1.stub; + +import static com.google.cloud.networkconnectivity.v1alpha1.HubServiceClient.ListHubsPagedResponse; +import static com.google.cloud.networkconnectivity.v1alpha1.HubServiceClient.ListSpokesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest; +import com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest; +import com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest; +import com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest; +import com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest; +import com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest; +import com.google.cloud.networkconnectivity.v1alpha1.Hub; +import com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest; +import com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse; +import com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest; +import com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse; +import com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata; +import com.google.cloud.networkconnectivity.v1alpha1.Spoke; +import com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest; +import com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the HubService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcHubServiceStub extends HubServiceStub { + private static final MethodDescriptor + listHubsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.networkconnectivity.v1alpha1.HubService/ListHubs") + .setRequestMarshaller(ProtoUtils.marshaller(ListHubsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListHubsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getHubMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.networkconnectivity.v1alpha1.HubService/GetHub") + .setRequestMarshaller(ProtoUtils.marshaller(GetHubRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Hub.getDefaultInstance())) + .build(); + + private static final MethodDescriptor createHubMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.networkconnectivity.v1alpha1.HubService/CreateHub") + .setRequestMarshaller(ProtoUtils.marshaller(CreateHubRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor updateHubMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.networkconnectivity.v1alpha1.HubService/UpdateHub") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateHubRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteHubMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.networkconnectivity.v1alpha1.HubService/DeleteHub") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteHubRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listSpokesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.networkconnectivity.v1alpha1.HubService/ListSpokes") + .setRequestMarshaller(ProtoUtils.marshaller(ListSpokesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListSpokesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getSpokeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.networkconnectivity.v1alpha1.HubService/GetSpoke") + .setRequestMarshaller(ProtoUtils.marshaller(GetSpokeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Spoke.getDefaultInstance())) + .build(); + + private static final MethodDescriptor createSpokeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.networkconnectivity.v1alpha1.HubService/CreateSpoke") + .setRequestMarshaller(ProtoUtils.marshaller(CreateSpokeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor updateSpokeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.networkconnectivity.v1alpha1.HubService/UpdateSpoke") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateSpokeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteSpokeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.networkconnectivity.v1alpha1.HubService/DeleteSpoke") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteSpokeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable listHubsCallable; + private final UnaryCallable listHubsPagedCallable; + private final UnaryCallable getHubCallable; + private final UnaryCallable createHubCallable; + private final OperationCallable + createHubOperationCallable; + private final UnaryCallable updateHubCallable; + private final OperationCallable + updateHubOperationCallable; + private final UnaryCallable deleteHubCallable; + private final OperationCallable + deleteHubOperationCallable; + private final UnaryCallable listSpokesCallable; + private final UnaryCallable listSpokesPagedCallable; + private final UnaryCallable getSpokeCallable; + private final UnaryCallable createSpokeCallable; + private final OperationCallable + createSpokeOperationCallable; + private final UnaryCallable updateSpokeCallable; + private final OperationCallable + updateSpokeOperationCallable; + private final UnaryCallable deleteSpokeCallable; + private final OperationCallable + deleteSpokeOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcHubServiceStub create(HubServiceStubSettings settings) + throws IOException { + return new GrpcHubServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcHubServiceStub create(ClientContext clientContext) throws IOException { + return new GrpcHubServiceStub(HubServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcHubServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcHubServiceStub( + HubServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcHubServiceStub, 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 GrpcHubServiceStub(HubServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcHubServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcHubServiceStub, 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 GrpcHubServiceStub( + HubServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listHubsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listHubsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListHubsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getHubTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getHubMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetHubRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createHubTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createHubMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateHubRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateHubTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateHubMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateHubRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("hub.name", String.valueOf(request.getHub().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteHubTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteHubMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteHubRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listSpokesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSpokesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListSpokesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getSpokeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSpokeMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetSpokeRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createSpokeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSpokeMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateSpokeRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateSpokeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateSpokeMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateSpokeRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("spoke.name", String.valueOf(request.getSpoke().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteSpokeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteSpokeMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteSpokeRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.listHubsCallable = + callableFactory.createUnaryCallable( + listHubsTransportSettings, settings.listHubsSettings(), clientContext); + this.listHubsPagedCallable = + callableFactory.createPagedCallable( + listHubsTransportSettings, settings.listHubsSettings(), clientContext); + this.getHubCallable = + callableFactory.createUnaryCallable( + getHubTransportSettings, settings.getHubSettings(), clientContext); + this.createHubCallable = + callableFactory.createUnaryCallable( + createHubTransportSettings, settings.createHubSettings(), clientContext); + this.createHubOperationCallable = + callableFactory.createOperationCallable( + createHubTransportSettings, + settings.createHubOperationSettings(), + clientContext, + operationsStub); + this.updateHubCallable = + callableFactory.createUnaryCallable( + updateHubTransportSettings, settings.updateHubSettings(), clientContext); + this.updateHubOperationCallable = + callableFactory.createOperationCallable( + updateHubTransportSettings, + settings.updateHubOperationSettings(), + clientContext, + operationsStub); + this.deleteHubCallable = + callableFactory.createUnaryCallable( + deleteHubTransportSettings, settings.deleteHubSettings(), clientContext); + this.deleteHubOperationCallable = + callableFactory.createOperationCallable( + deleteHubTransportSettings, + settings.deleteHubOperationSettings(), + clientContext, + operationsStub); + this.listSpokesCallable = + callableFactory.createUnaryCallable( + listSpokesTransportSettings, settings.listSpokesSettings(), clientContext); + this.listSpokesPagedCallable = + callableFactory.createPagedCallable( + listSpokesTransportSettings, settings.listSpokesSettings(), clientContext); + this.getSpokeCallable = + callableFactory.createUnaryCallable( + getSpokeTransportSettings, settings.getSpokeSettings(), clientContext); + this.createSpokeCallable = + callableFactory.createUnaryCallable( + createSpokeTransportSettings, settings.createSpokeSettings(), clientContext); + this.createSpokeOperationCallable = + callableFactory.createOperationCallable( + createSpokeTransportSettings, + settings.createSpokeOperationSettings(), + clientContext, + operationsStub); + this.updateSpokeCallable = + callableFactory.createUnaryCallable( + updateSpokeTransportSettings, settings.updateSpokeSettings(), clientContext); + this.updateSpokeOperationCallable = + callableFactory.createOperationCallable( + updateSpokeTransportSettings, + settings.updateSpokeOperationSettings(), + clientContext, + operationsStub); + this.deleteSpokeCallable = + callableFactory.createUnaryCallable( + deleteSpokeTransportSettings, settings.deleteSpokeSettings(), clientContext); + this.deleteSpokeOperationCallable = + callableFactory.createOperationCallable( + deleteSpokeTransportSettings, + settings.deleteSpokeOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + public UnaryCallable listHubsCallable() { + return listHubsCallable; + } + + public UnaryCallable listHubsPagedCallable() { + return listHubsPagedCallable; + } + + public UnaryCallable getHubCallable() { + return getHubCallable; + } + + public UnaryCallable createHubCallable() { + return createHubCallable; + } + + public OperationCallable createHubOperationCallable() { + return createHubOperationCallable; + } + + public UnaryCallable updateHubCallable() { + return updateHubCallable; + } + + public OperationCallable updateHubOperationCallable() { + return updateHubOperationCallable; + } + + public UnaryCallable deleteHubCallable() { + return deleteHubCallable; + } + + public OperationCallable + deleteHubOperationCallable() { + return deleteHubOperationCallable; + } + + public UnaryCallable listSpokesCallable() { + return listSpokesCallable; + } + + public UnaryCallable listSpokesPagedCallable() { + return listSpokesPagedCallable; + } + + public UnaryCallable getSpokeCallable() { + return getSpokeCallable; + } + + public UnaryCallable createSpokeCallable() { + return createSpokeCallable; + } + + public OperationCallable + createSpokeOperationCallable() { + return createSpokeOperationCallable; + } + + public UnaryCallable updateSpokeCallable() { + return updateSpokeCallable; + } + + public OperationCallable + updateSpokeOperationCallable() { + return updateSpokeOperationCallable; + } + + public UnaryCallable deleteSpokeCallable() { + return deleteSpokeCallable; + } + + public OperationCallable + deleteSpokeOperationCallable() { + return deleteSpokeOperationCallable; + } + + @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-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/HubServiceStub.java b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/HubServiceStub.java new file mode 100644 index 00000000..ba5a8e53 --- /dev/null +++ b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/HubServiceStub.java @@ -0,0 +1,138 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.networkconnectivity.v1alpha1.stub; + +import static com.google.cloud.networkconnectivity.v1alpha1.HubServiceClient.ListHubsPagedResponse; +import static com.google.cloud.networkconnectivity.v1alpha1.HubServiceClient.ListSpokesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest; +import com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest; +import com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest; +import com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest; +import com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest; +import com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest; +import com.google.cloud.networkconnectivity.v1alpha1.Hub; +import com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest; +import com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse; +import com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest; +import com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse; +import com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata; +import com.google.cloud.networkconnectivity.v1alpha1.Spoke; +import com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest; +import com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the HubService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class HubServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable listHubsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listHubsPagedCallable()"); + } + + public UnaryCallable listHubsCallable() { + throw new UnsupportedOperationException("Not implemented: listHubsCallable()"); + } + + public UnaryCallable getHubCallable() { + throw new UnsupportedOperationException("Not implemented: getHubCallable()"); + } + + public OperationCallable createHubOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createHubOperationCallable()"); + } + + public UnaryCallable createHubCallable() { + throw new UnsupportedOperationException("Not implemented: createHubCallable()"); + } + + public OperationCallable updateHubOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateHubOperationCallable()"); + } + + public UnaryCallable updateHubCallable() { + throw new UnsupportedOperationException("Not implemented: updateHubCallable()"); + } + + public OperationCallable + deleteHubOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteHubOperationCallable()"); + } + + public UnaryCallable deleteHubCallable() { + throw new UnsupportedOperationException("Not implemented: deleteHubCallable()"); + } + + public UnaryCallable listSpokesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSpokesPagedCallable()"); + } + + public UnaryCallable listSpokesCallable() { + throw new UnsupportedOperationException("Not implemented: listSpokesCallable()"); + } + + public UnaryCallable getSpokeCallable() { + throw new UnsupportedOperationException("Not implemented: getSpokeCallable()"); + } + + public OperationCallable + createSpokeOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createSpokeOperationCallable()"); + } + + public UnaryCallable createSpokeCallable() { + throw new UnsupportedOperationException("Not implemented: createSpokeCallable()"); + } + + public OperationCallable + updateSpokeOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateSpokeOperationCallable()"); + } + + public UnaryCallable updateSpokeCallable() { + throw new UnsupportedOperationException("Not implemented: updateSpokeCallable()"); + } + + public OperationCallable + deleteSpokeOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSpokeOperationCallable()"); + } + + public UnaryCallable deleteSpokeCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSpokeCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/HubServiceStubSettings.java b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/HubServiceStubSettings.java new file mode 100644 index 00000000..902f0b7b --- /dev/null +++ b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/HubServiceStubSettings.java @@ -0,0 +1,883 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.networkconnectivity.v1alpha1.stub; + +import static com.google.cloud.networkconnectivity.v1alpha1.HubServiceClient.ListHubsPagedResponse; +import static com.google.cloud.networkconnectivity.v1alpha1.HubServiceClient.ListSpokesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest; +import com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest; +import com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest; +import com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest; +import com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest; +import com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest; +import com.google.cloud.networkconnectivity.v1alpha1.Hub; +import com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest; +import com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse; +import com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest; +import com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse; +import com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata; +import com.google.cloud.networkconnectivity.v1alpha1.Spoke; +import com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest; +import com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link HubServiceStub}. + * + *

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

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

{@code
+ * HubServiceStubSettings.Builder hubServiceSettingsBuilder = HubServiceStubSettings.newBuilder();
+ * hubServiceSettingsBuilder
+ *     .getHubSettings()
+ *     .setRetrySettings(
+ *         hubServiceSettingsBuilder
+ *             .getHubSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * HubServiceStubSettings hubServiceSettings = hubServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class HubServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final PagedCallSettings + listHubsSettings; + private final UnaryCallSettings getHubSettings; + private final UnaryCallSettings createHubSettings; + private final OperationCallSettings + createHubOperationSettings; + private final UnaryCallSettings updateHubSettings; + private final OperationCallSettings + updateHubOperationSettings; + private final UnaryCallSettings deleteHubSettings; + private final OperationCallSettings + deleteHubOperationSettings; + private final PagedCallSettings + listSpokesSettings; + private final UnaryCallSettings getSpokeSettings; + private final UnaryCallSettings createSpokeSettings; + private final OperationCallSettings + createSpokeOperationSettings; + private final UnaryCallSettings updateSpokeSettings; + private final OperationCallSettings + updateSpokeOperationSettings; + private final UnaryCallSettings deleteSpokeSettings; + private final OperationCallSettings + deleteSpokeOperationSettings; + + private static final PagedListDescriptor + LIST_HUBS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListHubsRequest injectToken(ListHubsRequest payload, String token) { + return ListHubsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListHubsRequest injectPageSize(ListHubsRequest payload, int pageSize) { + return ListHubsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListHubsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListHubsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListHubsResponse payload) { + return payload.getHubsList() == null + ? ImmutableList.of() + : payload.getHubsList(); + } + }; + + private static final PagedListDescriptor + LIST_SPOKES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSpokesRequest injectToken(ListSpokesRequest payload, String token) { + return ListSpokesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSpokesRequest injectPageSize(ListSpokesRequest payload, int pageSize) { + return ListSpokesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSpokesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSpokesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSpokesResponse payload) { + return payload.getSpokesList() == null + ? ImmutableList.of() + : payload.getSpokesList(); + } + }; + + private static final PagedListResponseFactory< + ListHubsRequest, ListHubsResponse, ListHubsPagedResponse> + LIST_HUBS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListHubsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_HUBS_PAGE_STR_DESC, request, context); + return ListHubsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListSpokesRequest, ListSpokesResponse, ListSpokesPagedResponse> + LIST_SPOKES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSpokesRequest, ListSpokesResponse, ListSpokesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSpokesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SPOKES_PAGE_STR_DESC, request, context); + return ListSpokesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listHubs. */ + public PagedCallSettings + listHubsSettings() { + return listHubsSettings; + } + + /** Returns the object with the settings used for calls to getHub. */ + public UnaryCallSettings getHubSettings() { + return getHubSettings; + } + + /** Returns the object with the settings used for calls to createHub. */ + public UnaryCallSettings createHubSettings() { + return createHubSettings; + } + + /** Returns the object with the settings used for calls to createHub. */ + public OperationCallSettings + createHubOperationSettings() { + return createHubOperationSettings; + } + + /** Returns the object with the settings used for calls to updateHub. */ + public UnaryCallSettings updateHubSettings() { + return updateHubSettings; + } + + /** Returns the object with the settings used for calls to updateHub. */ + public OperationCallSettings + updateHubOperationSettings() { + return updateHubOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteHub. */ + public UnaryCallSettings deleteHubSettings() { + return deleteHubSettings; + } + + /** Returns the object with the settings used for calls to deleteHub. */ + public OperationCallSettings + deleteHubOperationSettings() { + return deleteHubOperationSettings; + } + + /** Returns the object with the settings used for calls to listSpokes. */ + public PagedCallSettings + listSpokesSettings() { + return listSpokesSettings; + } + + /** Returns the object with the settings used for calls to getSpoke. */ + public UnaryCallSettings getSpokeSettings() { + return getSpokeSettings; + } + + /** Returns the object with the settings used for calls to createSpoke. */ + public UnaryCallSettings createSpokeSettings() { + return createSpokeSettings; + } + + /** Returns the object with the settings used for calls to createSpoke. */ + public OperationCallSettings + createSpokeOperationSettings() { + return createSpokeOperationSettings; + } + + /** Returns the object with the settings used for calls to updateSpoke. */ + public UnaryCallSettings updateSpokeSettings() { + return updateSpokeSettings; + } + + /** Returns the object with the settings used for calls to updateSpoke. */ + public OperationCallSettings + updateSpokeOperationSettings() { + return updateSpokeOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteSpoke. */ + public UnaryCallSettings deleteSpokeSettings() { + return deleteSpokeSettings; + } + + /** Returns the object with the settings used for calls to deleteSpoke. */ + public OperationCallSettings + deleteSpokeOperationSettings() { + return deleteSpokeOperationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public HubServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcHubServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "networkconnectivity.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(HubServiceStubSettings.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 HubServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listHubsSettings = settingsBuilder.listHubsSettings().build(); + getHubSettings = settingsBuilder.getHubSettings().build(); + createHubSettings = settingsBuilder.createHubSettings().build(); + createHubOperationSettings = settingsBuilder.createHubOperationSettings().build(); + updateHubSettings = settingsBuilder.updateHubSettings().build(); + updateHubOperationSettings = settingsBuilder.updateHubOperationSettings().build(); + deleteHubSettings = settingsBuilder.deleteHubSettings().build(); + deleteHubOperationSettings = settingsBuilder.deleteHubOperationSettings().build(); + listSpokesSettings = settingsBuilder.listSpokesSettings().build(); + getSpokeSettings = settingsBuilder.getSpokeSettings().build(); + createSpokeSettings = settingsBuilder.createSpokeSettings().build(); + createSpokeOperationSettings = settingsBuilder.createSpokeOperationSettings().build(); + updateSpokeSettings = settingsBuilder.updateSpokeSettings().build(); + updateSpokeOperationSettings = settingsBuilder.updateSpokeOperationSettings().build(); + deleteSpokeSettings = settingsBuilder.deleteSpokeSettings().build(); + deleteSpokeOperationSettings = settingsBuilder.deleteSpokeOperationSettings().build(); + } + + /** Builder for HubServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListHubsRequest, ListHubsResponse, ListHubsPagedResponse> + listHubsSettings; + private final UnaryCallSettings.Builder getHubSettings; + private final UnaryCallSettings.Builder createHubSettings; + private final OperationCallSettings.Builder + createHubOperationSettings; + private final UnaryCallSettings.Builder updateHubSettings; + private final OperationCallSettings.Builder + updateHubOperationSettings; + private final UnaryCallSettings.Builder deleteHubSettings; + private final OperationCallSettings.Builder + deleteHubOperationSettings; + private final PagedCallSettings.Builder< + ListSpokesRequest, ListSpokesResponse, ListSpokesPagedResponse> + listSpokesSettings; + private final UnaryCallSettings.Builder getSpokeSettings; + private final UnaryCallSettings.Builder createSpokeSettings; + private final OperationCallSettings.Builder + createSpokeOperationSettings; + private final UnaryCallSettings.Builder updateSpokeSettings; + private final OperationCallSettings.Builder + updateSpokeOperationSettings; + private final UnaryCallSettings.Builder deleteSpokeSettings; + private final OperationCallSettings.Builder + deleteSpokeOperationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listHubsSettings = PagedCallSettings.newBuilder(LIST_HUBS_PAGE_STR_FACT); + getHubSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createHubSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createHubOperationSettings = OperationCallSettings.newBuilder(); + updateHubSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateHubOperationSettings = OperationCallSettings.newBuilder(); + deleteHubSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteHubOperationSettings = OperationCallSettings.newBuilder(); + listSpokesSettings = PagedCallSettings.newBuilder(LIST_SPOKES_PAGE_STR_FACT); + getSpokeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createSpokeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createSpokeOperationSettings = OperationCallSettings.newBuilder(); + updateSpokeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateSpokeOperationSettings = OperationCallSettings.newBuilder(); + deleteSpokeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteSpokeOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listHubsSettings, + getHubSettings, + createHubSettings, + updateHubSettings, + deleteHubSettings, + listSpokesSettings, + getSpokeSettings, + createSpokeSettings, + updateSpokeSettings, + deleteSpokeSettings); + initDefaults(this); + } + + protected Builder(HubServiceStubSettings settings) { + super(settings); + + listHubsSettings = settings.listHubsSettings.toBuilder(); + getHubSettings = settings.getHubSettings.toBuilder(); + createHubSettings = settings.createHubSettings.toBuilder(); + createHubOperationSettings = settings.createHubOperationSettings.toBuilder(); + updateHubSettings = settings.updateHubSettings.toBuilder(); + updateHubOperationSettings = settings.updateHubOperationSettings.toBuilder(); + deleteHubSettings = settings.deleteHubSettings.toBuilder(); + deleteHubOperationSettings = settings.deleteHubOperationSettings.toBuilder(); + listSpokesSettings = settings.listSpokesSettings.toBuilder(); + getSpokeSettings = settings.getSpokeSettings.toBuilder(); + createSpokeSettings = settings.createSpokeSettings.toBuilder(); + createSpokeOperationSettings = settings.createSpokeOperationSettings.toBuilder(); + updateSpokeSettings = settings.updateSpokeSettings.toBuilder(); + updateSpokeOperationSettings = settings.updateSpokeOperationSettings.toBuilder(); + deleteSpokeSettings = settings.deleteSpokeSettings.toBuilder(); + deleteSpokeOperationSettings = settings.deleteSpokeOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listHubsSettings, + getHubSettings, + createHubSettings, + updateHubSettings, + deleteHubSettings, + listSpokesSettings, + getSpokeSettings, + createSpokeSettings, + updateSpokeSettings, + deleteSpokeSettings); + } + + 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 + .listHubsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getHubSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createHubSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateHubSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteHubSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listSpokesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getSpokeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createSpokeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateSpokeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteSpokeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .createHubOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Hub.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateHubOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Hub.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteHubOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .createSpokeOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Spoke.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateSpokeOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Spoke.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteSpokeOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + // 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 listHubs. */ + public PagedCallSettings.Builder + listHubsSettings() { + return listHubsSettings; + } + + /** Returns the builder for the settings used for calls to getHub. */ + public UnaryCallSettings.Builder getHubSettings() { + return getHubSettings; + } + + /** Returns the builder for the settings used for calls to createHub. */ + public UnaryCallSettings.Builder createHubSettings() { + return createHubSettings; + } + + /** Returns the builder for the settings used for calls to createHub. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createHubOperationSettings() { + return createHubOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateHub. */ + public UnaryCallSettings.Builder updateHubSettings() { + return updateHubSettings; + } + + /** Returns the builder for the settings used for calls to updateHub. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateHubOperationSettings() { + return updateHubOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteHub. */ + public UnaryCallSettings.Builder deleteHubSettings() { + return deleteHubSettings; + } + + /** Returns the builder for the settings used for calls to deleteHub. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteHubOperationSettings() { + return deleteHubOperationSettings; + } + + /** Returns the builder for the settings used for calls to listSpokes. */ + public PagedCallSettings.Builder + listSpokesSettings() { + return listSpokesSettings; + } + + /** Returns the builder for the settings used for calls to getSpoke. */ + public UnaryCallSettings.Builder getSpokeSettings() { + return getSpokeSettings; + } + + /** Returns the builder for the settings used for calls to createSpoke. */ + public UnaryCallSettings.Builder createSpokeSettings() { + return createSpokeSettings; + } + + /** Returns the builder for the settings used for calls to createSpoke. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createSpokeOperationSettings() { + return createSpokeOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateSpoke. */ + public UnaryCallSettings.Builder updateSpokeSettings() { + return updateSpokeSettings; + } + + /** Returns the builder for the settings used for calls to updateSpoke. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateSpokeOperationSettings() { + return updateSpokeOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteSpoke. */ + public UnaryCallSettings.Builder deleteSpokeSettings() { + return deleteSpokeSettings; + } + + /** Returns the builder for the settings used for calls to deleteSpoke. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteSpokeOperationSettings() { + return deleteSpokeOperationSettings; + } + + @Override + public HubServiceStubSettings build() throws IOException { + return new HubServiceStubSettings(this); + } + } +} diff --git a/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceClientTest.java b/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceClientTest.java new file mode 100644 index 00000000..9eb2f6c7 --- /dev/null +++ b/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceClientTest.java @@ -0,0 +1,967 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.networkconnectivity.v1alpha1; + +import static com.google.cloud.networkconnectivity.v1alpha1.HubServiceClient.ListHubsPagedResponse; +import static com.google.cloud.networkconnectivity.v1alpha1.HubServiceClient.ListSpokesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class HubServiceClientTest { + private static MockServiceHelper mockServiceHelper; + private HubServiceClient client; + private static MockHubService mockHubService; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockHubService = new MockHubService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockHubService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + HubServiceSettings settings = + HubServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = HubServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listHubsTest() throws Exception { + Hub responsesElement = Hub.newBuilder().build(); + ListHubsResponse expectedResponse = + ListHubsResponse.newBuilder() + .setNextPageToken("") + .addAllHubs(Arrays.asList(responsesElement)) + .build(); + mockHubService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListHubsPagedResponse pagedListResponse = client.listHubs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getHubsList().get(0), resources.get(0)); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListHubsRequest actualRequest = ((ListHubsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listHubsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listHubs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listHubsTest2() throws Exception { + Hub responsesElement = Hub.newBuilder().build(); + ListHubsResponse expectedResponse = + ListHubsResponse.newBuilder() + .setNextPageToken("") + .addAllHubs(Arrays.asList(responsesElement)) + .build(); + mockHubService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListHubsPagedResponse pagedListResponse = client.listHubs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getHubsList().get(0), resources.get(0)); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListHubsRequest actualRequest = ((ListHubsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listHubsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listHubs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getHubTest() throws Exception { + Hub expectedResponse = + Hub.newBuilder() + .setName(HubName.of("[PROJECT]", "[HUB]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .addAllSpokes(new ArrayList()) + .setUniqueId("uniqueId-294460212") + .build(); + mockHubService.addResponse(expectedResponse); + + HubName name = HubName.of("[PROJECT]", "[HUB]"); + + Hub actualResponse = client.getHub(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetHubRequest actualRequest = ((GetHubRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getHubExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + HubName name = HubName.of("[PROJECT]", "[HUB]"); + client.getHub(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getHubTest2() throws Exception { + Hub expectedResponse = + Hub.newBuilder() + .setName(HubName.of("[PROJECT]", "[HUB]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .addAllSpokes(new ArrayList()) + .setUniqueId("uniqueId-294460212") + .build(); + mockHubService.addResponse(expectedResponse); + + String name = "name3373707"; + + Hub actualResponse = client.getHub(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetHubRequest actualRequest = ((GetHubRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getHubExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + String name = "name3373707"; + client.getHub(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createHubTest() throws Exception { + Hub expectedResponse = + Hub.newBuilder() + .setName(HubName.of("[PROJECT]", "[HUB]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .addAllSpokes(new ArrayList()) + .setUniqueId("uniqueId-294460212") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createHubTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Hub hub = Hub.newBuilder().build(); + String hubId = "hubId99628272"; + + Hub actualResponse = client.createHubAsync(parent, hub, hubId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateHubRequest actualRequest = ((CreateHubRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(hub, actualRequest.getHub()); + Assert.assertEquals(hubId, actualRequest.getHubId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createHubExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Hub hub = Hub.newBuilder().build(); + String hubId = "hubId99628272"; + client.createHubAsync(parent, hub, hubId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createHubTest2() throws Exception { + Hub expectedResponse = + Hub.newBuilder() + .setName(HubName.of("[PROJECT]", "[HUB]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .addAllSpokes(new ArrayList()) + .setUniqueId("uniqueId-294460212") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createHubTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + String parent = "parent-995424086"; + Hub hub = Hub.newBuilder().build(); + String hubId = "hubId99628272"; + + Hub actualResponse = client.createHubAsync(parent, hub, hubId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateHubRequest actualRequest = ((CreateHubRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(hub, actualRequest.getHub()); + Assert.assertEquals(hubId, actualRequest.getHubId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createHubExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + String parent = "parent-995424086"; + Hub hub = Hub.newBuilder().build(); + String hubId = "hubId99628272"; + client.createHubAsync(parent, hub, hubId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateHubTest() throws Exception { + Hub expectedResponse = + Hub.newBuilder() + .setName(HubName.of("[PROJECT]", "[HUB]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .addAllSpokes(new ArrayList()) + .setUniqueId("uniqueId-294460212") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateHubTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + Hub hub = Hub.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Hub actualResponse = client.updateHubAsync(hub, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateHubRequest actualRequest = ((UpdateHubRequest) actualRequests.get(0)); + + Assert.assertEquals(hub, actualRequest.getHub()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateHubExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + Hub hub = Hub.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateHubAsync(hub, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteHubTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteHubTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + HubName name = HubName.of("[PROJECT]", "[HUB]"); + + client.deleteHubAsync(name).get(); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteHubRequest actualRequest = ((DeleteHubRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteHubExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + HubName name = HubName.of("[PROJECT]", "[HUB]"); + client.deleteHubAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteHubTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteHubTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteHubAsync(name).get(); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteHubRequest actualRequest = ((DeleteHubRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteHubExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + String name = "name3373707"; + client.deleteHubAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listSpokesTest() throws Exception { + Spoke responsesElement = Spoke.newBuilder().build(); + ListSpokesResponse expectedResponse = + ListSpokesResponse.newBuilder() + .setNextPageToken("") + .addAllSpokes(Arrays.asList(responsesElement)) + .build(); + mockHubService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListSpokesPagedResponse pagedListResponse = client.listSpokes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSpokesList().get(0), resources.get(0)); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSpokesRequest actualRequest = ((ListSpokesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSpokesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listSpokes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSpokesTest2() throws Exception { + Spoke responsesElement = Spoke.newBuilder().build(); + ListSpokesResponse expectedResponse = + ListSpokesResponse.newBuilder() + .setNextPageToken("") + .addAllSpokes(Arrays.asList(responsesElement)) + .build(); + mockHubService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListSpokesPagedResponse pagedListResponse = client.listSpokes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSpokesList().get(0), resources.get(0)); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSpokesRequest actualRequest = ((ListSpokesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSpokesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listSpokes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSpokeTest() throws Exception { + Spoke expectedResponse = + Spoke.newBuilder() + .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setHub(HubName.of("[PROJECT]", "[HUB]").toString()) + .addAllLinkedVpnTunnels(new ArrayList()) + .addAllLinkedInterconnectAttachments(new ArrayList()) + .addAllLinkedRouterApplianceInstances(new ArrayList()) + .setUniqueId("uniqueId-294460212") + .build(); + mockHubService.addResponse(expectedResponse); + + SpokeName name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]"); + + Spoke actualResponse = client.getSpoke(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSpokeRequest actualRequest = ((GetSpokeRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSpokeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + SpokeName name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]"); + client.getSpoke(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSpokeTest2() throws Exception { + Spoke expectedResponse = + Spoke.newBuilder() + .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setHub(HubName.of("[PROJECT]", "[HUB]").toString()) + .addAllLinkedVpnTunnels(new ArrayList()) + .addAllLinkedInterconnectAttachments(new ArrayList()) + .addAllLinkedRouterApplianceInstances(new ArrayList()) + .setUniqueId("uniqueId-294460212") + .build(); + mockHubService.addResponse(expectedResponse); + + String name = "name3373707"; + + Spoke actualResponse = client.getSpoke(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSpokeRequest actualRequest = ((GetSpokeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSpokeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + String name = "name3373707"; + client.getSpoke(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSpokeTest() throws Exception { + Spoke expectedResponse = + Spoke.newBuilder() + .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setHub(HubName.of("[PROJECT]", "[HUB]").toString()) + .addAllLinkedVpnTunnels(new ArrayList()) + .addAllLinkedInterconnectAttachments(new ArrayList()) + .addAllLinkedRouterApplianceInstances(new ArrayList()) + .setUniqueId("uniqueId-294460212") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSpokeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Spoke spoke = Spoke.newBuilder().build(); + String spokeId = "spokeId-1998996281"; + + Spoke actualResponse = client.createSpokeAsync(parent, spoke, spokeId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSpokeRequest actualRequest = ((CreateSpokeRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(spoke, actualRequest.getSpoke()); + Assert.assertEquals(spokeId, actualRequest.getSpokeId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSpokeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Spoke spoke = Spoke.newBuilder().build(); + String spokeId = "spokeId-1998996281"; + client.createSpokeAsync(parent, spoke, spokeId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createSpokeTest2() throws Exception { + Spoke expectedResponse = + Spoke.newBuilder() + .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setHub(HubName.of("[PROJECT]", "[HUB]").toString()) + .addAllLinkedVpnTunnels(new ArrayList()) + .addAllLinkedInterconnectAttachments(new ArrayList()) + .addAllLinkedRouterApplianceInstances(new ArrayList()) + .setUniqueId("uniqueId-294460212") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSpokeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + String parent = "parent-995424086"; + Spoke spoke = Spoke.newBuilder().build(); + String spokeId = "spokeId-1998996281"; + + Spoke actualResponse = client.createSpokeAsync(parent, spoke, spokeId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSpokeRequest actualRequest = ((CreateSpokeRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(spoke, actualRequest.getSpoke()); + Assert.assertEquals(spokeId, actualRequest.getSpokeId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSpokeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + String parent = "parent-995424086"; + Spoke spoke = Spoke.newBuilder().build(); + String spokeId = "spokeId-1998996281"; + client.createSpokeAsync(parent, spoke, spokeId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateSpokeTest() throws Exception { + Spoke expectedResponse = + Spoke.newBuilder() + .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setHub(HubName.of("[PROJECT]", "[HUB]").toString()) + .addAllLinkedVpnTunnels(new ArrayList()) + .addAllLinkedInterconnectAttachments(new ArrayList()) + .addAllLinkedRouterApplianceInstances(new ArrayList()) + .setUniqueId("uniqueId-294460212") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateSpokeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + Spoke spoke = Spoke.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Spoke actualResponse = client.updateSpokeAsync(spoke, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSpokeRequest actualRequest = ((UpdateSpokeRequest) actualRequests.get(0)); + + Assert.assertEquals(spoke, actualRequest.getSpoke()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateSpokeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + Spoke spoke = Spoke.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateSpokeAsync(spoke, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteSpokeTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteSpokeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + SpokeName name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]"); + + client.deleteSpokeAsync(name).get(); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSpokeRequest actualRequest = ((DeleteSpokeRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSpokeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + SpokeName name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]"); + client.deleteSpokeAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteSpokeTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteSpokeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteSpokeAsync(name).get(); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSpokeRequest actualRequest = ((DeleteSpokeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSpokeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + String name = "name3373707"; + client.deleteSpokeAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1alpha1/MockHubService.java b/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1alpha1/MockHubService.java new file mode 100644 index 00000000..90d5c68d --- /dev/null +++ b/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1alpha1/MockHubService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.networkconnectivity.v1alpha1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockHubService implements MockGrpcService { + private final MockHubServiceImpl serviceImpl; + + public MockHubService() { + serviceImpl = new MockHubServiceImpl(); + } + + @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-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1alpha1/MockHubServiceImpl.java b/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1alpha1/MockHubServiceImpl.java new file mode 100644 index 00000000..b7ea91d5 --- /dev/null +++ b/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1alpha1/MockHubServiceImpl.java @@ -0,0 +1,202 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.networkconnectivity.v1alpha1; + +import com.google.api.core.BetaApi; +import com.google.cloud.networkconnectivity.v1alpha1.HubServiceGrpc.HubServiceImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockHubServiceImpl extends HubServiceImplBase { + private List requests; + private Queue responses; + + public MockHubServiceImpl() { + 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 listHubs(ListHubsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListHubsResponse) { + requests.add(request); + responseObserver.onNext(((ListHubsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getHub(GetHubRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Hub) { + requests.add(request); + responseObserver.onNext(((Hub) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createHub(CreateHubRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateHub(UpdateHubRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteHub(DeleteHubRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listSpokes( + ListSpokesRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListSpokesResponse) { + requests.add(request); + responseObserver.onNext(((ListSpokesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getSpoke(GetSpokeRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Spoke) { + requests.add(request); + responseObserver.onNext(((Spoke) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createSpoke(CreateSpokeRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateSpoke(UpdateSpokeRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteSpoke(DeleteSpokeRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/grpc-google-cloud-networkconnectivity-v1alpha1/pom.xml b/grpc-google-cloud-networkconnectivity-v1alpha1/pom.xml new file mode 100644 index 00000000..5d95b9f0 --- /dev/null +++ b/grpc-google-cloud-networkconnectivity-v1alpha1/pom.xml @@ -0,0 +1,65 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-networkconnectivity-v1alpha1 + 0.0.1-SNAPSHOT + grpc-google-cloud-networkconnectivity-v1alpha1 + GRPC library for google-cloud-networkconnectivity + + com.google.cloud + google-cloud-networkconnectivity-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-networkconnectivity-v1alpha1 + + + 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-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceGrpc.java b/grpc-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceGrpc.java new file mode 100644 index 00000000..fe1286a5 --- /dev/null +++ b/grpc-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceGrpc.java @@ -0,0 +1,1380 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.networkconnectivity.v1alpha1; + +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; + +/** + * + * + *
+ * Connectivity Hub is a hub-and-spoke abstraction for network connectivity
+ * management in Google Cloud. The Hub aims to reduce operational complexity
+ * through a simple, centralized connectivity management model.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/networkconnectivity/v1alpha1/hub.proto") +public final class HubServiceGrpc { + + private HubServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.networkconnectivity.v1alpha1.HubService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest, + com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse> + getListHubsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListHubs", + requestType = com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest.class, + responseType = com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest, + com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse> + getListHubsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest, + com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse> + getListHubsMethod; + if ((getListHubsMethod = HubServiceGrpc.getListHubsMethod) == null) { + synchronized (HubServiceGrpc.class) { + if ((getListHubsMethod = HubServiceGrpc.getListHubsMethod) == null) { + HubServiceGrpc.getListHubsMethod = + getListHubsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListHubs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new HubServiceMethodDescriptorSupplier("ListHubs")) + .build(); + } + } + } + return getListHubsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest, + com.google.cloud.networkconnectivity.v1alpha1.Hub> + getGetHubMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetHub", + requestType = com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest.class, + responseType = com.google.cloud.networkconnectivity.v1alpha1.Hub.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest, + com.google.cloud.networkconnectivity.v1alpha1.Hub> + getGetHubMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest, + com.google.cloud.networkconnectivity.v1alpha1.Hub> + getGetHubMethod; + if ((getGetHubMethod = HubServiceGrpc.getGetHubMethod) == null) { + synchronized (HubServiceGrpc.class) { + if ((getGetHubMethod = HubServiceGrpc.getGetHubMethod) == null) { + HubServiceGrpc.getGetHubMethod = + getGetHubMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetHub")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1alpha1.Hub + .getDefaultInstance())) + .setSchemaDescriptor(new HubServiceMethodDescriptorSupplier("GetHub")) + .build(); + } + } + } + return getGetHubMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest, + com.google.longrunning.Operation> + getCreateHubMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateHub", + requestType = com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest, + com.google.longrunning.Operation> + getCreateHubMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest, + com.google.longrunning.Operation> + getCreateHubMethod; + if ((getCreateHubMethod = HubServiceGrpc.getCreateHubMethod) == null) { + synchronized (HubServiceGrpc.class) { + if ((getCreateHubMethod = HubServiceGrpc.getCreateHubMethod) == null) { + HubServiceGrpc.getCreateHubMethod = + getCreateHubMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateHub")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new HubServiceMethodDescriptorSupplier("CreateHub")) + .build(); + } + } + } + return getCreateHubMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest, + com.google.longrunning.Operation> + getUpdateHubMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateHub", + requestType = com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest, + com.google.longrunning.Operation> + getUpdateHubMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest, + com.google.longrunning.Operation> + getUpdateHubMethod; + if ((getUpdateHubMethod = HubServiceGrpc.getUpdateHubMethod) == null) { + synchronized (HubServiceGrpc.class) { + if ((getUpdateHubMethod = HubServiceGrpc.getUpdateHubMethod) == null) { + HubServiceGrpc.getUpdateHubMethod = + getUpdateHubMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateHub")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new HubServiceMethodDescriptorSupplier("UpdateHub")) + .build(); + } + } + } + return getUpdateHubMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest, + com.google.longrunning.Operation> + getDeleteHubMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteHub", + requestType = com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest, + com.google.longrunning.Operation> + getDeleteHubMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest, + com.google.longrunning.Operation> + getDeleteHubMethod; + if ((getDeleteHubMethod = HubServiceGrpc.getDeleteHubMethod) == null) { + synchronized (HubServiceGrpc.class) { + if ((getDeleteHubMethod = HubServiceGrpc.getDeleteHubMethod) == null) { + HubServiceGrpc.getDeleteHubMethod = + getDeleteHubMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteHub")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new HubServiceMethodDescriptorSupplier("DeleteHub")) + .build(); + } + } + } + return getDeleteHubMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest, + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse> + getListSpokesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSpokes", + requestType = com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest.class, + responseType = com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest, + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse> + getListSpokesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest, + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse> + getListSpokesMethod; + if ((getListSpokesMethod = HubServiceGrpc.getListSpokesMethod) == null) { + synchronized (HubServiceGrpc.class) { + if ((getListSpokesMethod = HubServiceGrpc.getListSpokesMethod) == null) { + HubServiceGrpc.getListSpokesMethod = + getListSpokesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSpokes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse + .getDefaultInstance())) + .setSchemaDescriptor(new HubServiceMethodDescriptorSupplier("ListSpokes")) + .build(); + } + } + } + return getListSpokesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest, + com.google.cloud.networkconnectivity.v1alpha1.Spoke> + getGetSpokeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSpoke", + requestType = com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest.class, + responseType = com.google.cloud.networkconnectivity.v1alpha1.Spoke.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest, + com.google.cloud.networkconnectivity.v1alpha1.Spoke> + getGetSpokeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest, + com.google.cloud.networkconnectivity.v1alpha1.Spoke> + getGetSpokeMethod; + if ((getGetSpokeMethod = HubServiceGrpc.getGetSpokeMethod) == null) { + synchronized (HubServiceGrpc.class) { + if ((getGetSpokeMethod = HubServiceGrpc.getGetSpokeMethod) == null) { + HubServiceGrpc.getGetSpokeMethod = + getGetSpokeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSpoke")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1alpha1.Spoke + .getDefaultInstance())) + .setSchemaDescriptor(new HubServiceMethodDescriptorSupplier("GetSpoke")) + .build(); + } + } + } + return getGetSpokeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest, + com.google.longrunning.Operation> + getCreateSpokeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSpoke", + requestType = com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest, + com.google.longrunning.Operation> + getCreateSpokeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest, + com.google.longrunning.Operation> + getCreateSpokeMethod; + if ((getCreateSpokeMethod = HubServiceGrpc.getCreateSpokeMethod) == null) { + synchronized (HubServiceGrpc.class) { + if ((getCreateSpokeMethod = HubServiceGrpc.getCreateSpokeMethod) == null) { + HubServiceGrpc.getCreateSpokeMethod = + getCreateSpokeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSpoke")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new HubServiceMethodDescriptorSupplier("CreateSpoke")) + .build(); + } + } + } + return getCreateSpokeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest, + com.google.longrunning.Operation> + getUpdateSpokeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateSpoke", + requestType = com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest, + com.google.longrunning.Operation> + getUpdateSpokeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest, + com.google.longrunning.Operation> + getUpdateSpokeMethod; + if ((getUpdateSpokeMethod = HubServiceGrpc.getUpdateSpokeMethod) == null) { + synchronized (HubServiceGrpc.class) { + if ((getUpdateSpokeMethod = HubServiceGrpc.getUpdateSpokeMethod) == null) { + HubServiceGrpc.getUpdateSpokeMethod = + getUpdateSpokeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateSpoke")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new HubServiceMethodDescriptorSupplier("UpdateSpoke")) + .build(); + } + } + } + return getUpdateSpokeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest, + com.google.longrunning.Operation> + getDeleteSpokeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteSpoke", + requestType = com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest, + com.google.longrunning.Operation> + getDeleteSpokeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest, + com.google.longrunning.Operation> + getDeleteSpokeMethod; + if ((getDeleteSpokeMethod = HubServiceGrpc.getDeleteSpokeMethod) == null) { + synchronized (HubServiceGrpc.class) { + if ((getDeleteSpokeMethod = HubServiceGrpc.getDeleteSpokeMethod) == null) { + HubServiceGrpc.getDeleteSpokeMethod = + getDeleteSpokeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSpoke")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new HubServiceMethodDescriptorSupplier("DeleteSpoke")) + .build(); + } + } + } + return getDeleteSpokeMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static HubServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public HubServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HubServiceStub(channel, callOptions); + } + }; + return HubServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static HubServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public HubServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HubServiceBlockingStub(channel, callOptions); + } + }; + return HubServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static HubServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public HubServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HubServiceFutureStub(channel, callOptions); + } + }; + return HubServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Connectivity Hub is a hub-and-spoke abstraction for network connectivity
+   * management in Google Cloud. The Hub aims to reduce operational complexity
+   * through a simple, centralized connectivity management model.
+   * 
+ */ + public abstract static class HubServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists Hubs in a given project and location.
+     * 
+ */ + public void listHubs( + com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListHubsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Hub.
+     * 
+ */ + public void getHub( + com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetHubMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new Hub in a given project and location.
+     * 
+ */ + public void createHub( + com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateHubMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Hub.
+     * 
+ */ + public void updateHub( + com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateHubMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single Hub.
+     * 
+ */ + public void deleteHub( + com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteHubMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists Spokes in a given project and location.
+     * 
+ */ + public void listSpokes( + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse> + responseObserver) { + asyncUnimplementedUnaryCall(getListSpokesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Spoke.
+     * 
+ */ + public void getSpoke( + com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetSpokeMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new Spoke in a given project and location.
+     * 
+ */ + public void createSpoke( + com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateSpokeMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Spoke.
+     * 
+ */ + public void updateSpoke( + com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateSpokeMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single Spoke.
+     * 
+ */ + public void deleteSpoke( + com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteSpokeMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListHubsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest, + com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse>( + this, METHODID_LIST_HUBS))) + .addMethod( + getGetHubMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest, + com.google.cloud.networkconnectivity.v1alpha1.Hub>(this, METHODID_GET_HUB))) + .addMethod( + getCreateHubMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_HUB))) + .addMethod( + getUpdateHubMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_HUB))) + .addMethod( + getDeleteHubMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_HUB))) + .addMethod( + getListSpokesMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest, + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse>( + this, METHODID_LIST_SPOKES))) + .addMethod( + getGetSpokeMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest, + com.google.cloud.networkconnectivity.v1alpha1.Spoke>( + this, METHODID_GET_SPOKE))) + .addMethod( + getCreateSpokeMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_SPOKE))) + .addMethod( + getUpdateSpokeMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_SPOKE))) + .addMethod( + getDeleteSpokeMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_SPOKE))) + .build(); + } + } + + /** + * + * + *
+   * Connectivity Hub is a hub-and-spoke abstraction for network connectivity
+   * management in Google Cloud. The Hub aims to reduce operational complexity
+   * through a simple, centralized connectivity management model.
+   * 
+ */ + public static final class HubServiceStub extends io.grpc.stub.AbstractAsyncStub { + private HubServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected HubServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HubServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists Hubs in a given project and location.
+     * 
+ */ + public void listHubs( + com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListHubsMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Hub.
+     * 
+ */ + public void getHub( + com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetHubMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a new Hub in a given project and location.
+     * 
+ */ + public void createHub( + com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateHubMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Hub.
+     * 
+ */ + public void updateHub( + com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateHubMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Deletes a single Hub.
+     * 
+ */ + public void deleteHub( + com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteHubMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists Spokes in a given project and location.
+     * 
+ */ + public void listSpokes( + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListSpokesMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Spoke.
+     * 
+ */ + public void getSpoke( + com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetSpokeMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a new Spoke in a given project and location.
+     * 
+ */ + public void createSpoke( + com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateSpokeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Spoke.
+     * 
+ */ + public void updateSpoke( + com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateSpokeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single Spoke.
+     * 
+ */ + public void deleteSpoke( + com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteSpokeMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Connectivity Hub is a hub-and-spoke abstraction for network connectivity
+   * management in Google Cloud. The Hub aims to reduce operational complexity
+   * through a simple, centralized connectivity management model.
+   * 
+ */ + public static final class HubServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private HubServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected HubServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HubServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists Hubs in a given project and location.
+     * 
+ */ + public com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse listHubs( + com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest request) { + return blockingUnaryCall(getChannel(), getListHubsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single Hub.
+     * 
+ */ + public com.google.cloud.networkconnectivity.v1alpha1.Hub getHub( + com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest request) { + return blockingUnaryCall(getChannel(), getGetHubMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new Hub in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createHub( + com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest request) { + return blockingUnaryCall(getChannel(), getCreateHubMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Hub.
+     * 
+ */ + public com.google.longrunning.Operation updateHub( + com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest request) { + return blockingUnaryCall(getChannel(), getUpdateHubMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single Hub.
+     * 
+ */ + public com.google.longrunning.Operation deleteHub( + com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest request) { + return blockingUnaryCall(getChannel(), getDeleteHubMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists Spokes in a given project and location.
+     * 
+ */ + public com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse listSpokes( + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest request) { + return blockingUnaryCall(getChannel(), getListSpokesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single Spoke.
+     * 
+ */ + public com.google.cloud.networkconnectivity.v1alpha1.Spoke getSpoke( + com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest request) { + return blockingUnaryCall(getChannel(), getGetSpokeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new Spoke in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createSpoke( + com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest request) { + return blockingUnaryCall(getChannel(), getCreateSpokeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Spoke.
+     * 
+ */ + public com.google.longrunning.Operation updateSpoke( + com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest request) { + return blockingUnaryCall(getChannel(), getUpdateSpokeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single Spoke.
+     * 
+ */ + public com.google.longrunning.Operation deleteSpoke( + com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest request) { + return blockingUnaryCall(getChannel(), getDeleteSpokeMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Connectivity Hub is a hub-and-spoke abstraction for network connectivity
+   * management in Google Cloud. The Hub aims to reduce operational complexity
+   * through a simple, centralized connectivity management model.
+   * 
+ */ + public static final class HubServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private HubServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected HubServiceFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HubServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists Hubs in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse> + listHubs(com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest request) { + return futureUnaryCall(getChannel().newCall(getListHubsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single Hub.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.networkconnectivity.v1alpha1.Hub> + getHub(com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest request) { + return futureUnaryCall(getChannel().newCall(getGetHubMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new Hub in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createHub(com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest request) { + return futureUnaryCall(getChannel().newCall(getCreateHubMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Hub.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateHub(com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest request) { + return futureUnaryCall(getChannel().newCall(getUpdateHubMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single Hub.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteHub(com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest request) { + return futureUnaryCall(getChannel().newCall(getDeleteHubMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists Spokes in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse> + listSpokes(com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest request) { + return futureUnaryCall( + getChannel().newCall(getListSpokesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single Spoke.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.networkconnectivity.v1alpha1.Spoke> + getSpoke(com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest request) { + return futureUnaryCall(getChannel().newCall(getGetSpokeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new Spoke in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createSpoke(com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateSpokeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Spoke.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateSpoke(com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateSpokeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single Spoke.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteSpoke(com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteSpokeMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_HUBS = 0; + private static final int METHODID_GET_HUB = 1; + private static final int METHODID_CREATE_HUB = 2; + private static final int METHODID_UPDATE_HUB = 3; + private static final int METHODID_DELETE_HUB = 4; + private static final int METHODID_LIST_SPOKES = 5; + private static final int METHODID_GET_SPOKE = 6; + private static final int METHODID_CREATE_SPOKE = 7; + private static final int METHODID_UPDATE_SPOKE = 8; + private static final int METHODID_DELETE_SPOKE = 9; + + 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 HubServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(HubServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_HUBS: + serviceImpl.listHubs( + (com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse>) + responseObserver); + break; + case METHODID_GET_HUB: + serviceImpl.getHub( + (com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_HUB: + serviceImpl.createHub( + (com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_HUB: + serviceImpl.updateHub( + (com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_HUB: + serviceImpl.deleteHub( + (com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_SPOKES: + serviceImpl.listSpokes( + (com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse>) + responseObserver); + break; + case METHODID_GET_SPOKE: + serviceImpl.getSpoke( + (com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_SPOKE: + serviceImpl.createSpoke( + (com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_SPOKE: + serviceImpl.updateSpoke( + (com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_SPOKE: + serviceImpl.deleteSpoke( + (com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest) 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 HubServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + HubServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("HubService"); + } + } + + private static final class HubServiceFileDescriptorSupplier + extends HubServiceBaseDescriptorSupplier { + HubServiceFileDescriptorSupplier() {} + } + + private static final class HubServiceMethodDescriptorSupplier + extends HubServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + HubServiceMethodDescriptorSupplier(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 (HubServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new HubServiceFileDescriptorSupplier()) + .addMethod(getListHubsMethod()) + .addMethod(getGetHubMethod()) + .addMethod(getCreateHubMethod()) + .addMethod(getUpdateHubMethod()) + .addMethod(getDeleteHubMethod()) + .addMethod(getListSpokesMethod()) + .addMethod(getGetSpokeMethod()) + .addMethod(getCreateSpokeMethod()) + .addMethod(getUpdateSpokeMethod()) + .addMethod(getDeleteSpokeMethod()) + .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..c616b0f5 --- /dev/null +++ b/pom.xml @@ -0,0 +1,189 @@ + + + 4.0.0 + com.google.cloud + google-cloud-networkconnectivity-parent + pom + 0.0.1-SNAPSHOT + Google Network Connectivity Center Parent + https://github.com/googleapis/java- + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-shared-config + 0.9.2 + + + + + chingor + Jeff Ching + chingor@google.com + Google + + Developer + + + + + Google LLC + + + scm:git:git@github.com:googleapis/java-.git + scm:git:git@github.com:googleapis/java-.git + https://github.com/googleapis/java- + HEAD + + + https://github.com/googleapis/java-/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-networkconnectivity-parent + + + + + + com.google.cloud + google-cloud-networkconnectivity + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-networkconnectivity-v1alpha1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-networkconnectivity-v1alpha1 + 0.0.1-SNAPSHOT + + + + com.google.cloud + google-cloud-shared-dependencies + 0.9.0 + pom + import + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + org.objenesis:objenesis + javax.annotation:javax.annotation-api + + + + + + + + + google-cloud-networkconnectivity + proto-google-cloud-networkconnectivity-v1alpha1 + grpc-google-cloud-networkconnectivity-v1alpha1 + google-cloud-networkconnectivity-bom + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.1.1 + + + + index + dependency-info + team + ci-management + issue-management + licenses + scm + dependency-management + distribution-management + summary + modules + + + + + true + ${site.installationModule} + jar + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + 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-networkconnectivity-v1alpha1/pom.xml b/proto-google-cloud-networkconnectivity-v1alpha1/pom.xml new file mode 100644 index 00000000..d056dea4 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/pom.xml @@ -0,0 +1,42 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-networkconnectivity-v1alpha1 + 0.0.1-SNAPSHOT + proto-google-cloud-networkconnectivity-v1alpha1 + Proto library for google-cloud-networkconnectivity + + com.google.cloud + google-cloud-networkconnectivity-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-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/CommonProto.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/CommonProto.java new file mode 100644 index 00000000..0237dee1 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/CommonProto.java @@ -0,0 +1,93 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/common.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +public final class CommonProto { + private CommonProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1alpha1_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1alpha1_OperationMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n6google/cloud/networkconnectivity/v1alp" + + "ha1/common.proto\022)google.cloud.networkco" + + "nnectivity.v1alpha1\032\037google/api/field_be" + + "havior.proto\032\037google/protobuf/timestamp." + + "proto\032\034google/api/annotations.proto\"\200\002\n\021" + + "OperationMetadata\0224\n\013create_time\030\001 \001(\0132\032" + + ".google.protobuf.TimestampB\003\340A\003\0221\n\010end_t" + + "ime\030\002 \001(\0132\032.google.protobuf.TimestampB\003\340" + + "A\003\022\023\n\006target\030\003 \001(\tB\003\340A\003\022\021\n\004verb\030\004 \001(\tB\003\340" + + "A\003\022\033\n\016status_message\030\005 \001(\tB\003\340A\003\022#\n\026reque" + + "sted_cancellation\030\006 \001(\010B\003\340A\003\022\030\n\013api_vers" + + "ion\030\007 \001(\tB\003\340A\003B\234\001\n-com.google.cloud.netw" + + "orkconnectivity.v1alpha1B\013CommonProtoP\001Z" + + "\\google.golang.org/genproto/googleapis/c" + + "loud/networkconnectivity/v1alpha1;networ" + + "kconnectivityb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }); + internal_static_google_cloud_networkconnectivity_v1alpha1_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_networkconnectivity_v1alpha1_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networkconnectivity_v1alpha1_OperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusMessage", + "RequestedCancellation", + "ApiVersion", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/CreateHubRequest.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/CreateHubRequest.java new file mode 100644 index 00000000..72a21d38 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/CreateHubRequest.java @@ -0,0 +1,1388 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +/** + * + * + *
+ * Request for [HubService.CreateHub][google.cloud.networkconnectivity.v1alpha1.HubService.CreateHub] method.
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.CreateHubRequest} + */ +public final class CreateHubRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1alpha1.CreateHubRequest) + CreateHubRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateHubRequest.newBuilder() to construct. + private CreateHubRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateHubRequest() { + parent_ = ""; + hubId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateHubRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateHubRequest( + 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(); + + hubId_ = s; + break; + } + case 26: + { + com.google.cloud.networkconnectivity.v1alpha1.Hub.Builder subBuilder = null; + if (hub_ != null) { + subBuilder = hub_.toBuilder(); + } + hub_ = + input.readMessage( + com.google.cloud.networkconnectivity.v1alpha1.Hub.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(hub_); + hub_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = 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.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_CreateHubRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_CreateHubRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest.class, + com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource's name of the Hub.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource's name of the Hub.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HUB_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object hubId_; + /** + * + * + *
+   * Optional. Unique id for the Hub to create.
+   * 
+ * + * string hub_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The hubId. + */ + @java.lang.Override + public java.lang.String getHubId() { + java.lang.Object ref = hubId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hubId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Unique id for the Hub to create.
+   * 
+ * + * string hub_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for hubId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHubIdBytes() { + java.lang.Object ref = hubId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hubId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HUB_FIELD_NUMBER = 3; + private com.google.cloud.networkconnectivity.v1alpha1.Hub hub_; + /** + * + * + *
+   * Required. Initial values for a new Hub.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the hub field is set. + */ + @java.lang.Override + public boolean hasHub() { + return hub_ != null; + } + /** + * + * + *
+   * Required. Initial values for a new Hub.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The hub. + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.Hub getHub() { + return hub_ == null + ? com.google.cloud.networkconnectivity.v1alpha1.Hub.getDefaultInstance() + : hub_; + } + /** + * + * + *
+   * Required. Initial values for a new Hub.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.HubOrBuilder getHubOrBuilder() { + return getHub(); + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!getHubIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, hubId_); + } + if (hub_ != null) { + output.writeMessage(3, getHub()); + } + if (!getRequestIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + 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 (!getHubIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, hubId_); + } + if (hub_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getHub()); + } + if (!getRequestIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + 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.networkconnectivity.v1alpha1.CreateHubRequest)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest other = + (com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getHubId().equals(other.getHubId())) return false; + if (hasHub() != other.hasHub()) return false; + if (hasHub()) { + if (!getHub().equals(other.getHub())) return false; + } + if (!getRequestId().equals(other.getRequestId())) 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) + HUB_ID_FIELD_NUMBER; + hash = (53 * hash) + getHubId().hashCode(); + if (hasHub()) { + hash = (37 * hash) + HUB_FIELD_NUMBER; + hash = (53 * hash) + getHub().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest 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.networkconnectivity.v1alpha1.CreateHubRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest 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.networkconnectivity.v1alpha1.CreateHubRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest 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.networkconnectivity.v1alpha1.CreateHubRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest 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.networkconnectivity.v1alpha1.CreateHubRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest 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.networkconnectivity.v1alpha1.CreateHubRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for [HubService.CreateHub][google.cloud.networkconnectivity.v1alpha1.HubService.CreateHub] method.
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.CreateHubRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1alpha1.CreateHubRequest) + com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_CreateHubRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_CreateHubRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest.class, + com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest.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_ = ""; + + hubId_ = ""; + + if (hubBuilder_ == null) { + hub_ = null; + } else { + hub_ = null; + hubBuilder_ = null; + } + requestId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_CreateHubRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest + getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest build() { + com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest buildPartial() { + com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest result = + new com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest(this); + result.parent_ = parent_; + result.hubId_ = hubId_; + if (hubBuilder_ == null) { + result.hub_ = hub_; + } else { + result.hub_ = hubBuilder_.build(); + } + result.requestId_ = requestId_; + 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.networkconnectivity.v1alpha1.CreateHubRequest) { + return mergeFrom((com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest other) { + if (other + == com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getHubId().isEmpty()) { + hubId_ = other.hubId_; + onChanged(); + } + if (other.hasHub()) { + mergeHub(other.getHub()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + 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.networkconnectivity.v1alpha1.CreateHubRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource's name of the Hub.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource's name of the Hub.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource's name of the Hub.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource's name of the Hub.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource's name of the Hub.
+     * 
+ * + * + * 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 hubId_ = ""; + /** + * + * + *
+     * Optional. Unique id for the Hub to create.
+     * 
+ * + * string hub_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The hubId. + */ + public java.lang.String getHubId() { + java.lang.Object ref = hubId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hubId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Unique id for the Hub to create.
+     * 
+ * + * string hub_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for hubId. + */ + public com.google.protobuf.ByteString getHubIdBytes() { + java.lang.Object ref = hubId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hubId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Unique id for the Hub to create.
+     * 
+ * + * string hub_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The hubId to set. + * @return This builder for chaining. + */ + public Builder setHubId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + hubId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Unique id for the Hub to create.
+     * 
+ * + * string hub_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearHubId() { + + hubId_ = getDefaultInstance().getHubId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Unique id for the Hub to create.
+     * 
+ * + * string hub_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for hubId to set. + * @return This builder for chaining. + */ + public Builder setHubIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + hubId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.networkconnectivity.v1alpha1.Hub hub_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1alpha1.Hub, + com.google.cloud.networkconnectivity.v1alpha1.Hub.Builder, + com.google.cloud.networkconnectivity.v1alpha1.HubOrBuilder> + hubBuilder_; + /** + * + * + *
+     * Required. Initial values for a new Hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the hub field is set. + */ + public boolean hasHub() { + return hubBuilder_ != null || hub_ != null; + } + /** + * + * + *
+     * Required. Initial values for a new Hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The hub. + */ + public com.google.cloud.networkconnectivity.v1alpha1.Hub getHub() { + if (hubBuilder_ == null) { + return hub_ == null + ? com.google.cloud.networkconnectivity.v1alpha1.Hub.getDefaultInstance() + : hub_; + } else { + return hubBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Initial values for a new Hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setHub(com.google.cloud.networkconnectivity.v1alpha1.Hub value) { + if (hubBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + hub_ = value; + onChanged(); + } else { + hubBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Initial values for a new Hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setHub( + com.google.cloud.networkconnectivity.v1alpha1.Hub.Builder builderForValue) { + if (hubBuilder_ == null) { + hub_ = builderForValue.build(); + onChanged(); + } else { + hubBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Initial values for a new Hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeHub(com.google.cloud.networkconnectivity.v1alpha1.Hub value) { + if (hubBuilder_ == null) { + if (hub_ != null) { + hub_ = + com.google.cloud.networkconnectivity.v1alpha1.Hub.newBuilder(hub_) + .mergeFrom(value) + .buildPartial(); + } else { + hub_ = value; + } + onChanged(); + } else { + hubBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Initial values for a new Hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearHub() { + if (hubBuilder_ == null) { + hub_ = null; + onChanged(); + } else { + hub_ = null; + hubBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Initial values for a new Hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networkconnectivity.v1alpha1.Hub.Builder getHubBuilder() { + + onChanged(); + return getHubFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Initial values for a new Hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networkconnectivity.v1alpha1.HubOrBuilder getHubOrBuilder() { + if (hubBuilder_ != null) { + return hubBuilder_.getMessageOrBuilder(); + } else { + return hub_ == null + ? com.google.cloud.networkconnectivity.v1alpha1.Hub.getDefaultInstance() + : hub_; + } + } + /** + * + * + *
+     * Required. Initial values for a new Hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1alpha1.Hub, + com.google.cloud.networkconnectivity.v1alpha1.Hub.Builder, + com.google.cloud.networkconnectivity.v1alpha1.HubOrBuilder> + getHubFieldBuilder() { + if (hubBuilder_ == null) { + hubBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1alpha1.Hub, + com.google.cloud.networkconnectivity.v1alpha1.Hub.Builder, + com.google.cloud.networkconnectivity.v1alpha1.HubOrBuilder>( + getHub(), getParentForChildren(), isClean()); + hub_ = null; + } + return hubBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + @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.networkconnectivity.v1alpha1.CreateHubRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1alpha1.CreateHubRequest) + private static final com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest(); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateHubRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateHubRequest(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.networkconnectivity.v1alpha1.CreateHubRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/CreateHubRequestOrBuilder.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/CreateHubRequestOrBuilder.java new file mode 100644 index 00000000..fecd3ded --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/CreateHubRequestOrBuilder.java @@ -0,0 +1,165 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +public interface CreateHubRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1alpha1.CreateHubRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource's name of the Hub.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource's name of the Hub.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Unique id for the Hub to create.
+   * 
+ * + * string hub_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The hubId. + */ + java.lang.String getHubId(); + /** + * + * + *
+   * Optional. Unique id for the Hub to create.
+   * 
+ * + * string hub_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for hubId. + */ + com.google.protobuf.ByteString getHubIdBytes(); + + /** + * + * + *
+   * Required. Initial values for a new Hub.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the hub field is set. + */ + boolean hasHub(); + /** + * + * + *
+   * Required. Initial values for a new Hub.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The hub. + */ + com.google.cloud.networkconnectivity.v1alpha1.Hub getHub(); + /** + * + * + *
+   * Required. Initial values for a new Hub.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.networkconnectivity.v1alpha1.HubOrBuilder getHubOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/CreateSpokeRequest.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/CreateSpokeRequest.java new file mode 100644 index 00000000..1ec6a5aa --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/CreateSpokeRequest.java @@ -0,0 +1,1389 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +/** + * + * + *
+ * The request for [HubService.CreateSpoke][google.cloud.networkconnectivity.v1alpha1.HubService.CreateSpoke].
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest} + */ +public final class CreateSpokeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest) + CreateSpokeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateSpokeRequest.newBuilder() to construct. + private CreateSpokeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSpokeRequest() { + parent_ = ""; + spokeId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateSpokeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateSpokeRequest( + 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(); + + spokeId_ = s; + break; + } + case 26: + { + com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder subBuilder = null; + if (spoke_ != null) { + subBuilder = spoke_.toBuilder(); + } + spoke_ = + input.readMessage( + com.google.cloud.networkconnectivity.v1alpha1.Spoke.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(spoke_); + spoke_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = 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.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_CreateSpokeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_CreateSpokeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest.class, + com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent's resource name of the Spoke.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent's resource name of the Spoke.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SPOKE_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object spokeId_; + /** + * + * + *
+   * Optional. Unique id for the Spoke to create.
+   * 
+ * + * string spoke_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The spokeId. + */ + @java.lang.Override + public java.lang.String getSpokeId() { + java.lang.Object ref = spokeId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + spokeId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Unique id for the Spoke to create.
+   * 
+ * + * string spoke_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for spokeId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSpokeIdBytes() { + java.lang.Object ref = spokeId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + spokeId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SPOKE_FIELD_NUMBER = 3; + private com.google.cloud.networkconnectivity.v1alpha1.Spoke spoke_; + /** + * + * + *
+   * Required. Initial values for a new Hub.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the spoke field is set. + */ + @java.lang.Override + public boolean hasSpoke() { + return spoke_ != null; + } + /** + * + * + *
+   * Required. Initial values for a new Hub.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The spoke. + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.Spoke getSpoke() { + return spoke_ == null + ? com.google.cloud.networkconnectivity.v1alpha1.Spoke.getDefaultInstance() + : spoke_; + } + /** + * + * + *
+   * Required. Initial values for a new Hub.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder getSpokeOrBuilder() { + return getSpoke(); + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!getSpokeIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, spokeId_); + } + if (spoke_ != null) { + output.writeMessage(3, getSpoke()); + } + if (!getRequestIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + 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 (!getSpokeIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, spokeId_); + } + if (spoke_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSpoke()); + } + if (!getRequestIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + 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.networkconnectivity.v1alpha1.CreateSpokeRequest)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest other = + (com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getSpokeId().equals(other.getSpokeId())) return false; + if (hasSpoke() != other.hasSpoke()) return false; + if (hasSpoke()) { + if (!getSpoke().equals(other.getSpoke())) return false; + } + if (!getRequestId().equals(other.getRequestId())) 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) + SPOKE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSpokeId().hashCode(); + if (hasSpoke()) { + hash = (37 * hash) + SPOKE_FIELD_NUMBER; + hash = (53 * hash) + getSpoke().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest 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.networkconnectivity.v1alpha1.CreateSpokeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest 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.networkconnectivity.v1alpha1.CreateSpokeRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest 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.networkconnectivity.v1alpha1.CreateSpokeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest 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.networkconnectivity.v1alpha1.CreateSpokeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest 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.networkconnectivity.v1alpha1.CreateSpokeRequest 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 [HubService.CreateSpoke][google.cloud.networkconnectivity.v1alpha1.HubService.CreateSpoke].
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest) + com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_CreateSpokeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_CreateSpokeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest.class, + com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest.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_ = ""; + + spokeId_ = ""; + + if (spokeBuilder_ == null) { + spoke_ = null; + } else { + spoke_ = null; + spokeBuilder_ = null; + } + requestId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_CreateSpokeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest + getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest build() { + com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest buildPartial() { + com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest result = + new com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest(this); + result.parent_ = parent_; + result.spokeId_ = spokeId_; + if (spokeBuilder_ == null) { + result.spoke_ = spoke_; + } else { + result.spoke_ = spokeBuilder_.build(); + } + result.requestId_ = requestId_; + 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.networkconnectivity.v1alpha1.CreateSpokeRequest) { + return mergeFrom((com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest other) { + if (other + == com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getSpokeId().isEmpty()) { + spokeId_ = other.spokeId_; + onChanged(); + } + if (other.hasSpoke()) { + mergeSpoke(other.getSpoke()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + 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.networkconnectivity.v1alpha1.CreateSpokeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent's resource name of the Spoke.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent's resource name of the Spoke.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent's resource name of the Spoke.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent's resource name of the Spoke.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent's resource name of the Spoke.
+     * 
+ * + * + * 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 spokeId_ = ""; + /** + * + * + *
+     * Optional. Unique id for the Spoke to create.
+     * 
+ * + * string spoke_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The spokeId. + */ + public java.lang.String getSpokeId() { + java.lang.Object ref = spokeId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + spokeId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Unique id for the Spoke to create.
+     * 
+ * + * string spoke_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for spokeId. + */ + public com.google.protobuf.ByteString getSpokeIdBytes() { + java.lang.Object ref = spokeId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + spokeId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Unique id for the Spoke to create.
+     * 
+ * + * string spoke_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The spokeId to set. + * @return This builder for chaining. + */ + public Builder setSpokeId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + spokeId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Unique id for the Spoke to create.
+     * 
+ * + * string spoke_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearSpokeId() { + + spokeId_ = getDefaultInstance().getSpokeId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Unique id for the Spoke to create.
+     * 
+ * + * string spoke_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for spokeId to set. + * @return This builder for chaining. + */ + public Builder setSpokeIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + spokeId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.networkconnectivity.v1alpha1.Spoke spoke_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1alpha1.Spoke, + com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder, + com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder> + spokeBuilder_; + /** + * + * + *
+     * Required. Initial values for a new Hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the spoke field is set. + */ + public boolean hasSpoke() { + return spokeBuilder_ != null || spoke_ != null; + } + /** + * + * + *
+     * Required. Initial values for a new Hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The spoke. + */ + public com.google.cloud.networkconnectivity.v1alpha1.Spoke getSpoke() { + if (spokeBuilder_ == null) { + return spoke_ == null + ? com.google.cloud.networkconnectivity.v1alpha1.Spoke.getDefaultInstance() + : spoke_; + } else { + return spokeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Initial values for a new Hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSpoke(com.google.cloud.networkconnectivity.v1alpha1.Spoke value) { + if (spokeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + spoke_ = value; + onChanged(); + } else { + spokeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Initial values for a new Hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSpoke( + com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder builderForValue) { + if (spokeBuilder_ == null) { + spoke_ = builderForValue.build(); + onChanged(); + } else { + spokeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Initial values for a new Hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSpoke(com.google.cloud.networkconnectivity.v1alpha1.Spoke value) { + if (spokeBuilder_ == null) { + if (spoke_ != null) { + spoke_ = + com.google.cloud.networkconnectivity.v1alpha1.Spoke.newBuilder(spoke_) + .mergeFrom(value) + .buildPartial(); + } else { + spoke_ = value; + } + onChanged(); + } else { + spokeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Initial values for a new Hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSpoke() { + if (spokeBuilder_ == null) { + spoke_ = null; + onChanged(); + } else { + spoke_ = null; + spokeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Initial values for a new Hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder getSpokeBuilder() { + + onChanged(); + return getSpokeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Initial values for a new Hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder getSpokeOrBuilder() { + if (spokeBuilder_ != null) { + return spokeBuilder_.getMessageOrBuilder(); + } else { + return spoke_ == null + ? com.google.cloud.networkconnectivity.v1alpha1.Spoke.getDefaultInstance() + : spoke_; + } + } + /** + * + * + *
+     * Required. Initial values for a new Hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1alpha1.Spoke, + com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder, + com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder> + getSpokeFieldBuilder() { + if (spokeBuilder_ == null) { + spokeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1alpha1.Spoke, + com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder, + com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder>( + getSpoke(), getParentForChildren(), isClean()); + spoke_ = null; + } + return spokeBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + @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.networkconnectivity.v1alpha1.CreateSpokeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest) + private static final com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest(); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSpokeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateSpokeRequest(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.networkconnectivity.v1alpha1.CreateSpokeRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/CreateSpokeRequestOrBuilder.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/CreateSpokeRequestOrBuilder.java new file mode 100644 index 00000000..0acea62a --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/CreateSpokeRequestOrBuilder.java @@ -0,0 +1,165 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +public interface CreateSpokeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent's resource name of the Spoke.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent's resource name of the Spoke.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Unique id for the Spoke to create.
+   * 
+ * + * string spoke_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The spokeId. + */ + java.lang.String getSpokeId(); + /** + * + * + *
+   * Optional. Unique id for the Spoke to create.
+   * 
+ * + * string spoke_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for spokeId. + */ + com.google.protobuf.ByteString getSpokeIdBytes(); + + /** + * + * + *
+   * Required. Initial values for a new Hub.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the spoke field is set. + */ + boolean hasSpoke(); + /** + * + * + *
+   * Required. Initial values for a new Hub.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The spoke. + */ + com.google.cloud.networkconnectivity.v1alpha1.Spoke getSpoke(); + /** + * + * + *
+   * Required. Initial values for a new Hub.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder getSpokeOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/DeleteHubRequest.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/DeleteHubRequest.java new file mode 100644 index 00000000..441829f5 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/DeleteHubRequest.java @@ -0,0 +1,906 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +/** + * + * + *
+ * The request for [HubService.DeleteHub][google.cloud.networkconnectivity.v1alpha1.HubService.DeleteHub].
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest} + */ +public final class DeleteHubRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest) + DeleteHubRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteHubRequest.newBuilder() to construct. + private DeleteHubRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteHubRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteHubRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteHubRequest( + 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(); + + requestId_ = 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.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_DeleteHubRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_DeleteHubRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest.class, + com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the Hub to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Hub to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!getRequestIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + 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 (!getRequestIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + 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.networkconnectivity.v1alpha1.DeleteHubRequest)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest other = + (com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest 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.networkconnectivity.v1alpha1.DeleteHubRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest 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.networkconnectivity.v1alpha1.DeleteHubRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest 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.networkconnectivity.v1alpha1.DeleteHubRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest 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.networkconnectivity.v1alpha1.DeleteHubRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest 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.networkconnectivity.v1alpha1.DeleteHubRequest 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 [HubService.DeleteHub][google.cloud.networkconnectivity.v1alpha1.HubService.DeleteHub].
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest) + com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_DeleteHubRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_DeleteHubRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest.class, + com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest.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_ = ""; + + requestId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_DeleteHubRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest + getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest build() { + com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest buildPartial() { + com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest result = + new com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest(this); + result.name_ = name_; + result.requestId_ = requestId_; + 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.networkconnectivity.v1alpha1.DeleteHubRequest) { + return mergeFrom((com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest other) { + if (other + == com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + 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.networkconnectivity.v1alpha1.DeleteHubRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the Hub to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Hub to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Hub to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Hub to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Hub to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + @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.networkconnectivity.v1alpha1.DeleteHubRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest) + private static final com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest(); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteHubRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteHubRequest(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.networkconnectivity.v1alpha1.DeleteHubRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/DeleteHubRequestOrBuilder.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/DeleteHubRequestOrBuilder.java new file mode 100644 index 00000000..033fd24f --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/DeleteHubRequestOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +public interface DeleteHubRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1alpha1.DeleteHubRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Hub to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the Hub to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/DeleteSpokeRequest.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/DeleteSpokeRequest.java new file mode 100644 index 00000000..03c59d01 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/DeleteSpokeRequest.java @@ -0,0 +1,907 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +/** + * + * + *
+ * The request for [HubService.DeleteSpoke][google.cloud.networkconnectivity.v1alpha1.HubService.DeleteSpoke].
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest} + */ +public final class DeleteSpokeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest) + DeleteSpokeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteSpokeRequest.newBuilder() to construct. + private DeleteSpokeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteSpokeRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteSpokeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteSpokeRequest( + 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(); + + requestId_ = 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.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_DeleteSpokeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_DeleteSpokeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest.class, + com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the Spoke to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Spoke to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!getRequestIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + 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 (!getRequestIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + 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.networkconnectivity.v1alpha1.DeleteSpokeRequest)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest other = + (com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest 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.networkconnectivity.v1alpha1.DeleteSpokeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest 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.networkconnectivity.v1alpha1.DeleteSpokeRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest 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.networkconnectivity.v1alpha1.DeleteSpokeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest 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.networkconnectivity.v1alpha1.DeleteSpokeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest 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.networkconnectivity.v1alpha1.DeleteSpokeRequest 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 [HubService.DeleteSpoke][google.cloud.networkconnectivity.v1alpha1.HubService.DeleteSpoke].
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest) + com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_DeleteSpokeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_DeleteSpokeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest.class, + com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest.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_ = ""; + + requestId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_DeleteSpokeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest + getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest build() { + com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest buildPartial() { + com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest result = + new com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest(this); + result.name_ = name_; + result.requestId_ = requestId_; + 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.networkconnectivity.v1alpha1.DeleteSpokeRequest) { + return mergeFrom((com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest other) { + if (other + == com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + 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.networkconnectivity.v1alpha1.DeleteSpokeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the Spoke to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Spoke to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Spoke to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Spoke to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Spoke to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + @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.networkconnectivity.v1alpha1.DeleteSpokeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest) + private static final com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest(); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteSpokeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteSpokeRequest(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.networkconnectivity.v1alpha1.DeleteSpokeRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/DeleteSpokeRequestOrBuilder.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/DeleteSpokeRequestOrBuilder.java new file mode 100644 index 00000000..a1bef18b --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/DeleteSpokeRequestOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +public interface DeleteSpokeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1alpha1.DeleteSpokeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Spoke to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the Spoke to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/GetHubRequest.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/GetHubRequest.java new file mode 100644 index 00000000..87bbdfd9 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/GetHubRequest.java @@ -0,0 +1,651 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +/** + * + * + *
+ * Request for [HubService.GetHub][google.cloud.networkconnectivity.v1alpha1.HubService.GetHub] method.
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.GetHubRequest} + */ +public final class GetHubRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1alpha1.GetHubRequest) + GetHubRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetHubRequest.newBuilder() to construct. + private GetHubRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetHubRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetHubRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetHubRequest( + 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.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_GetHubRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_GetHubRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest.class, + com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the Hub resource to get.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the Hub resource to get.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest other = + (com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest) 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.networkconnectivity.v1alpha1.GetHubRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest 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.networkconnectivity.v1alpha1.GetHubRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest 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.networkconnectivity.v1alpha1.GetHubRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest 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.networkconnectivity.v1alpha1.GetHubRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest 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.networkconnectivity.v1alpha1.GetHubRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest 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.networkconnectivity.v1alpha1.GetHubRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for [HubService.GetHub][google.cloud.networkconnectivity.v1alpha1.HubService.GetHub] method.
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.GetHubRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1alpha1.GetHubRequest) + com.google.cloud.networkconnectivity.v1alpha1.GetHubRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_GetHubRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_GetHubRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest.class, + com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest.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.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_GetHubRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest build() { + com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest buildPartial() { + com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest result = + new com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest(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.networkconnectivity.v1alpha1.GetHubRequest) { + return mergeFrom((com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest other) { + if (other == com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest.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.networkconnectivity.v1alpha1.GetHubRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the Hub resource to get.
+     * 
+ * + * + * 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 Hub resource to get.
+     * 
+ * + * + * 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 Hub resource to get.
+     * 
+ * + * + * 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 Hub resource to get.
+     * 
+ * + * + * 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 Hub resource to get.
+     * 
+ * + * + * 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.networkconnectivity.v1alpha1.GetHubRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1alpha1.GetHubRequest) + private static final com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest(); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.GetHubRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetHubRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetHubRequest(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.networkconnectivity.v1alpha1.GetHubRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/GetHubRequestOrBuilder.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/GetHubRequestOrBuilder.java new file mode 100644 index 00000000..f27e985b --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/GetHubRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +public interface GetHubRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1alpha1.GetHubRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the Hub resource to get.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the Hub resource to get.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/GetSpokeRequest.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/GetSpokeRequest.java new file mode 100644 index 00000000..df13a551 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/GetSpokeRequest.java @@ -0,0 +1,655 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +/** + * + * + *
+ * The request for [HubService.GetSpoke][google.cloud.networkconnectivity.v1alpha1.HubService.GetSpoke].
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest} + */ +public final class GetSpokeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest) + GetSpokeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetSpokeRequest.newBuilder() to construct. + private GetSpokeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetSpokeRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetSpokeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetSpokeRequest( + 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.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_GetSpokeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_GetSpokeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest.class, + com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of Spoke resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of Spoke resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest other = + (com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest) 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.networkconnectivity.v1alpha1.GetSpokeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest 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.networkconnectivity.v1alpha1.GetSpokeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest 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.networkconnectivity.v1alpha1.GetSpokeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest 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.networkconnectivity.v1alpha1.GetSpokeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest 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.networkconnectivity.v1alpha1.GetSpokeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest 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.networkconnectivity.v1alpha1.GetSpokeRequest 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 [HubService.GetSpoke][google.cloud.networkconnectivity.v1alpha1.HubService.GetSpoke].
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest) + com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_GetSpokeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_GetSpokeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest.class, + com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest.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.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_GetSpokeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest + getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest build() { + com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest buildPartial() { + com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest result = + new com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest(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.networkconnectivity.v1alpha1.GetSpokeRequest) { + return mergeFrom((com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest other) { + if (other + == com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest.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.networkconnectivity.v1alpha1.GetSpokeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of Spoke resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of Spoke resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of Spoke resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of Spoke resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of Spoke resource.
+     * 
+ * + * + * 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.networkconnectivity.v1alpha1.GetSpokeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest) + private static final com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest(); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSpokeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetSpokeRequest(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.networkconnectivity.v1alpha1.GetSpokeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/GetSpokeRequestOrBuilder.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/GetSpokeRequestOrBuilder.java new file mode 100644 index 00000000..f96c9a12 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/GetSpokeRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +public interface GetSpokeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of Spoke resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of Spoke resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/Hub.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/Hub.java new file mode 100644 index 00000000..07e479fc --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/Hub.java @@ -0,0 +1,2184 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +/** + * + * + *
+ * The Connectivity Hub is a hub-and-spoke abstraction for network connectivity
+ * management in Google Cloud. It aims to reduce operational complexity
+ * through a simple, centralized connectivity management model. Here is the
+ * resource message of a Hub.
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.Hub} + */ +public final class Hub extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1alpha1.Hub) + HubOrBuilder { + private static final long serialVersionUID = 0L; + // Use Hub.newBuilder() to construct. + private Hub(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Hub() { + name_ = ""; + description_ = ""; + spokes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + uniqueId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Hub(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Hub( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + spokes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + spokes_.add(s); + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + uniqueId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + spokes_ = spokes_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_Hub_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_Hub_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.Hub.class, + com.google.cloud.networkconnectivity.v1alpha1.Hub.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Immutable. The name of a Hub resource.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. The name of a Hub resource.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Time when the Hub was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Time when the Hub was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Time when the Hub was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Time when the Hub was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Time when the Hub was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Time when the Hub was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int LABELS_FIELD_NUMBER = 4; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_Hub_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * User-defined labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * User-defined labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * User-defined labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * User-defined labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int DESCRIPTION_FIELD_NUMBER = 5; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Short description of the hub resource.
+   * 
+ * + * string description = 5; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Short description of the hub resource.
+   * 
+ * + * string description = 5; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SPOKES_FIELD_NUMBER = 6; + private com.google.protobuf.LazyStringList spokes_; + /** + * + * + *
+   * Output only. A list of the URIs of all attached spokes
+   * 
+ * + * + * repeated string spokes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the spokes. + */ + public com.google.protobuf.ProtocolStringList getSpokesList() { + return spokes_; + } + /** + * + * + *
+   * Output only. A list of the URIs of all attached spokes
+   * 
+ * + * + * repeated string spokes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of spokes. + */ + public int getSpokesCount() { + return spokes_.size(); + } + /** + * + * + *
+   * Output only. A list of the URIs of all attached spokes
+   * 
+ * + * + * repeated string spokes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The spokes at the given index. + */ + public java.lang.String getSpokes(int index) { + return spokes_.get(index); + } + /** + * + * + *
+   * Output only. A list of the URIs of all attached spokes
+   * 
+ * + * + * repeated string spokes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the spokes at the given index. + */ + public com.google.protobuf.ByteString getSpokesBytes(int index) { + return spokes_.getByteString(index); + } + + public static final int UNIQUE_ID_FIELD_NUMBER = 8; + private volatile java.lang.Object uniqueId_; + /** + * + * + *
+   * Output only. Google-generated UUID for this resource. This is unique across all Hub
+   * resources. If a Hub resource is deleted and another with the same name is
+   * created, it gets a different unique_id.
+   * 
+ * + * string unique_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uniqueId. + */ + @java.lang.Override + public java.lang.String getUniqueId() { + java.lang.Object ref = uniqueId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uniqueId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Google-generated UUID for this resource. This is unique across all Hub
+   * resources. If a Hub resource is deleted and another with the same name is
+   * created, it gets a different unique_id.
+   * 
+ * + * string unique_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uniqueId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUniqueIdBytes() { + java.lang.Object ref = uniqueId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uniqueId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (createTime_ != null) { + output.writeMessage(2, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(3, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, description_); + } + for (int i = 0; i < spokes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, spokes_.getRaw(i)); + } + if (!getUniqueIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, uniqueId_); + } + 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 (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, labels__); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, description_); + } + { + int dataSize = 0; + for (int i = 0; i < spokes_.size(); i++) { + dataSize += computeStringSizeNoTag(spokes_.getRaw(i)); + } + size += dataSize; + size += 1 * getSpokesList().size(); + } + if (!getUniqueIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, uniqueId_); + } + 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.networkconnectivity.v1alpha1.Hub)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1alpha1.Hub other = + (com.google.cloud.networkconnectivity.v1alpha1.Hub) obj; + + if (!getName().equals(other.getName())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getSpokesList().equals(other.getSpokesList())) return false; + if (!getUniqueId().equals(other.getUniqueId())) 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 (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getSpokesCount() > 0) { + hash = (37 * hash) + SPOKES_FIELD_NUMBER; + hash = (53 * hash) + getSpokesList().hashCode(); + } + hash = (37 * hash) + UNIQUE_ID_FIELD_NUMBER; + hash = (53 * hash) + getUniqueId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1alpha1.Hub parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.Hub 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.networkconnectivity.v1alpha1.Hub parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.Hub 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.networkconnectivity.v1alpha1.Hub parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.Hub parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.Hub parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.Hub 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.networkconnectivity.v1alpha1.Hub parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.Hub 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.networkconnectivity.v1alpha1.Hub parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.Hub 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.networkconnectivity.v1alpha1.Hub 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 Connectivity Hub is a hub-and-spoke abstraction for network connectivity
+   * management in Google Cloud. It aims to reduce operational complexity
+   * through a simple, centralized connectivity management model. Here is the
+   * resource message of a Hub.
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.Hub} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1alpha1.Hub) + com.google.cloud.networkconnectivity.v1alpha1.HubOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_Hub_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_Hub_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.Hub.class, + com.google.cloud.networkconnectivity.v1alpha1.Hub.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1alpha1.Hub.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 (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + description_ = ""; + + spokes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + uniqueId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_Hub_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.Hub getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1alpha1.Hub.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.Hub build() { + com.google.cloud.networkconnectivity.v1alpha1.Hub result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.Hub buildPartial() { + com.google.cloud.networkconnectivity.v1alpha1.Hub result = + new com.google.cloud.networkconnectivity.v1alpha1.Hub(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.description_ = description_; + if (((bitField0_ & 0x00000002) != 0)) { + spokes_ = spokes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.spokes_ = spokes_; + result.uniqueId_ = uniqueId_; + 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.networkconnectivity.v1alpha1.Hub) { + return mergeFrom((com.google.cloud.networkconnectivity.v1alpha1.Hub) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1alpha1.Hub other) { + if (other == com.google.cloud.networkconnectivity.v1alpha1.Hub.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (!other.spokes_.isEmpty()) { + if (spokes_.isEmpty()) { + spokes_ = other.spokes_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSpokesIsMutable(); + spokes_.addAll(other.spokes_); + } + onChanged(); + } + if (!other.getUniqueId().isEmpty()) { + uniqueId_ = other.uniqueId_; + 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.networkconnectivity.v1alpha1.Hub parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1alpha1.Hub) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. The name of a Hub resource.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+     * Immutable. The name of a Hub resource.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+     * Immutable. The name of a Hub resource.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + /** + * + * + *
+     * Immutable. The name of a Hub resource.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The name of a Hub resource.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Time when the Hub was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Time when the Hub was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time when the Hub was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time when the Hub was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time when the Hub was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time when the Hub was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time when the Hub was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time when the Hub was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Time when the Hub was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Time when the Hub was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Time when the Hub was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time when the Hub was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time when the Hub was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time when the Hub was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time when the Hub was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time when the Hub was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time when the Hub was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Time when the Hub was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * User-defined labels.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * User-defined labels.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * User-defined labels.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * User-defined labels.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * User-defined labels.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * User-defined labels.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * User-defined labels.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Short description of the hub resource.
+     * 
+ * + * string description = 5; + * + * @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; + } + } + /** + * + * + *
+     * Short description of the hub resource.
+     * 
+ * + * string description = 5; + * + * @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; + } + } + /** + * + * + *
+     * Short description of the hub resource.
+     * 
+ * + * string description = 5; + * + * @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; + } + /** + * + * + *
+     * Short description of the hub resource.
+     * 
+ * + * string description = 5; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Short description of the hub resource.
+     * 
+ * + * string description = 5; + * + * @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.LazyStringList spokes_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureSpokesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + spokes_ = new com.google.protobuf.LazyStringArrayList(spokes_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Output only. A list of the URIs of all attached spokes
+     * 
+ * + * + * repeated string spokes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the spokes. + */ + public com.google.protobuf.ProtocolStringList getSpokesList() { + return spokes_.getUnmodifiableView(); + } + /** + * + * + *
+     * Output only. A list of the URIs of all attached spokes
+     * 
+ * + * + * repeated string spokes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of spokes. + */ + public int getSpokesCount() { + return spokes_.size(); + } + /** + * + * + *
+     * Output only. A list of the URIs of all attached spokes
+     * 
+ * + * + * repeated string spokes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The spokes at the given index. + */ + public java.lang.String getSpokes(int index) { + return spokes_.get(index); + } + /** + * + * + *
+     * Output only. A list of the URIs of all attached spokes
+     * 
+ * + * + * repeated string spokes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the spokes at the given index. + */ + public com.google.protobuf.ByteString getSpokesBytes(int index) { + return spokes_.getByteString(index); + } + /** + * + * + *
+     * Output only. A list of the URIs of all attached spokes
+     * 
+ * + * + * repeated string spokes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index to set the value at. + * @param value The spokes to set. + * @return This builder for chaining. + */ + public Builder setSpokes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpokesIsMutable(); + spokes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A list of the URIs of all attached spokes
+     * 
+ * + * + * repeated string spokes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The spokes to add. + * @return This builder for chaining. + */ + public Builder addSpokes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpokesIsMutable(); + spokes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A list of the URIs of all attached spokes
+     * 
+ * + * + * repeated string spokes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param values The spokes to add. + * @return This builder for chaining. + */ + public Builder addAllSpokes(java.lang.Iterable values) { + ensureSpokesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, spokes_); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A list of the URIs of all attached spokes
+     * 
+ * + * + * repeated string spokes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearSpokes() { + spokes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A list of the URIs of all attached spokes
+     * 
+ * + * + * repeated string spokes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes of the spokes to add. + * @return This builder for chaining. + */ + public Builder addSpokesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureSpokesIsMutable(); + spokes_.add(value); + onChanged(); + return this; + } + + private java.lang.Object uniqueId_ = ""; + /** + * + * + *
+     * Output only. Google-generated UUID for this resource. This is unique across all Hub
+     * resources. If a Hub resource is deleted and another with the same name is
+     * created, it gets a different unique_id.
+     * 
+ * + * string unique_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uniqueId. + */ + public java.lang.String getUniqueId() { + java.lang.Object ref = uniqueId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uniqueId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Google-generated UUID for this resource. This is unique across all Hub
+     * resources. If a Hub resource is deleted and another with the same name is
+     * created, it gets a different unique_id.
+     * 
+ * + * string unique_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uniqueId. + */ + public com.google.protobuf.ByteString getUniqueIdBytes() { + java.lang.Object ref = uniqueId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uniqueId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Google-generated UUID for this resource. This is unique across all Hub
+     * resources. If a Hub resource is deleted and another with the same name is
+     * created, it gets a different unique_id.
+     * 
+ * + * string unique_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uniqueId to set. + * @return This builder for chaining. + */ + public Builder setUniqueId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uniqueId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Google-generated UUID for this resource. This is unique across all Hub
+     * resources. If a Hub resource is deleted and another with the same name is
+     * created, it gets a different unique_id.
+     * 
+ * + * string unique_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUniqueId() { + + uniqueId_ = getDefaultInstance().getUniqueId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Google-generated UUID for this resource. This is unique across all Hub
+     * resources. If a Hub resource is deleted and another with the same name is
+     * created, it gets a different unique_id.
+     * 
+ * + * string unique_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uniqueId to set. + * @return This builder for chaining. + */ + public Builder setUniqueIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uniqueId_ = 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.networkconnectivity.v1alpha1.Hub) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1alpha1.Hub) + private static final com.google.cloud.networkconnectivity.v1alpha1.Hub DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1alpha1.Hub(); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.Hub getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Hub parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Hub(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.networkconnectivity.v1alpha1.Hub getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubName.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubName.java new file mode 100644 index 00000000..66b9b336 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubName.java @@ -0,0 +1,191 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.networkconnectivity.v1alpha1; + +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; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class HubName implements ResourceName { + private static final PathTemplate PROJECT_HUB = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/global/hubs/{hub}"); + private volatile Map fieldValuesMap; + private final String project; + private final String hub; + + @Deprecated + protected HubName() { + project = null; + hub = null; + } + + private HubName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + hub = Preconditions.checkNotNull(builder.getHub()); + } + + public String getProject() { + return project; + } + + public String getHub() { + return hub; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static HubName of(String project, String hub) { + return newBuilder().setProject(project).setHub(hub).build(); + } + + public static String format(String project, String hub) { + return newBuilder().setProject(project).setHub(hub).build().toString(); + } + + public static HubName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_HUB.validatedMatch( + formattedString, "HubName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("hub")); + } + + 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 (HubName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_HUB.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (hub != null) { + fieldMapBuilder.put("hub", hub); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_HUB.instantiate("project", project, "hub", hub); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + HubName that = ((HubName) o); + return Objects.equals(this.project, that.project) && Objects.equals(this.hub, that.hub); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(hub); + return h; + } + + /** Builder for projects/{project}/locations/global/hubs/{hub}. */ + public static class Builder { + private String project; + private String hub; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getHub() { + return hub; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setHub(String hub) { + this.hub = hub; + return this; + } + + private Builder(HubName hubName) { + project = hubName.project; + hub = hubName.hub; + } + + public HubName build() { + return new HubName(this); + } + } +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubOrBuilder.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubOrBuilder.java new file mode 100644 index 00000000..2ff52022 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubOrBuilder.java @@ -0,0 +1,287 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +public interface HubOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1alpha1.Hub) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. The name of a Hub resource.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. The name of a Hub resource.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Time when the Hub was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Time when the Hub was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Time when the Hub was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Time when the Hub was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Time when the Hub was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Time when the Hub was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * User-defined labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + int getLabelsCount(); + /** + * + * + *
+   * User-defined labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * User-defined labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * User-defined labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * User-defined labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Short description of the hub resource.
+   * 
+ * + * string description = 5; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Short description of the hub resource.
+   * 
+ * + * string description = 5; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. A list of the URIs of all attached spokes
+   * 
+ * + * + * repeated string spokes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the spokes. + */ + java.util.List getSpokesList(); + /** + * + * + *
+   * Output only. A list of the URIs of all attached spokes
+   * 
+ * + * + * repeated string spokes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of spokes. + */ + int getSpokesCount(); + /** + * + * + *
+   * Output only. A list of the URIs of all attached spokes
+   * 
+ * + * + * repeated string spokes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The spokes at the given index. + */ + java.lang.String getSpokes(int index); + /** + * + * + *
+   * Output only. A list of the URIs of all attached spokes
+   * 
+ * + * + * repeated string spokes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the spokes at the given index. + */ + com.google.protobuf.ByteString getSpokesBytes(int index); + + /** + * + * + *
+   * Output only. Google-generated UUID for this resource. This is unique across all Hub
+   * resources. If a Hub resource is deleted and another with the same name is
+   * created, it gets a different unique_id.
+   * 
+ * + * string unique_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uniqueId. + */ + java.lang.String getUniqueId(); + /** + * + * + *
+   * Output only. Google-generated UUID for this resource. This is unique across all Hub
+   * resources. If a Hub resource is deleted and another with the same name is
+   * created, it gets a different unique_id.
+   * 
+ * + * string unique_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uniqueId. + */ + com.google.protobuf.ByteString getUniqueIdBytes(); +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubProto.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubProto.java new file mode 100644 index 00000000..61d08998 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubProto.java @@ -0,0 +1,443 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +public final class HubProto { + private HubProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1alpha1_Hub_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1alpha1_Hub_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1alpha1_Hub_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1alpha1_Hub_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1alpha1_Spoke_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1alpha1_Spoke_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1alpha1_Spoke_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1alpha1_Spoke_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1alpha1_ListHubsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1alpha1_ListHubsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1alpha1_ListHubsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1alpha1_ListHubsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1alpha1_GetHubRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1alpha1_GetHubRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1alpha1_CreateHubRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1alpha1_CreateHubRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1alpha1_UpdateHubRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1alpha1_UpdateHubRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1alpha1_DeleteHubRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1alpha1_DeleteHubRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1alpha1_ListSpokesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1alpha1_ListSpokesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1alpha1_ListSpokesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1alpha1_ListSpokesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1alpha1_GetSpokeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1alpha1_GetSpokeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1alpha1_CreateSpokeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1alpha1_CreateSpokeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1alpha1_UpdateSpokeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1alpha1_UpdateSpokeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1alpha1_DeleteSpokeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1alpha1_DeleteSpokeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1alpha1_RouterApplianceInstance_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1alpha1_RouterApplianceInstance_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n3google/cloud/networkconnectivity/v1alp" + + "ha1/hub.proto\022)google.cloud.networkconne" + + "ctivity.v1alpha1\032\034google/api/annotations" + + ".proto\032\027google/api/client.proto\032\037google/" + + "api/field_behavior.proto\032\031google/api/res" + + "ource.proto\032#google/longrunning/operatio" + + "ns.proto\032 google/protobuf/field_mask.pro" + + "to\032\037google/protobuf/timestamp.proto\"\301\003\n\003" + + "Hub\022\021\n\004name\030\001 \001(\tB\003\340A\005\022/\n\013create_time\030\002 " + + "\001(\0132\032.google.protobuf.Timestamp\022/\n\013updat" + + "e_time\030\003 \001(\0132\032.google.protobuf.Timestamp" + + "\022J\n\006labels\030\004 \003(\0132:.google.cloud.networkc" + + "onnectivity.v1alpha1.Hub.LabelsEntry\022\023\n\013" + + "description\030\005 \001(\t\022@\n\006spokes\030\006 \003(\tB0\340A\003\372A" + + "*\n(networkconnectivity.googleapis.com/Sp" + + "oke\022\026\n\tunique_id\030\010 \001(\tB\003\340A\003\032-\n\013LabelsEnt" + + "ry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:[\352AX\n" + + "&networkconnectivity.googleapis.com/Hub\022" + + ".projects/{project}/locations/global/hub" + + "s/{hub}\"\326\005\n\005Spoke\022\021\n\004name\030\001 \001(\tB\003\340A\005\022/\n\013" + + "create_time\030\002 \001(\0132\032.google.protobuf.Time" + + "stamp\022/\n\013update_time\030\003 \001(\0132\032.google.prot" + + "obuf.Timestamp\022L\n\006labels\030\004 \003(\0132<.google." + + "cloud.networkconnectivity.v1alpha1.Spoke" + + ".LabelsEntry\022\023\n\013description\030\005 \001(\t\0228\n\003hub" + + "\030\006 \001(\tB+\372A(\n&networkconnectivity.googlea" + + "pis.com/Hub\022A\n\022linked_vpn_tunnels\030\014 \003(\tB" + + "%\372A\"\n compute.googleapis.com/VpnTunnel\022[" + + "\n\037linked_interconnect_attachments\030\r \003(\tB" + + "2\372A/\n-compute.googleapis.com/Interconnec" + + "tAttachment\022m\n!linked_router_appliance_i" + + "nstances\030\016 \003(\0132B.google.cloud.networkcon" + + "nectivity.v1alpha1.RouterApplianceInstan" + + "ce\022\026\n\tunique_id\030\013 \001(\tB\003\340A\003\032-\n\013LabelsEntr" + + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:e\352Ab\n(" + + "networkconnectivity.googleapis.com/Spoke" + + "\0226projects/{project}/locations/{location" + + "}/spokes/{spoke}\"\225\001\n\017ListHubsRequest\0229\n\006" + + "parent\030\001 \001(\tB)\340A\002\372A#\n!locations.googleap" + + "is.com/Location\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npa" + + "ge_token\030\003 \001(\t\022\016\n\006filter\030\004 \001(\t\022\020\n\010order_" + + "by\030\005 \001(\t\"~\n\020ListHubsResponse\022<\n\004hubs\030\001 \003" + + "(\0132..google.cloud.networkconnectivity.v1" + + "alpha1.Hub\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013u" + + "nreachable\030\003 \003(\t\"M\n\rGetHubRequest\022<\n\004nam" + + "e\030\001 \001(\tB.\340A\002\372A(\n&networkconnectivity.goo" + + "gleapis.com/Hub\"\275\001\n\020CreateHubRequest\0229\n\006" + + "parent\030\001 \001(\tB)\340A\002\372A#\n!locations.googleap" + + "is.com/Location\022\023\n\006hub_id\030\002 \001(\tB\003\340A\001\022@\n\003" + + "hub\030\003 \001(\0132..google.cloud.networkconnecti" + + "vity.v1alpha1.HubB\003\340A\002\022\027\n\nrequest_id\030\004 \001" + + "(\tB\003\340A\001\"\243\001\n\020UpdateHubRequest\0224\n\013update_m" + + "ask\030\001 \001(\0132\032.google.protobuf.FieldMaskB\003\340" + + "A\001\022@\n\003hub\030\002 \001(\0132..google.cloud.networkco" + + "nnectivity.v1alpha1.HubB\003\340A\002\022\027\n\nrequest_" + + "id\030\003 \001(\tB\003\340A\001\"i\n\020DeleteHubRequest\022<\n\004nam" + + "e\030\001 \001(\tB.\340A\002\372A(\n&networkconnectivity.goo" + + "gleapis.com/Hub\022\027\n\nrequest_id\030\002 \001(\tB\003\340A\001" + + "\"\227\001\n\021ListSpokesRequest\0229\n\006parent\030\001 \001(\tB)" + + "\340A\002\372A#\n!locations.googleapis.com/Locatio" + + "n\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t" + + "\022\016\n\006filter\030\004 \001(\t\022\020\n\010order_by\030\005 \001(\t\"\204\001\n\022L" + + "istSpokesResponse\022@\n\006spokes\030\001 \003(\01320.goog" + + "le.cloud.networkconnectivity.v1alpha1.Sp" + + "oke\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreacha" + + "ble\030\003 \003(\t\"Q\n\017GetSpokeRequest\022>\n\004name\030\001 \001" + + "(\tB0\340A\002\372A*\n(networkconnectivity.googleap" + + "is.com/Spoke\"\305\001\n\022CreateSpokeRequest\0229\n\006p" + + "arent\030\001 \001(\tB)\340A\002\372A#\n!locations.googleapi" + + "s.com/Location\022\025\n\010spoke_id\030\002 \001(\tB\003\340A\001\022D\n" + + "\005spoke\030\003 \001(\01320.google.cloud.networkconne" + + "ctivity.v1alpha1.SpokeB\003\340A\002\022\027\n\nrequest_i" + + "d\030\004 \001(\tB\003\340A\001\"\251\001\n\022UpdateSpokeRequest\0224\n\013u" + + "pdate_mask\030\001 \001(\0132\032.google.protobuf.Field" + + "MaskB\003\340A\001\022D\n\005spoke\030\002 \001(\01320.google.cloud." + + "networkconnectivity.v1alpha1.SpokeB\003\340A\002\022" + + "\027\n\nrequest_id\030\003 \001(\tB\003\340A\001\"m\n\022DeleteSpokeR" + + "equest\022>\n\004name\030\001 \001(\tB0\340A\002\372A*\n(networkcon" + + "nectivity.googleapis.com/Spoke\022\027\n\nreques" + + "t_id\030\002 \001(\tB\003\340A\001\"\213\001\n\027RouterApplianceInsta" + + "nce\022=\n\017virtual_machine\030\001 \001(\tB$\372A!\n\037compu" + + "te.googleapis.com/Instance\022\022\n\nip_address" + + "\030\003 \001(\t\022\035\n\021network_interface\030\002 \001(\tB\002\030\0012\255\021" + + "\n\nHubService\022\311\001\n\010ListHubs\022:.google.cloud" + + ".networkconnectivity.v1alpha1.ListHubsRe" + + "quest\032;.google.cloud.networkconnectivity" + + ".v1alpha1.ListHubsResponse\"D\202\323\344\223\0025\0223/v1a" + + "lpha1/{parent=projects/*/locations/globa" + + "l}/hubs\332A\006parent\022\266\001\n\006GetHub\0228.google.clo" + + "ud.networkconnectivity.v1alpha1.GetHubRe" + + "quest\032..google.cloud.networkconnectivity" + + ".v1alpha1.Hub\"B\202\323\344\223\0025\0223/v1alpha1/{name=p" + + "rojects/*/locations/global/hubs/*}\332A\004nam" + + "e\022\330\001\n\tCreateHub\022;.google.cloud.networkco" + + "nnectivity.v1alpha1.CreateHubRequest\032\035.g" + + "oogle.longrunning.Operation\"o\202\323\344\223\002:\"3/v1" + + "alpha1/{parent=projects/*/locations/glob" + + "al}/hubs:\003hub\332A\021parent,hub,hub_id\312A\030\n\003Hu" + + "b\022\021OperationMetadata\022\332\001\n\tUpdateHub\022;.goo" + + "gle.cloud.networkconnectivity.v1alpha1.U" + + "pdateHubRequest\032\035.google.longrunning.Ope" + + "ration\"q\202\323\344\223\002>27/v1alpha1/{hub.name=proj" + + "ects/*/locations/global/hubs/*}:\003hub\332A\017h" + + "ub,update_mask\312A\030\n\003Hub\022\021OperationMetadat" + + "a\022\330\001\n\tDeleteHub\022;.google.cloud.networkco" + + "nnectivity.v1alpha1.DeleteHubRequest\032\035.g" + + "oogle.longrunning.Operation\"o\202\323\344\223\0025*3/v1" + + "alpha1/{name=projects/*/locations/global" + + "/hubs/*}\332A\004name\312A*\n\025google.protobuf.Empt" + + "y\022\021OperationMetadata\022\314\001\n\nListSpokes\022<.go" + + "ogle.cloud.networkconnectivity.v1alpha1." + + "ListSpokesRequest\032=.google.cloud.network" + + "connectivity.v1alpha1.ListSpokesResponse" + + "\"A\202\323\344\223\0022\0220/v1alpha1/{parent=projects/*/l" + + "ocations/*}/spokes\332A\006parent\022\271\001\n\010GetSpoke" + + "\022:.google.cloud.networkconnectivity.v1al" + + "pha1.GetSpokeRequest\0320.google.cloud.netw" + + "orkconnectivity.v1alpha1.Spoke\"?\202\323\344\223\0022\0220" + + "/v1alpha1/{name=projects/*/locations/*/s" + + "pokes/*}\332A\004name\022\341\001\n\013CreateSpoke\022=.google" + + ".cloud.networkconnectivity.v1alpha1.Crea" + + "teSpokeRequest\032\035.google.longrunning.Oper" + + "ation\"t\202\323\344\223\0029\"0/v1alpha1/{parent=project" + + "s/*/locations/*}/spokes:\005spoke\332A\025parent," + + "spoke,spoke_id\312A\032\n\005Spoke\022\021OperationMetad" + + "ata\022\343\001\n\013UpdateSpoke\022=.google.cloud.netwo" + + "rkconnectivity.v1alpha1.UpdateSpokeReque" + + "st\032\035.google.longrunning.Operation\"v\202\323\344\223\002" + + "?26/v1alpha1/{spoke.name=projects/*/loca" + + "tions/*/spokes/*}:\005spoke\332A\021spoke,update_" + + "mask\312A\032\n\005Spoke\022\021OperationMetadata\022\331\001\n\013De" + + "leteSpoke\022=.google.cloud.networkconnecti" + + "vity.v1alpha1.DeleteSpokeRequest\032\035.googl" + + "e.longrunning.Operation\"l\202\323\344\223\0022*0/v1alph" + + "a1/{name=projects/*/locations/*/spokes/*" + + "}\332A\004name\312A*\n\025google.protobuf.Empty\022\021Oper" + + "ationMetadata\032V\312A\"networkconnectivity.go" + + "ogleapis.com\322A.https://www.googleapis.co" + + "m/auth/cloud-platformB\323\003\n-com.google.clo" + + "ud.networkconnectivity.v1alpha1B\010HubProt" + + "oP\001Z\\google.golang.org/genproto/googleap" + + "is/cloud/networkconnectivity/v1alpha1;ne" + + "tworkconnectivity\352A`\n compute.googleapis" + + ".com/VpnTunnel\022 fieldValuesMap; + private final String project; + private final String zone; + private final String instance; + + @Deprecated + protected InstanceName() { + project = null; + zone = null; + instance = null; + } + + private InstanceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + zone = Preconditions.checkNotNull(builder.getZone()); + instance = Preconditions.checkNotNull(builder.getInstance()); + } + + public String getProject() { + return project; + } + + public String getZone() { + return zone; + } + + public String getInstance() { + return instance; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static InstanceName of(String project, String zone, String instance) { + return newBuilder().setProject(project).setZone(zone).setInstance(instance).build(); + } + + public static String format(String project, String zone, String instance) { + return newBuilder().setProject(project).setZone(zone).setInstance(instance).build().toString(); + } + + public static InstanceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_ZONE_INSTANCE.validatedMatch( + formattedString, "InstanceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("zone"), matchMap.get("instance")); + } + + 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 (InstanceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_ZONE_INSTANCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (zone != null) { + fieldMapBuilder.put("zone", zone); + } + if (instance != null) { + fieldMapBuilder.put("instance", instance); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_ZONE_INSTANCE.instantiate( + "project", project, "zone", zone, "instance", instance); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + InstanceName that = ((InstanceName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.zone, that.zone) + && Objects.equals(this.instance, that.instance); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(zone); + h *= 1000003; + h ^= Objects.hashCode(instance); + return h; + } + + /** Builder for projects/{project}/zones/{zone}/instances/{instance}. */ + public static class Builder { + private String project; + private String zone; + private String instance; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getZone() { + return zone; + } + + public String getInstance() { + return instance; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + private Builder(InstanceName instanceName) { + project = instanceName.project; + zone = instanceName.zone; + instance = instanceName.instance; + } + + public InstanceName build() { + return new InstanceName(this); + } + } +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/InterconnectAttachmentName.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/InterconnectAttachmentName.java new file mode 100644 index 00000000..37abea69 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/InterconnectAttachmentName.java @@ -0,0 +1,224 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.networkconnectivity.v1alpha1; + +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; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class InterconnectAttachmentName implements ResourceName { + private static final PathTemplate PROJECT_REGION_RESOURCE_ID = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/regions/{region}/interconnectAttachments/{resource_id}"); + private volatile Map fieldValuesMap; + private final String project; + private final String region; + private final String resourceId; + + @Deprecated + protected InterconnectAttachmentName() { + project = null; + region = null; + resourceId = null; + } + + private InterconnectAttachmentName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + region = Preconditions.checkNotNull(builder.getRegion()); + resourceId = Preconditions.checkNotNull(builder.getResourceId()); + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + public String getResourceId() { + return resourceId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static InterconnectAttachmentName of(String project, String region, String resourceId) { + return newBuilder().setProject(project).setRegion(region).setResourceId(resourceId).build(); + } + + public static String format(String project, String region, String resourceId) { + return newBuilder() + .setProject(project) + .setRegion(region) + .setResourceId(resourceId) + .build() + .toString(); + } + + public static InterconnectAttachmentName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_REGION_RESOURCE_ID.validatedMatch( + formattedString, + "InterconnectAttachmentName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("region"), matchMap.get("resource_id")); + } + + 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 (InterconnectAttachmentName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_REGION_RESOURCE_ID.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (region != null) { + fieldMapBuilder.put("region", region); + } + if (resourceId != null) { + fieldMapBuilder.put("resource_id", resourceId); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_REGION_RESOURCE_ID.instantiate( + "project", project, "region", region, "resource_id", resourceId); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + InterconnectAttachmentName that = ((InterconnectAttachmentName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.region, that.region) + && Objects.equals(this.resourceId, that.resourceId); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(region); + h *= 1000003; + h ^= Objects.hashCode(resourceId); + return h; + } + + /** Builder for projects/{project}/regions/{region}/interconnectAttachments/{resource_id}. */ + public static class Builder { + private String project; + private String region; + private String resourceId; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + public String getResourceId() { + return resourceId; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public Builder setResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + private Builder(InterconnectAttachmentName interconnectAttachmentName) { + project = interconnectAttachmentName.project; + region = interconnectAttachmentName.region; + resourceId = interconnectAttachmentName.resourceId; + } + + public InterconnectAttachmentName build() { + return new InterconnectAttachmentName(this); + } + } +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListHubsRequest.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListHubsRequest.java new file mode 100644 index 00000000..a51d1374 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListHubsRequest.java @@ -0,0 +1,1282 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +/** + * + * + *
+ * Request for [HubService.ListHubs][google.cloud.networkconnectivity.v1alpha1.HubService.ListHubs] method.
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.ListHubsRequest} + */ +public final class ListHubsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1alpha1.ListHubsRequest) + ListHubsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListHubsRequest.newBuilder() to construct. + private ListHubsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListHubsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListHubsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListHubsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = 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.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_ListHubsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_ListHubsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest.class, + com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource's name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource's name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of results per page that should be returned.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * A filter expression that filters the results listed in the response.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * A filter expression that filters the results listed in the response.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * Sort the results by a certain order.
+   * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Sort the results by a certain order.
+   * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + 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.networkconnectivity.v1alpha1.ListHubsRequest)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest other = + (com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest 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.networkconnectivity.v1alpha1.ListHubsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest 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.networkconnectivity.v1alpha1.ListHubsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest 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.networkconnectivity.v1alpha1.ListHubsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest 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.networkconnectivity.v1alpha1.ListHubsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest 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.networkconnectivity.v1alpha1.ListHubsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for [HubService.ListHubs][google.cloud.networkconnectivity.v1alpha1.HubService.ListHubs] method.
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.ListHubsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1alpha1.ListHubsRequest) + com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_ListHubsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_ListHubsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest.class, + com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_ListHubsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest + getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest build() { + com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest buildPartial() { + com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest result = + new com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + 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.networkconnectivity.v1alpha1.ListHubsRequest) { + return mergeFrom((com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest other) { + if (other + == com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + 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.networkconnectivity.v1alpha1.ListHubsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource's name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource's name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource's name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource's name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource's name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of results per page that should be returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of results per page that should be returned.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of results per page that should be returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The 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; + } + } + /** + * + * + *
+     * The 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; + } + } + /** + * + * + *
+     * The 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; + } + /** + * + * + *
+     * The page token.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The 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; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * A filter expression that filters the results listed in the response.
+     * 
+ * + * string filter = 4; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A filter expression that filters the results listed in the response.
+     * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A filter expression that filters the results listed in the response.
+     * 
+ * + * string filter = 4; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A filter expression that filters the results listed in the response.
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * A filter expression that filters the results listed in the response.
+     * 
+ * + * string filter = 4; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Sort the results by a certain order.
+     * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Sort the results by a certain order.
+     * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Sort the results by a certain order.
+     * 
+ * + * string order_by = 5; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Sort the results by a certain order.
+     * 
+ * + * string order_by = 5; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Sort the results by a certain order.
+     * 
+ * + * string order_by = 5; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = 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.networkconnectivity.v1alpha1.ListHubsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1alpha1.ListHubsRequest) + private static final com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest(); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListHubsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListHubsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListHubsRequest(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.networkconnectivity.v1alpha1.ListHubsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListHubsRequestOrBuilder.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListHubsRequestOrBuilder.java new file mode 100644 index 00000000..d04315d2 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListHubsRequestOrBuilder.java @@ -0,0 +1,142 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +public interface ListHubsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1alpha1.ListHubsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource's name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource's name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of results per page that should be returned.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * A filter expression that filters the results listed in the response.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * A filter expression that filters the results listed in the response.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Sort the results by a certain order.
+   * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Sort the results by a certain order.
+   * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListHubsResponse.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListHubsResponse.java new file mode 100644 index 00000000..ca61da16 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListHubsResponse.java @@ -0,0 +1,1422 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +/** + * + * + *
+ * Response for [HubService.ListHubs][google.cloud.networkconnectivity.v1alpha1.HubService.ListHubs] method.
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.ListHubsResponse} + */ +public final class ListHubsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1alpha1.ListHubsResponse) + ListHubsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListHubsResponse.newBuilder() to construct. + private ListHubsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListHubsResponse() { + hubs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListHubsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListHubsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + hubs_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + hubs_.add( + input.readMessage( + com.google.cloud.networkconnectivity.v1alpha1.Hub.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + unreachable_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + hubs_ = java.util.Collections.unmodifiableList(hubs_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_ListHubsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_ListHubsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse.class, + com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse.Builder.class); + } + + public static final int HUBS_FIELD_NUMBER = 1; + private java.util.List hubs_; + /** + * + * + *
+   * Hubs to be returned.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + @java.lang.Override + public java.util.List getHubsList() { + return hubs_; + } + /** + * + * + *
+   * Hubs to be returned.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + @java.lang.Override + public java.util.List + getHubsOrBuilderList() { + return hubs_; + } + /** + * + * + *
+   * Hubs to be returned.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + @java.lang.Override + public int getHubsCount() { + return hubs_.size(); + } + /** + * + * + *
+   * Hubs to be returned.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.Hub getHubs(int index) { + return hubs_.get(index); + } + /** + * + * + *
+   * Hubs to be returned.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.HubOrBuilder getHubsOrBuilder(int index) { + return hubs_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * The next pagination token in the List response. It should be used as
+   * page_token for the following request. An empty value means no more result.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The next pagination token in the List response. It should be used as
+   * page_token for the following request. An empty value means no more result.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < hubs_.size(); i++) { + output.writeMessage(1, hubs_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < hubs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, hubs_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse other = + (com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse) obj; + + if (!getHubsList().equals(other.getHubsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getHubsCount() > 0) { + hash = (37 * hash) + HUBS_FIELD_NUMBER; + hash = (53 * hash) + getHubsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse 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.networkconnectivity.v1alpha1.ListHubsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse 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.networkconnectivity.v1alpha1.ListHubsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse 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.networkconnectivity.v1alpha1.ListHubsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse 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.networkconnectivity.v1alpha1.ListHubsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse 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.networkconnectivity.v1alpha1.ListHubsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response for [HubService.ListHubs][google.cloud.networkconnectivity.v1alpha1.HubService.ListHubs] method.
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.ListHubsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1alpha1.ListHubsResponse) + com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_ListHubsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_ListHubsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse.class, + com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getHubsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (hubsBuilder_ == null) { + hubs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + hubsBuilder_.clear(); + } + nextPageToken_ = ""; + + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_ListHubsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse + getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse build() { + com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse buildPartial() { + com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse result = + new com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse(this); + int from_bitField0_ = bitField0_; + if (hubsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + hubs_ = java.util.Collections.unmodifiableList(hubs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.hubs_ = hubs_; + } else { + result.hubs_ = hubsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + if (((bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.unreachable_ = unreachable_; + 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.networkconnectivity.v1alpha1.ListHubsResponse) { + return mergeFrom((com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse other) { + if (other + == com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse.getDefaultInstance()) + return this; + if (hubsBuilder_ == null) { + if (!other.hubs_.isEmpty()) { + if (hubs_.isEmpty()) { + hubs_ = other.hubs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureHubsIsMutable(); + hubs_.addAll(other.hubs_); + } + onChanged(); + } + } else { + if (!other.hubs_.isEmpty()) { + if (hubsBuilder_.isEmpty()) { + hubsBuilder_.dispose(); + hubsBuilder_ = null; + hubs_ = other.hubs_; + bitField0_ = (bitField0_ & ~0x00000001); + hubsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getHubsFieldBuilder() + : null; + } else { + hubsBuilder_.addAllMessages(other.hubs_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + 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.networkconnectivity.v1alpha1.ListHubsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List hubs_ = + java.util.Collections.emptyList(); + + private void ensureHubsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + hubs_ = new java.util.ArrayList(hubs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networkconnectivity.v1alpha1.Hub, + com.google.cloud.networkconnectivity.v1alpha1.Hub.Builder, + com.google.cloud.networkconnectivity.v1alpha1.HubOrBuilder> + hubsBuilder_; + + /** + * + * + *
+     * Hubs to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + public java.util.List getHubsList() { + if (hubsBuilder_ == null) { + return java.util.Collections.unmodifiableList(hubs_); + } else { + return hubsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Hubs to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + public int getHubsCount() { + if (hubsBuilder_ == null) { + return hubs_.size(); + } else { + return hubsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Hubs to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + public com.google.cloud.networkconnectivity.v1alpha1.Hub getHubs(int index) { + if (hubsBuilder_ == null) { + return hubs_.get(index); + } else { + return hubsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Hubs to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + public Builder setHubs(int index, com.google.cloud.networkconnectivity.v1alpha1.Hub value) { + if (hubsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHubsIsMutable(); + hubs_.set(index, value); + onChanged(); + } else { + hubsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Hubs to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + public Builder setHubs( + int index, com.google.cloud.networkconnectivity.v1alpha1.Hub.Builder builderForValue) { + if (hubsBuilder_ == null) { + ensureHubsIsMutable(); + hubs_.set(index, builderForValue.build()); + onChanged(); + } else { + hubsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Hubs to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + public Builder addHubs(com.google.cloud.networkconnectivity.v1alpha1.Hub value) { + if (hubsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHubsIsMutable(); + hubs_.add(value); + onChanged(); + } else { + hubsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Hubs to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + public Builder addHubs(int index, com.google.cloud.networkconnectivity.v1alpha1.Hub value) { + if (hubsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHubsIsMutable(); + hubs_.add(index, value); + onChanged(); + } else { + hubsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Hubs to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + public Builder addHubs( + com.google.cloud.networkconnectivity.v1alpha1.Hub.Builder builderForValue) { + if (hubsBuilder_ == null) { + ensureHubsIsMutable(); + hubs_.add(builderForValue.build()); + onChanged(); + } else { + hubsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Hubs to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + public Builder addHubs( + int index, com.google.cloud.networkconnectivity.v1alpha1.Hub.Builder builderForValue) { + if (hubsBuilder_ == null) { + ensureHubsIsMutable(); + hubs_.add(index, builderForValue.build()); + onChanged(); + } else { + hubsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Hubs to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + public Builder addAllHubs( + java.lang.Iterable values) { + if (hubsBuilder_ == null) { + ensureHubsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, hubs_); + onChanged(); + } else { + hubsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Hubs to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + public Builder clearHubs() { + if (hubsBuilder_ == null) { + hubs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + hubsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Hubs to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + public Builder removeHubs(int index) { + if (hubsBuilder_ == null) { + ensureHubsIsMutable(); + hubs_.remove(index); + onChanged(); + } else { + hubsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Hubs to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + public com.google.cloud.networkconnectivity.v1alpha1.Hub.Builder getHubsBuilder(int index) { + return getHubsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Hubs to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + public com.google.cloud.networkconnectivity.v1alpha1.HubOrBuilder getHubsOrBuilder(int index) { + if (hubsBuilder_ == null) { + return hubs_.get(index); + } else { + return hubsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Hubs to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + public java.util.List + getHubsOrBuilderList() { + if (hubsBuilder_ != null) { + return hubsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(hubs_); + } + } + /** + * + * + *
+     * Hubs to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + public com.google.cloud.networkconnectivity.v1alpha1.Hub.Builder addHubsBuilder() { + return getHubsFieldBuilder() + .addBuilder(com.google.cloud.networkconnectivity.v1alpha1.Hub.getDefaultInstance()); + } + /** + * + * + *
+     * Hubs to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + public com.google.cloud.networkconnectivity.v1alpha1.Hub.Builder addHubsBuilder(int index) { + return getHubsFieldBuilder() + .addBuilder( + index, com.google.cloud.networkconnectivity.v1alpha1.Hub.getDefaultInstance()); + } + /** + * + * + *
+     * Hubs to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + public java.util.List + getHubsBuilderList() { + return getHubsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networkconnectivity.v1alpha1.Hub, + com.google.cloud.networkconnectivity.v1alpha1.Hub.Builder, + com.google.cloud.networkconnectivity.v1alpha1.HubOrBuilder> + getHubsFieldBuilder() { + if (hubsBuilder_ == null) { + hubsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networkconnectivity.v1alpha1.Hub, + com.google.cloud.networkconnectivity.v1alpha1.Hub.Builder, + com.google.cloud.networkconnectivity.v1alpha1.HubOrBuilder>( + hubs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + hubs_ = null; + } + return hubsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * The next pagination token in the List response. It should be used as
+     * page_token for the following request. An empty value means no more result.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The next pagination token in the List response. It should be used as
+     * page_token for the following request. An empty value means no more result.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The next pagination token in the List response. It should be used as
+     * page_token for the following request. An empty value means no more result.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The next pagination token in the List response. It should be used as
+     * page_token for the following request. An empty value means no more result.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next pagination token in the List response. It should be used as
+     * page_token for the following request. An empty value means no more result.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.networkconnectivity.v1alpha1.ListHubsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1alpha1.ListHubsResponse) + private static final com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse(); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListHubsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListHubsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListHubsResponse(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.networkconnectivity.v1alpha1.ListHubsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListHubsResponseOrBuilder.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListHubsResponseOrBuilder.java new file mode 100644 index 00000000..0e7c350a --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListHubsResponseOrBuilder.java @@ -0,0 +1,155 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +public interface ListHubsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1alpha1.ListHubsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Hubs to be returned.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + java.util.List getHubsList(); + /** + * + * + *
+   * Hubs to be returned.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + com.google.cloud.networkconnectivity.v1alpha1.Hub getHubs(int index); + /** + * + * + *
+   * Hubs to be returned.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + int getHubsCount(); + /** + * + * + *
+   * Hubs to be returned.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + java.util.List + getHubsOrBuilderList(); + /** + * + * + *
+   * Hubs to be returned.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Hub hubs = 1; + */ + com.google.cloud.networkconnectivity.v1alpha1.HubOrBuilder getHubsOrBuilder(int index); + + /** + * + * + *
+   * The next pagination token in the List response. It should be used as
+   * page_token for the following request. An empty value means no more result.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * The next pagination token in the List response. It should be used as
+   * page_token for the following request. An empty value means no more result.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListSpokesRequest.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListSpokesRequest.java new file mode 100644 index 00000000..bcffcc59 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListSpokesRequest.java @@ -0,0 +1,1285 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +/** + * + * + *
+ * The request for [HubService.ListSpokes][google.cloud.networkconnectivity.v1alpha1.HubService.ListSpokes].
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest} + */ +public final class ListSpokesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest) + ListSpokesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSpokesRequest.newBuilder() to construct. + private ListSpokesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSpokesRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSpokesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListSpokesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = 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.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_ListSpokesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_ListSpokesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest.class, + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent's resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent's resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of results per page that should be returned.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * A filter expression that filters the results listed in the response.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * A filter expression that filters the results listed in the response.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * Sort the results by a certain order.
+   * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Sort the results by a certain order.
+   * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + 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.networkconnectivity.v1alpha1.ListSpokesRequest)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest other = + (com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest 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.networkconnectivity.v1alpha1.ListSpokesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest 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.networkconnectivity.v1alpha1.ListSpokesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest 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.networkconnectivity.v1alpha1.ListSpokesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest 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.networkconnectivity.v1alpha1.ListSpokesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest 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.networkconnectivity.v1alpha1.ListSpokesRequest 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 [HubService.ListSpokes][google.cloud.networkconnectivity.v1alpha1.HubService.ListSpokes].
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest) + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_ListSpokesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_ListSpokesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest.class, + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_ListSpokesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest + getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest build() { + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest buildPartial() { + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest result = + new com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + 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.networkconnectivity.v1alpha1.ListSpokesRequest) { + return mergeFrom((com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest other) { + if (other + == com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + 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.networkconnectivity.v1alpha1.ListSpokesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent's resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent's resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent's resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent's resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent's resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of results per page that should be returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of results per page that should be returned.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of results per page that should be returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The 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; + } + } + /** + * + * + *
+     * The 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; + } + } + /** + * + * + *
+     * The 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; + } + /** + * + * + *
+     * The page token.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The 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; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * A filter expression that filters the results listed in the response.
+     * 
+ * + * string filter = 4; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A filter expression that filters the results listed in the response.
+     * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A filter expression that filters the results listed in the response.
+     * 
+ * + * string filter = 4; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A filter expression that filters the results listed in the response.
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * A filter expression that filters the results listed in the response.
+     * 
+ * + * string filter = 4; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Sort the results by a certain order.
+     * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Sort the results by a certain order.
+     * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Sort the results by a certain order.
+     * 
+ * + * string order_by = 5; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Sort the results by a certain order.
+     * 
+ * + * string order_by = 5; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Sort the results by a certain order.
+     * 
+ * + * string order_by = 5; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = 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.networkconnectivity.v1alpha1.ListSpokesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest) + private static final com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest(); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSpokesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListSpokesRequest(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.networkconnectivity.v1alpha1.ListSpokesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListSpokesRequestOrBuilder.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListSpokesRequestOrBuilder.java new file mode 100644 index 00000000..444a3f40 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListSpokesRequestOrBuilder.java @@ -0,0 +1,142 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +public interface ListSpokesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1alpha1.ListSpokesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent's resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent's resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of results per page that should be returned.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * A filter expression that filters the results listed in the response.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * A filter expression that filters the results listed in the response.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Sort the results by a certain order.
+   * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Sort the results by a certain order.
+   * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListSpokesResponse.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListSpokesResponse.java new file mode 100644 index 00000000..0484fda4 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListSpokesResponse.java @@ -0,0 +1,1426 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +/** + * + * + *
+ * The response for [HubService.ListSpokes][google.cloud.networkconnectivity.v1alpha1.HubService.ListSpokes].
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse} + */ +public final class ListSpokesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse) + ListSpokesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSpokesResponse.newBuilder() to construct. + private ListSpokesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSpokesResponse() { + spokes_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSpokesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListSpokesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + spokes_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + spokes_.add( + input.readMessage( + com.google.cloud.networkconnectivity.v1alpha1.Spoke.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + unreachable_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + spokes_ = java.util.Collections.unmodifiableList(spokes_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_ListSpokesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_ListSpokesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse.class, + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse.Builder.class); + } + + public static final int SPOKES_FIELD_NUMBER = 1; + private java.util.List spokes_; + /** + * + * + *
+   * Spokes to be returned.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + @java.lang.Override + public java.util.List getSpokesList() { + return spokes_; + } + /** + * + * + *
+   * Spokes to be returned.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + @java.lang.Override + public java.util.List + getSpokesOrBuilderList() { + return spokes_; + } + /** + * + * + *
+   * Spokes to be returned.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + @java.lang.Override + public int getSpokesCount() { + return spokes_.size(); + } + /** + * + * + *
+   * Spokes to be returned.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.Spoke getSpokes(int index) { + return spokes_.get(index); + } + /** + * + * + *
+   * Spokes to be returned.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder getSpokesOrBuilder( + int index) { + return spokes_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * The next pagination token in the List response. It should be used as
+   * page_token for the following request. An empty value means no more result.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The next pagination token in the List response. It should be used as
+   * page_token for the following request. An empty value means no more result.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < spokes_.size(); i++) { + output.writeMessage(1, spokes_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < spokes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, spokes_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse other = + (com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse) obj; + + if (!getSpokesList().equals(other.getSpokesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSpokesCount() > 0) { + hash = (37 * hash) + SPOKES_FIELD_NUMBER; + hash = (53 * hash) + getSpokesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse 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.networkconnectivity.v1alpha1.ListSpokesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse 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.networkconnectivity.v1alpha1.ListSpokesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse 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.networkconnectivity.v1alpha1.ListSpokesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse 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.networkconnectivity.v1alpha1.ListSpokesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse 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.networkconnectivity.v1alpha1.ListSpokesResponse 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 [HubService.ListSpokes][google.cloud.networkconnectivity.v1alpha1.HubService.ListSpokes].
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse) + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_ListSpokesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_ListSpokesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse.class, + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSpokesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (spokesBuilder_ == null) { + spokes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + spokesBuilder_.clear(); + } + nextPageToken_ = ""; + + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_ListSpokesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse + getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse build() { + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse buildPartial() { + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse result = + new com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse(this); + int from_bitField0_ = bitField0_; + if (spokesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + spokes_ = java.util.Collections.unmodifiableList(spokes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.spokes_ = spokes_; + } else { + result.spokes_ = spokesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + if (((bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.unreachable_ = unreachable_; + 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.networkconnectivity.v1alpha1.ListSpokesResponse) { + return mergeFrom((com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse other) { + if (other + == com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse.getDefaultInstance()) + return this; + if (spokesBuilder_ == null) { + if (!other.spokes_.isEmpty()) { + if (spokes_.isEmpty()) { + spokes_ = other.spokes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSpokesIsMutable(); + spokes_.addAll(other.spokes_); + } + onChanged(); + } + } else { + if (!other.spokes_.isEmpty()) { + if (spokesBuilder_.isEmpty()) { + spokesBuilder_.dispose(); + spokesBuilder_ = null; + spokes_ = other.spokes_; + bitField0_ = (bitField0_ & ~0x00000001); + spokesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSpokesFieldBuilder() + : null; + } else { + spokesBuilder_.addAllMessages(other.spokes_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + 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.networkconnectivity.v1alpha1.ListSpokesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List spokes_ = + java.util.Collections.emptyList(); + + private void ensureSpokesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + spokes_ = + new java.util.ArrayList(spokes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networkconnectivity.v1alpha1.Spoke, + com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder, + com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder> + spokesBuilder_; + + /** + * + * + *
+     * Spokes to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + public java.util.List getSpokesList() { + if (spokesBuilder_ == null) { + return java.util.Collections.unmodifiableList(spokes_); + } else { + return spokesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Spokes to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + public int getSpokesCount() { + if (spokesBuilder_ == null) { + return spokes_.size(); + } else { + return spokesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Spokes to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + public com.google.cloud.networkconnectivity.v1alpha1.Spoke getSpokes(int index) { + if (spokesBuilder_ == null) { + return spokes_.get(index); + } else { + return spokesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Spokes to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + public Builder setSpokes(int index, com.google.cloud.networkconnectivity.v1alpha1.Spoke value) { + if (spokesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpokesIsMutable(); + spokes_.set(index, value); + onChanged(); + } else { + spokesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Spokes to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + public Builder setSpokes( + int index, com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder builderForValue) { + if (spokesBuilder_ == null) { + ensureSpokesIsMutable(); + spokes_.set(index, builderForValue.build()); + onChanged(); + } else { + spokesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Spokes to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + public Builder addSpokes(com.google.cloud.networkconnectivity.v1alpha1.Spoke value) { + if (spokesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpokesIsMutable(); + spokes_.add(value); + onChanged(); + } else { + spokesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Spokes to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + public Builder addSpokes(int index, com.google.cloud.networkconnectivity.v1alpha1.Spoke value) { + if (spokesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpokesIsMutable(); + spokes_.add(index, value); + onChanged(); + } else { + spokesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Spokes to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + public Builder addSpokes( + com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder builderForValue) { + if (spokesBuilder_ == null) { + ensureSpokesIsMutable(); + spokes_.add(builderForValue.build()); + onChanged(); + } else { + spokesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Spokes to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + public Builder addSpokes( + int index, com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder builderForValue) { + if (spokesBuilder_ == null) { + ensureSpokesIsMutable(); + spokes_.add(index, builderForValue.build()); + onChanged(); + } else { + spokesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Spokes to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + public Builder addAllSpokes( + java.lang.Iterable values) { + if (spokesBuilder_ == null) { + ensureSpokesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, spokes_); + onChanged(); + } else { + spokesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Spokes to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + public Builder clearSpokes() { + if (spokesBuilder_ == null) { + spokes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + spokesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Spokes to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + public Builder removeSpokes(int index) { + if (spokesBuilder_ == null) { + ensureSpokesIsMutable(); + spokes_.remove(index); + onChanged(); + } else { + spokesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Spokes to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + public com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder getSpokesBuilder(int index) { + return getSpokesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Spokes to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + public com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder getSpokesOrBuilder( + int index) { + if (spokesBuilder_ == null) { + return spokes_.get(index); + } else { + return spokesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Spokes to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + public java.util.List + getSpokesOrBuilderList() { + if (spokesBuilder_ != null) { + return spokesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(spokes_); + } + } + /** + * + * + *
+     * Spokes to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + public com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder addSpokesBuilder() { + return getSpokesFieldBuilder() + .addBuilder(com.google.cloud.networkconnectivity.v1alpha1.Spoke.getDefaultInstance()); + } + /** + * + * + *
+     * Spokes to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + public com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder addSpokesBuilder(int index) { + return getSpokesFieldBuilder() + .addBuilder( + index, com.google.cloud.networkconnectivity.v1alpha1.Spoke.getDefaultInstance()); + } + /** + * + * + *
+     * Spokes to be returned.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + public java.util.List + getSpokesBuilderList() { + return getSpokesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networkconnectivity.v1alpha1.Spoke, + com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder, + com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder> + getSpokesFieldBuilder() { + if (spokesBuilder_ == null) { + spokesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networkconnectivity.v1alpha1.Spoke, + com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder, + com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder>( + spokes_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + spokes_ = null; + } + return spokesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * The next pagination token in the List response. It should be used as
+     * page_token for the following request. An empty value means no more result.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The next pagination token in the List response. It should be used as
+     * page_token for the following request. An empty value means no more result.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The next pagination token in the List response. It should be used as
+     * page_token for the following request. An empty value means no more result.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The next pagination token in the List response. It should be used as
+     * page_token for the following request. An empty value means no more result.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next pagination token in the List response. It should be used as
+     * page_token for the following request. An empty value means no more result.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse) + private static final com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse(); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSpokesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListSpokesResponse(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.networkconnectivity.v1alpha1.ListSpokesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListSpokesResponseOrBuilder.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListSpokesResponseOrBuilder.java new file mode 100644 index 00000000..f961b406 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/ListSpokesResponseOrBuilder.java @@ -0,0 +1,155 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +public interface ListSpokesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Spokes to be returned.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + java.util.List getSpokesList(); + /** + * + * + *
+   * Spokes to be returned.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + com.google.cloud.networkconnectivity.v1alpha1.Spoke getSpokes(int index); + /** + * + * + *
+   * Spokes to be returned.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + int getSpokesCount(); + /** + * + * + *
+   * Spokes to be returned.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + java.util.List + getSpokesOrBuilderList(); + /** + * + * + *
+   * Spokes to be returned.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1; + */ + com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder getSpokesOrBuilder(int index); + + /** + * + * + *
+   * The next pagination token in the List response. It should be used as
+   * page_token for the following request. An empty value means no more result.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * The next pagination token in the List response. It should be used as
+   * page_token for the following request. An empty value means no more result.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/LocationName.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/LocationName.java new file mode 100644 index 00000000..af361d15 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.networkconnectivity.v1alpha1; + +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; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + 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 = + PROJECT_LOCATION.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 PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + 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(LocationName locationName) { + project = locationName.project; + location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/OperationMetadata.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/OperationMetadata.java new file mode 100644 index 00000000..573f2898 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/OperationMetadata.java @@ -0,0 +1,1856 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/common.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1alpha1.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OperationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + target_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + verb_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + statusMessage_ = s; + break; + } + case 48: + { + requestedCancellation_ = input.readBool(); + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + apiVersion_ = 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.networkconnectivity.v1alpha1.CommonProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.CommonProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata.class, + com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int TARGET_FIELD_NUMBER = 3; + private volatile java.lang.Object target_; + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + private volatile java.lang.Object verb_; + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_MESSAGE_FIELD_NUMBER = 5; + private volatile java.lang.Object statusMessage_; + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + @java.lang.Override + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUESTED_CANCELLATION_FIELD_NUMBER = 6; + private boolean requestedCancellation_; + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + private volatile java.lang.Object apiVersion_; + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = 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 (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (!getTargetBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!getVerbBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!getStatusMessageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusMessage_); + } + if (requestedCancellation_ != false) { + output.writeBool(6, requestedCancellation_); + } + if (!getApiVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, apiVersion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!getTargetBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!getVerbBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!getStatusMessageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusMessage_); + } + if (requestedCancellation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, requestedCancellation_); + } + if (!getApiVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, apiVersion_); + } + 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.networkconnectivity.v1alpha1.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata other = + (com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusMessage().equals(other.getStatusMessage())) return false; + if (getRequestedCancellation() != other.getRequestedCancellation()) return false; + if (!getApiVersion().equals(other.getApiVersion())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getStatusMessage().hashCode(); + hash = (37 * hash) + REQUESTED_CANCELLATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequestedCancellation()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata 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.networkconnectivity.v1alpha1.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata 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.networkconnectivity.v1alpha1.OperationMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata 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.networkconnectivity.v1alpha1.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata 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.networkconnectivity.v1alpha1.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata 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.networkconnectivity.v1alpha1.OperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the metadata of the long-running operation.
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1alpha1.OperationMetadata) + com.google.cloud.networkconnectivity.v1alpha1.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1alpha1.CommonProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.CommonProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata.class, + com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + target_ = ""; + + verb_ = ""; + + statusMessage_ = ""; + + requestedCancellation_ = false; + + apiVersion_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1alpha1.CommonProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata + getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata build() { + com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata buildPartial() { + com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata result = + new com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata(this); + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.target_ = target_; + result.verb_ = verb_; + result.statusMessage_ = statusMessage_; + result.requestedCancellation_ = requestedCancellation_; + result.apiVersion_ = apiVersion_; + 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.networkconnectivity.v1alpha1.OperationMetadata) { + return mergeFrom((com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata other) { + if (other + == com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + onChanged(); + } + if (!other.getStatusMessage().isEmpty()) { + statusMessage_ = other.statusMessage_; + onChanged(); + } + if (other.getRequestedCancellation() != false) { + setRequestedCancellation(other.getRequestedCancellation()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + 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.networkconnectivity.v1alpha1.OperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + target_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + + target_ = getDefaultInstance().getTarget(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + target_ = value; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + verb_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + + verb_ = getDefaultInstance().getVerb(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + verb_ = value; + onChanged(); + return this; + } + + private java.lang.Object statusMessage_ = ""; + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + statusMessage_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStatusMessage() { + + statusMessage_ = getDefaultInstance().getStatusMessage(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + statusMessage_ = value; + onChanged(); + return this; + } + + private boolean requestedCancellation_; + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The requestedCancellation to set. + * @return This builder for chaining. + */ + public Builder setRequestedCancellation(boolean value) { + + requestedCancellation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRequestedCancellation() { + + requestedCancellation_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + apiVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + + apiVersion_ = getDefaultInstance().getApiVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + apiVersion_ = 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.networkconnectivity.v1alpha1.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1alpha1.OperationMetadata) + private static final com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata(); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.OperationMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OperationMetadata(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.networkconnectivity.v1alpha1.OperationMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/OperationMetadataOrBuilder.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/OperationMetadataOrBuilder.java new file mode 100644 index 00000000..984bdadf --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/OperationMetadataOrBuilder.java @@ -0,0 +1,217 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/common.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1alpha1.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + java.lang.String getVerb(); + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + java.lang.String getStatusMessage(); + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + com.google.protobuf.ByteString getStatusMessageBytes(); + + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + boolean getRequestedCancellation(); + + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/RouterApplianceInstance.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/RouterApplianceInstance.java new file mode 100644 index 00000000..4fdd09df --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/RouterApplianceInstance.java @@ -0,0 +1,973 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +/** + * + * + *
+ * RouterAppliance represents a Router appliance which is specified by a VM URI
+ * and a NIC address.
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance} + */ +public final class RouterApplianceInstance extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance) + RouterApplianceInstanceOrBuilder { + private static final long serialVersionUID = 0L; + // Use RouterApplianceInstance.newBuilder() to construct. + private RouterApplianceInstance(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RouterApplianceInstance() { + virtualMachine_ = ""; + ipAddress_ = ""; + networkInterface_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RouterApplianceInstance(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RouterApplianceInstance( + 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(); + + virtualMachine_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + networkInterface_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + ipAddress_ = 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.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_RouterApplianceInstance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_RouterApplianceInstance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance.class, + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance.Builder.class); + } + + public static final int VIRTUAL_MACHINE_FIELD_NUMBER = 1; + private volatile java.lang.Object virtualMachine_; + /** + * + * + *
+   * The URI of the virtual machine resource
+   * 
+ * + * string virtual_machine = 1 [(.google.api.resource_reference) = { ... } + * + * @return The virtualMachine. + */ + @java.lang.Override + public java.lang.String getVirtualMachine() { + java.lang.Object ref = virtualMachine_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + virtualMachine_ = s; + return s; + } + } + /** + * + * + *
+   * The URI of the virtual machine resource
+   * 
+ * + * string virtual_machine = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for virtualMachine. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVirtualMachineBytes() { + java.lang.Object ref = virtualMachine_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + virtualMachine_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IP_ADDRESS_FIELD_NUMBER = 3; + private volatile java.lang.Object ipAddress_; + /** + * + * + *
+   * The IP address of the network interface to use for peering.
+   * 
+ * + * string ip_address = 3; + * + * @return The ipAddress. + */ + @java.lang.Override + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } + } + /** + * + * + *
+   * The IP address of the network interface to use for peering.
+   * 
+ * + * string ip_address = 3; + * + * @return The bytes for ipAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NETWORK_INTERFACE_FIELD_NUMBER = 2; + private volatile java.lang.Object networkInterface_; + /** + * string network_interface = 2 [deprecated = true]; + * + * @return The networkInterface. + */ + @java.lang.Override + @java.lang.Deprecated + public java.lang.String getNetworkInterface() { + java.lang.Object ref = networkInterface_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + networkInterface_ = s; + return s; + } + } + /** + * string network_interface = 2 [deprecated = true]; + * + * @return The bytes for networkInterface. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.ByteString getNetworkInterfaceBytes() { + java.lang.Object ref = networkInterface_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + networkInterface_ = 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 (!getVirtualMachineBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, virtualMachine_); + } + if (!getNetworkInterfaceBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, networkInterface_); + } + if (!getIpAddressBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, ipAddress_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getVirtualMachineBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, virtualMachine_); + } + if (!getNetworkInterfaceBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, networkInterface_); + } + if (!getIpAddressBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, ipAddress_); + } + 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.networkconnectivity.v1alpha1.RouterApplianceInstance)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance other = + (com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance) obj; + + if (!getVirtualMachine().equals(other.getVirtualMachine())) return false; + if (!getIpAddress().equals(other.getIpAddress())) return false; + if (!getNetworkInterface().equals(other.getNetworkInterface())) 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) + VIRTUAL_MACHINE_FIELD_NUMBER; + hash = (53 * hash) + getVirtualMachine().hashCode(); + hash = (37 * hash) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().hashCode(); + hash = (37 * hash) + NETWORK_INTERFACE_FIELD_NUMBER; + hash = (53 * hash) + getNetworkInterface().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance 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.networkconnectivity.v1alpha1.RouterApplianceInstance parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance 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.networkconnectivity.v1alpha1.RouterApplianceInstance parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance 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.networkconnectivity.v1alpha1.RouterApplianceInstance + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance + 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.networkconnectivity.v1alpha1.RouterApplianceInstance parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance 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.networkconnectivity.v1alpha1.RouterApplianceInstance 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; + } + /** + * + * + *
+   * RouterAppliance represents a Router appliance which is specified by a VM URI
+   * and a NIC address.
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance) + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_RouterApplianceInstance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_RouterApplianceInstance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance.class, + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance.Builder.class); + } + + // Construct using + // com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance.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(); + virtualMachine_ = ""; + + ipAddress_ = ""; + + networkInterface_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_RouterApplianceInstance_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance + getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance build() { + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance buildPartial() { + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance result = + new com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance(this); + result.virtualMachine_ = virtualMachine_; + result.ipAddress_ = ipAddress_; + result.networkInterface_ = networkInterface_; + 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.networkconnectivity.v1alpha1.RouterApplianceInstance) { + return mergeFrom( + (com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance other) { + if (other + == com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance + .getDefaultInstance()) return this; + if (!other.getVirtualMachine().isEmpty()) { + virtualMachine_ = other.virtualMachine_; + onChanged(); + } + if (!other.getIpAddress().isEmpty()) { + ipAddress_ = other.ipAddress_; + onChanged(); + } + if (!other.getNetworkInterface().isEmpty()) { + networkInterface_ = other.networkInterface_; + 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.networkconnectivity.v1alpha1.RouterApplianceInstance parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object virtualMachine_ = ""; + /** + * + * + *
+     * The URI of the virtual machine resource
+     * 
+ * + * string virtual_machine = 1 [(.google.api.resource_reference) = { ... } + * + * @return The virtualMachine. + */ + public java.lang.String getVirtualMachine() { + java.lang.Object ref = virtualMachine_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + virtualMachine_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The URI of the virtual machine resource
+     * 
+ * + * string virtual_machine = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for virtualMachine. + */ + public com.google.protobuf.ByteString getVirtualMachineBytes() { + java.lang.Object ref = virtualMachine_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + virtualMachine_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The URI of the virtual machine resource
+     * 
+ * + * string virtual_machine = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The virtualMachine to set. + * @return This builder for chaining. + */ + public Builder setVirtualMachine(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + virtualMachine_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The URI of the virtual machine resource
+     * 
+ * + * string virtual_machine = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearVirtualMachine() { + + virtualMachine_ = getDefaultInstance().getVirtualMachine(); + onChanged(); + return this; + } + /** + * + * + *
+     * The URI of the virtual machine resource
+     * 
+ * + * string virtual_machine = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for virtualMachine to set. + * @return This builder for chaining. + */ + public Builder setVirtualMachineBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + virtualMachine_ = value; + onChanged(); + return this; + } + + private java.lang.Object ipAddress_ = ""; + /** + * + * + *
+     * The IP address of the network interface to use for peering.
+     * 
+ * + * string ip_address = 3; + * + * @return The ipAddress. + */ + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The IP address of the network interface to use for peering.
+     * 
+ * + * string ip_address = 3; + * + * @return The bytes for ipAddress. + */ + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The IP address of the network interface to use for peering.
+     * 
+ * + * string ip_address = 3; + * + * @param value The ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ipAddress_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The IP address of the network interface to use for peering.
+     * 
+ * + * string ip_address = 3; + * + * @return This builder for chaining. + */ + public Builder clearIpAddress() { + + ipAddress_ = getDefaultInstance().getIpAddress(); + onChanged(); + return this; + } + /** + * + * + *
+     * The IP address of the network interface to use for peering.
+     * 
+ * + * string ip_address = 3; + * + * @param value The bytes for ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ipAddress_ = value; + onChanged(); + return this; + } + + private java.lang.Object networkInterface_ = ""; + /** + * string network_interface = 2 [deprecated = true]; + * + * @return The networkInterface. + */ + @java.lang.Deprecated + public java.lang.String getNetworkInterface() { + java.lang.Object ref = networkInterface_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + networkInterface_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string network_interface = 2 [deprecated = true]; + * + * @return The bytes for networkInterface. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getNetworkInterfaceBytes() { + java.lang.Object ref = networkInterface_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + networkInterface_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string network_interface = 2 [deprecated = true]; + * + * @param value The networkInterface to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setNetworkInterface(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + networkInterface_ = value; + onChanged(); + return this; + } + /** + * string network_interface = 2 [deprecated = true]; + * + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearNetworkInterface() { + + networkInterface_ = getDefaultInstance().getNetworkInterface(); + onChanged(); + return this; + } + /** + * string network_interface = 2 [deprecated = true]; + * + * @param value The bytes for networkInterface to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setNetworkInterfaceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + networkInterface_ = 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.networkconnectivity.v1alpha1.RouterApplianceInstance) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance) + private static final com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance(); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RouterApplianceInstance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RouterApplianceInstance(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.networkconnectivity.v1alpha1.RouterApplianceInstance + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/RouterApplianceInstanceOrBuilder.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/RouterApplianceInstanceOrBuilder.java new file mode 100644 index 00000000..ca23054f --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/RouterApplianceInstanceOrBuilder.java @@ -0,0 +1,90 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +public interface RouterApplianceInstanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The URI of the virtual machine resource
+   * 
+ * + * string virtual_machine = 1 [(.google.api.resource_reference) = { ... } + * + * @return The virtualMachine. + */ + java.lang.String getVirtualMachine(); + /** + * + * + *
+   * The URI of the virtual machine resource
+   * 
+ * + * string virtual_machine = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for virtualMachine. + */ + com.google.protobuf.ByteString getVirtualMachineBytes(); + + /** + * + * + *
+   * The IP address of the network interface to use for peering.
+   * 
+ * + * string ip_address = 3; + * + * @return The ipAddress. + */ + java.lang.String getIpAddress(); + /** + * + * + *
+   * The IP address of the network interface to use for peering.
+   * 
+ * + * string ip_address = 3; + * + * @return The bytes for ipAddress. + */ + com.google.protobuf.ByteString getIpAddressBytes(); + + /** + * string network_interface = 2 [deprecated = true]; + * + * @return The networkInterface. + */ + @java.lang.Deprecated + java.lang.String getNetworkInterface(); + /** + * string network_interface = 2 [deprecated = true]; + * + * @return The bytes for networkInterface. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getNetworkInterfaceBytes(); +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/Spoke.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/Spoke.java new file mode 100644 index 00000000..4731f0e4 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/Spoke.java @@ -0,0 +1,3236 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +/** + * + * + *
+ * A Spoke is an  abstraction of a network attachment being attached
+ * to a Hub. A Spoke can be underlying a VPN tunnel, a
+ * VLAN (interconnect) attachment, a Router appliance, etc.
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.Spoke} + */ +public final class Spoke extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1alpha1.Spoke) + SpokeOrBuilder { + private static final long serialVersionUID = 0L; + // Use Spoke.newBuilder() to construct. + private Spoke(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Spoke() { + name_ = ""; + description_ = ""; + hub_ = ""; + linkedVpnTunnels_ = com.google.protobuf.LazyStringArrayList.EMPTY; + linkedInterconnectAttachments_ = com.google.protobuf.LazyStringArrayList.EMPTY; + linkedRouterApplianceInstances_ = java.util.Collections.emptyList(); + uniqueId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Spoke(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Spoke( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + hub_ = s; + break; + } + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + + uniqueId_ = s; + break; + } + case 98: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + linkedVpnTunnels_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + linkedVpnTunnels_.add(s); + break; + } + case 106: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + linkedInterconnectAttachments_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + linkedInterconnectAttachments_.add(s); + break; + } + case 114: + { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + linkedRouterApplianceInstances_ = + new java.util.ArrayList< + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance>(); + mutable_bitField0_ |= 0x00000008; + } + linkedRouterApplianceInstances_.add( + input.readMessage( + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance + .parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + linkedVpnTunnels_ = linkedVpnTunnels_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + linkedInterconnectAttachments_ = linkedInterconnectAttachments_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000008) != 0)) { + linkedRouterApplianceInstances_ = + java.util.Collections.unmodifiableList(linkedRouterApplianceInstances_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_Spoke_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_Spoke_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.Spoke.class, + com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Immutable. The name of a Spoke resource.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. The name of a Spoke resource.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * The time when the Spoke was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * The time when the Spoke was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * The time when the Spoke was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * The time when the Spoke was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * The time when the Spoke was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * The time when the Spoke was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int LABELS_FIELD_NUMBER = 4; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_Spoke_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * User-defined labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * User-defined labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * User-defined labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * User-defined labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int DESCRIPTION_FIELD_NUMBER = 5; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Short description of the spoke resource
+   * 
+ * + * string description = 5; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Short description of the spoke resource
+   * 
+ * + * string description = 5; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HUB_FIELD_NUMBER = 6; + private volatile java.lang.Object hub_; + /** + * + * + *
+   * The resource URL of the hub resource that the spoke is attached to
+   * 
+ * + * string hub = 6 [(.google.api.resource_reference) = { ... } + * + * @return The hub. + */ + @java.lang.Override + public java.lang.String getHub() { + java.lang.Object ref = hub_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hub_ = s; + return s; + } + } + /** + * + * + *
+   * The resource URL of the hub resource that the spoke is attached to
+   * 
+ * + * string hub = 6 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for hub. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHubBytes() { + java.lang.Object ref = hub_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hub_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LINKED_VPN_TUNNELS_FIELD_NUMBER = 12; + private com.google.protobuf.LazyStringList linkedVpnTunnels_; + /** + * + * + *
+   * The URIs of linked VPN tunnel resources
+   * 
+ * + * repeated string linked_vpn_tunnels = 12 [(.google.api.resource_reference) = { ... } + * + * + * @return A list containing the linkedVpnTunnels. + */ + public com.google.protobuf.ProtocolStringList getLinkedVpnTunnelsList() { + return linkedVpnTunnels_; + } + /** + * + * + *
+   * The URIs of linked VPN tunnel resources
+   * 
+ * + * repeated string linked_vpn_tunnels = 12 [(.google.api.resource_reference) = { ... } + * + * + * @return The count of linkedVpnTunnels. + */ + public int getLinkedVpnTunnelsCount() { + return linkedVpnTunnels_.size(); + } + /** + * + * + *
+   * The URIs of linked VPN tunnel resources
+   * 
+ * + * repeated string linked_vpn_tunnels = 12 [(.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The linkedVpnTunnels at the given index. + */ + public java.lang.String getLinkedVpnTunnels(int index) { + return linkedVpnTunnels_.get(index); + } + /** + * + * + *
+   * The URIs of linked VPN tunnel resources
+   * 
+ * + * repeated string linked_vpn_tunnels = 12 [(.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the linkedVpnTunnels at the given index. + */ + public com.google.protobuf.ByteString getLinkedVpnTunnelsBytes(int index) { + return linkedVpnTunnels_.getByteString(index); + } + + public static final int LINKED_INTERCONNECT_ATTACHMENTS_FIELD_NUMBER = 13; + private com.google.protobuf.LazyStringList linkedInterconnectAttachments_; + /** + * + * + *
+   * The URIs of linked interconnect attachment resources
+   * 
+ * + * + * repeated string linked_interconnect_attachments = 13 [(.google.api.resource_reference) = { ... } + * + * + * @return A list containing the linkedInterconnectAttachments. + */ + public com.google.protobuf.ProtocolStringList getLinkedInterconnectAttachmentsList() { + return linkedInterconnectAttachments_; + } + /** + * + * + *
+   * The URIs of linked interconnect attachment resources
+   * 
+ * + * + * repeated string linked_interconnect_attachments = 13 [(.google.api.resource_reference) = { ... } + * + * + * @return The count of linkedInterconnectAttachments. + */ + public int getLinkedInterconnectAttachmentsCount() { + return linkedInterconnectAttachments_.size(); + } + /** + * + * + *
+   * The URIs of linked interconnect attachment resources
+   * 
+ * + * + * repeated string linked_interconnect_attachments = 13 [(.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The linkedInterconnectAttachments at the given index. + */ + public java.lang.String getLinkedInterconnectAttachments(int index) { + return linkedInterconnectAttachments_.get(index); + } + /** + * + * + *
+   * The URIs of linked interconnect attachment resources
+   * 
+ * + * + * repeated string linked_interconnect_attachments = 13 [(.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the linkedInterconnectAttachments at the given index. + */ + public com.google.protobuf.ByteString getLinkedInterconnectAttachmentsBytes(int index) { + return linkedInterconnectAttachments_.getByteString(index); + } + + public static final int LINKED_ROUTER_APPLIANCE_INSTANCES_FIELD_NUMBER = 14; + private java.util.List + linkedRouterApplianceInstances_; + /** + * + * + *
+   * The URIs of linked Router appliance resources
+   * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + @java.lang.Override + public java.util.List + getLinkedRouterApplianceInstancesList() { + return linkedRouterApplianceInstances_; + } + /** + * + * + *
+   * The URIs of linked Router appliance resources
+   * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstanceOrBuilder> + getLinkedRouterApplianceInstancesOrBuilderList() { + return linkedRouterApplianceInstances_; + } + /** + * + * + *
+   * The URIs of linked Router appliance resources
+   * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + @java.lang.Override + public int getLinkedRouterApplianceInstancesCount() { + return linkedRouterApplianceInstances_.size(); + } + /** + * + * + *
+   * The URIs of linked Router appliance resources
+   * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance + getLinkedRouterApplianceInstances(int index) { + return linkedRouterApplianceInstances_.get(index); + } + /** + * + * + *
+   * The URIs of linked Router appliance resources
+   * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstanceOrBuilder + getLinkedRouterApplianceInstancesOrBuilder(int index) { + return linkedRouterApplianceInstances_.get(index); + } + + public static final int UNIQUE_ID_FIELD_NUMBER = 11; + private volatile java.lang.Object uniqueId_; + /** + * + * + *
+   * Output only. Google-generated UUID for this resource. This is unique across all Spoke
+   * resources. If a Spoke resource is deleted and another with the same name is
+   * created, it gets a different unique_id.
+   * 
+ * + * string unique_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uniqueId. + */ + @java.lang.Override + public java.lang.String getUniqueId() { + java.lang.Object ref = uniqueId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uniqueId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Google-generated UUID for this resource. This is unique across all Spoke
+   * resources. If a Spoke resource is deleted and another with the same name is
+   * created, it gets a different unique_id.
+   * 
+ * + * string unique_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uniqueId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUniqueIdBytes() { + java.lang.Object ref = uniqueId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uniqueId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (createTime_ != null) { + output.writeMessage(2, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(3, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, description_); + } + if (!getHubBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, hub_); + } + if (!getUniqueIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, uniqueId_); + } + for (int i = 0; i < linkedVpnTunnels_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, linkedVpnTunnels_.getRaw(i)); + } + for (int i = 0; i < linkedInterconnectAttachments_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 13, linkedInterconnectAttachments_.getRaw(i)); + } + for (int i = 0; i < linkedRouterApplianceInstances_.size(); i++) { + output.writeMessage(14, linkedRouterApplianceInstances_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, labels__); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, description_); + } + if (!getHubBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, hub_); + } + if (!getUniqueIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, uniqueId_); + } + { + int dataSize = 0; + for (int i = 0; i < linkedVpnTunnels_.size(); i++) { + dataSize += computeStringSizeNoTag(linkedVpnTunnels_.getRaw(i)); + } + size += dataSize; + size += 1 * getLinkedVpnTunnelsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < linkedInterconnectAttachments_.size(); i++) { + dataSize += computeStringSizeNoTag(linkedInterconnectAttachments_.getRaw(i)); + } + size += dataSize; + size += 1 * getLinkedInterconnectAttachmentsList().size(); + } + for (int i = 0; i < linkedRouterApplianceInstances_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 14, linkedRouterApplianceInstances_.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.networkconnectivity.v1alpha1.Spoke)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1alpha1.Spoke other = + (com.google.cloud.networkconnectivity.v1alpha1.Spoke) obj; + + if (!getName().equals(other.getName())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getHub().equals(other.getHub())) return false; + if (!getLinkedVpnTunnelsList().equals(other.getLinkedVpnTunnelsList())) return false; + if (!getLinkedInterconnectAttachmentsList() + .equals(other.getLinkedInterconnectAttachmentsList())) return false; + if (!getLinkedRouterApplianceInstancesList() + .equals(other.getLinkedRouterApplianceInstancesList())) return false; + if (!getUniqueId().equals(other.getUniqueId())) 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 (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + HUB_FIELD_NUMBER; + hash = (53 * hash) + getHub().hashCode(); + if (getLinkedVpnTunnelsCount() > 0) { + hash = (37 * hash) + LINKED_VPN_TUNNELS_FIELD_NUMBER; + hash = (53 * hash) + getLinkedVpnTunnelsList().hashCode(); + } + if (getLinkedInterconnectAttachmentsCount() > 0) { + hash = (37 * hash) + LINKED_INTERCONNECT_ATTACHMENTS_FIELD_NUMBER; + hash = (53 * hash) + getLinkedInterconnectAttachmentsList().hashCode(); + } + if (getLinkedRouterApplianceInstancesCount() > 0) { + hash = (37 * hash) + LINKED_ROUTER_APPLIANCE_INSTANCES_FIELD_NUMBER; + hash = (53 * hash) + getLinkedRouterApplianceInstancesList().hashCode(); + } + hash = (37 * hash) + UNIQUE_ID_FIELD_NUMBER; + hash = (53 * hash) + getUniqueId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1alpha1.Spoke parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.Spoke 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.networkconnectivity.v1alpha1.Spoke parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.Spoke 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.networkconnectivity.v1alpha1.Spoke parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.Spoke parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.Spoke parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.Spoke 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.networkconnectivity.v1alpha1.Spoke parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.Spoke 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.networkconnectivity.v1alpha1.Spoke parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.Spoke 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.networkconnectivity.v1alpha1.Spoke prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A Spoke is an  abstraction of a network attachment being attached
+   * to a Hub. A Spoke can be underlying a VPN tunnel, a
+   * VLAN (interconnect) attachment, a Router appliance, etc.
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.Spoke} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1alpha1.Spoke) + com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_Spoke_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_Spoke_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.Spoke.class, + com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1alpha1.Spoke.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getLinkedRouterApplianceInstancesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + description_ = ""; + + hub_ = ""; + + linkedVpnTunnels_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + linkedInterconnectAttachments_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + if (linkedRouterApplianceInstancesBuilder_ == null) { + linkedRouterApplianceInstances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + linkedRouterApplianceInstancesBuilder_.clear(); + } + uniqueId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_Spoke_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.Spoke getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1alpha1.Spoke.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.Spoke build() { + com.google.cloud.networkconnectivity.v1alpha1.Spoke result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.Spoke buildPartial() { + com.google.cloud.networkconnectivity.v1alpha1.Spoke result = + new com.google.cloud.networkconnectivity.v1alpha1.Spoke(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.description_ = description_; + result.hub_ = hub_; + if (((bitField0_ & 0x00000002) != 0)) { + linkedVpnTunnels_ = linkedVpnTunnels_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.linkedVpnTunnels_ = linkedVpnTunnels_; + if (((bitField0_ & 0x00000004) != 0)) { + linkedInterconnectAttachments_ = linkedInterconnectAttachments_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.linkedInterconnectAttachments_ = linkedInterconnectAttachments_; + if (linkedRouterApplianceInstancesBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + linkedRouterApplianceInstances_ = + java.util.Collections.unmodifiableList(linkedRouterApplianceInstances_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.linkedRouterApplianceInstances_ = linkedRouterApplianceInstances_; + } else { + result.linkedRouterApplianceInstances_ = linkedRouterApplianceInstancesBuilder_.build(); + } + result.uniqueId_ = uniqueId_; + 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.networkconnectivity.v1alpha1.Spoke) { + return mergeFrom((com.google.cloud.networkconnectivity.v1alpha1.Spoke) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1alpha1.Spoke other) { + if (other == com.google.cloud.networkconnectivity.v1alpha1.Spoke.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (!other.getHub().isEmpty()) { + hub_ = other.hub_; + onChanged(); + } + if (!other.linkedVpnTunnels_.isEmpty()) { + if (linkedVpnTunnels_.isEmpty()) { + linkedVpnTunnels_ = other.linkedVpnTunnels_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureLinkedVpnTunnelsIsMutable(); + linkedVpnTunnels_.addAll(other.linkedVpnTunnels_); + } + onChanged(); + } + if (!other.linkedInterconnectAttachments_.isEmpty()) { + if (linkedInterconnectAttachments_.isEmpty()) { + linkedInterconnectAttachments_ = other.linkedInterconnectAttachments_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureLinkedInterconnectAttachmentsIsMutable(); + linkedInterconnectAttachments_.addAll(other.linkedInterconnectAttachments_); + } + onChanged(); + } + if (linkedRouterApplianceInstancesBuilder_ == null) { + if (!other.linkedRouterApplianceInstances_.isEmpty()) { + if (linkedRouterApplianceInstances_.isEmpty()) { + linkedRouterApplianceInstances_ = other.linkedRouterApplianceInstances_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureLinkedRouterApplianceInstancesIsMutable(); + linkedRouterApplianceInstances_.addAll(other.linkedRouterApplianceInstances_); + } + onChanged(); + } + } else { + if (!other.linkedRouterApplianceInstances_.isEmpty()) { + if (linkedRouterApplianceInstancesBuilder_.isEmpty()) { + linkedRouterApplianceInstancesBuilder_.dispose(); + linkedRouterApplianceInstancesBuilder_ = null; + linkedRouterApplianceInstances_ = other.linkedRouterApplianceInstances_; + bitField0_ = (bitField0_ & ~0x00000008); + linkedRouterApplianceInstancesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getLinkedRouterApplianceInstancesFieldBuilder() + : null; + } else { + linkedRouterApplianceInstancesBuilder_.addAllMessages( + other.linkedRouterApplianceInstances_); + } + } + } + if (!other.getUniqueId().isEmpty()) { + uniqueId_ = other.uniqueId_; + 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.networkconnectivity.v1alpha1.Spoke parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1alpha1.Spoke) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. The name of a Spoke resource.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+     * Immutable. The name of a Spoke resource.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+     * Immutable. The name of a Spoke resource.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + /** + * + * + *
+     * Immutable. The name of a Spoke resource.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The name of a Spoke resource.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * The time when the Spoke was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * The time when the Spoke was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time when the Spoke was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time when the Spoke was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time when the Spoke was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time when the Spoke was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time when the Spoke was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time when the Spoke was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * The time when the Spoke was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * The time when the Spoke was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * The time when the Spoke was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time when the Spoke was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time when the Spoke was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time when the Spoke was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time when the Spoke was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time when the Spoke was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time when the Spoke was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * The time when the Spoke was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * User-defined labels.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * User-defined labels.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * User-defined labels.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * User-defined labels.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * User-defined labels.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * User-defined labels.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * User-defined labels.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Short description of the spoke resource
+     * 
+ * + * string description = 5; + * + * @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; + } + } + /** + * + * + *
+     * Short description of the spoke resource
+     * 
+ * + * string description = 5; + * + * @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; + } + } + /** + * + * + *
+     * Short description of the spoke resource
+     * 
+ * + * string description = 5; + * + * @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; + } + /** + * + * + *
+     * Short description of the spoke resource
+     * 
+ * + * string description = 5; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Short description of the spoke resource
+     * 
+ * + * string description = 5; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.lang.Object hub_ = ""; + /** + * + * + *
+     * The resource URL of the hub resource that the spoke is attached to
+     * 
+ * + * string hub = 6 [(.google.api.resource_reference) = { ... } + * + * @return The hub. + */ + public java.lang.String getHub() { + java.lang.Object ref = hub_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hub_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource URL of the hub resource that the spoke is attached to
+     * 
+ * + * string hub = 6 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for hub. + */ + public com.google.protobuf.ByteString getHubBytes() { + java.lang.Object ref = hub_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hub_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource URL of the hub resource that the spoke is attached to
+     * 
+ * + * string hub = 6 [(.google.api.resource_reference) = { ... } + * + * @param value The hub to set. + * @return This builder for chaining. + */ + public Builder setHub(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + hub_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource URL of the hub resource that the spoke is attached to
+     * 
+ * + * string hub = 6 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearHub() { + + hub_ = getDefaultInstance().getHub(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource URL of the hub resource that the spoke is attached to
+     * 
+ * + * string hub = 6 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for hub to set. + * @return This builder for chaining. + */ + public Builder setHubBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + hub_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList linkedVpnTunnels_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureLinkedVpnTunnelsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + linkedVpnTunnels_ = new com.google.protobuf.LazyStringArrayList(linkedVpnTunnels_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The URIs of linked VPN tunnel resources
+     * 
+ * + * repeated string linked_vpn_tunnels = 12 [(.google.api.resource_reference) = { ... } + * + * + * @return A list containing the linkedVpnTunnels. + */ + public com.google.protobuf.ProtocolStringList getLinkedVpnTunnelsList() { + return linkedVpnTunnels_.getUnmodifiableView(); + } + /** + * + * + *
+     * The URIs of linked VPN tunnel resources
+     * 
+ * + * repeated string linked_vpn_tunnels = 12 [(.google.api.resource_reference) = { ... } + * + * + * @return The count of linkedVpnTunnels. + */ + public int getLinkedVpnTunnelsCount() { + return linkedVpnTunnels_.size(); + } + /** + * + * + *
+     * The URIs of linked VPN tunnel resources
+     * 
+ * + * repeated string linked_vpn_tunnels = 12 [(.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The linkedVpnTunnels at the given index. + */ + public java.lang.String getLinkedVpnTunnels(int index) { + return linkedVpnTunnels_.get(index); + } + /** + * + * + *
+     * The URIs of linked VPN tunnel resources
+     * 
+ * + * repeated string linked_vpn_tunnels = 12 [(.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the linkedVpnTunnels at the given index. + */ + public com.google.protobuf.ByteString getLinkedVpnTunnelsBytes(int index) { + return linkedVpnTunnels_.getByteString(index); + } + /** + * + * + *
+     * The URIs of linked VPN tunnel resources
+     * 
+ * + * repeated string linked_vpn_tunnels = 12 [(.google.api.resource_reference) = { ... } + * + * + * @param index The index to set the value at. + * @param value The linkedVpnTunnels to set. + * @return This builder for chaining. + */ + public Builder setLinkedVpnTunnels(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkedVpnTunnelsIsMutable(); + linkedVpnTunnels_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The URIs of linked VPN tunnel resources
+     * 
+ * + * repeated string linked_vpn_tunnels = 12 [(.google.api.resource_reference) = { ... } + * + * + * @param value The linkedVpnTunnels to add. + * @return This builder for chaining. + */ + public Builder addLinkedVpnTunnels(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkedVpnTunnelsIsMutable(); + linkedVpnTunnels_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The URIs of linked VPN tunnel resources
+     * 
+ * + * repeated string linked_vpn_tunnels = 12 [(.google.api.resource_reference) = { ... } + * + * + * @param values The linkedVpnTunnels to add. + * @return This builder for chaining. + */ + public Builder addAllLinkedVpnTunnels(java.lang.Iterable values) { + ensureLinkedVpnTunnelsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, linkedVpnTunnels_); + onChanged(); + return this; + } + /** + * + * + *
+     * The URIs of linked VPN tunnel resources
+     * 
+ * + * repeated string linked_vpn_tunnels = 12 [(.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearLinkedVpnTunnels() { + linkedVpnTunnels_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The URIs of linked VPN tunnel resources
+     * 
+ * + * repeated string linked_vpn_tunnels = 12 [(.google.api.resource_reference) = { ... } + * + * + * @param value The bytes of the linkedVpnTunnels to add. + * @return This builder for chaining. + */ + public Builder addLinkedVpnTunnelsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureLinkedVpnTunnelsIsMutable(); + linkedVpnTunnels_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList linkedInterconnectAttachments_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureLinkedInterconnectAttachmentsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + linkedInterconnectAttachments_ = + new com.google.protobuf.LazyStringArrayList(linkedInterconnectAttachments_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * The URIs of linked interconnect attachment resources
+     * 
+ * + * + * repeated string linked_interconnect_attachments = 13 [(.google.api.resource_reference) = { ... } + * + * + * @return A list containing the linkedInterconnectAttachments. + */ + public com.google.protobuf.ProtocolStringList getLinkedInterconnectAttachmentsList() { + return linkedInterconnectAttachments_.getUnmodifiableView(); + } + /** + * + * + *
+     * The URIs of linked interconnect attachment resources
+     * 
+ * + * + * repeated string linked_interconnect_attachments = 13 [(.google.api.resource_reference) = { ... } + * + * + * @return The count of linkedInterconnectAttachments. + */ + public int getLinkedInterconnectAttachmentsCount() { + return linkedInterconnectAttachments_.size(); + } + /** + * + * + *
+     * The URIs of linked interconnect attachment resources
+     * 
+ * + * + * repeated string linked_interconnect_attachments = 13 [(.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The linkedInterconnectAttachments at the given index. + */ + public java.lang.String getLinkedInterconnectAttachments(int index) { + return linkedInterconnectAttachments_.get(index); + } + /** + * + * + *
+     * The URIs of linked interconnect attachment resources
+     * 
+ * + * + * repeated string linked_interconnect_attachments = 13 [(.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the linkedInterconnectAttachments at the given index. + */ + public com.google.protobuf.ByteString getLinkedInterconnectAttachmentsBytes(int index) { + return linkedInterconnectAttachments_.getByteString(index); + } + /** + * + * + *
+     * The URIs of linked interconnect attachment resources
+     * 
+ * + * + * repeated string linked_interconnect_attachments = 13 [(.google.api.resource_reference) = { ... } + * + * + * @param index The index to set the value at. + * @param value The linkedInterconnectAttachments to set. + * @return This builder for chaining. + */ + public Builder setLinkedInterconnectAttachments(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkedInterconnectAttachmentsIsMutable(); + linkedInterconnectAttachments_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The URIs of linked interconnect attachment resources
+     * 
+ * + * + * repeated string linked_interconnect_attachments = 13 [(.google.api.resource_reference) = { ... } + * + * + * @param value The linkedInterconnectAttachments to add. + * @return This builder for chaining. + */ + public Builder addLinkedInterconnectAttachments(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkedInterconnectAttachmentsIsMutable(); + linkedInterconnectAttachments_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The URIs of linked interconnect attachment resources
+     * 
+ * + * + * repeated string linked_interconnect_attachments = 13 [(.google.api.resource_reference) = { ... } + * + * + * @param values The linkedInterconnectAttachments to add. + * @return This builder for chaining. + */ + public Builder addAllLinkedInterconnectAttachments( + java.lang.Iterable values) { + ensureLinkedInterconnectAttachmentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, linkedInterconnectAttachments_); + onChanged(); + return this; + } + /** + * + * + *
+     * The URIs of linked interconnect attachment resources
+     * 
+ * + * + * repeated string linked_interconnect_attachments = 13 [(.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearLinkedInterconnectAttachments() { + linkedInterconnectAttachments_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The URIs of linked interconnect attachment resources
+     * 
+ * + * + * repeated string linked_interconnect_attachments = 13 [(.google.api.resource_reference) = { ... } + * + * + * @param value The bytes of the linkedInterconnectAttachments to add. + * @return This builder for chaining. + */ + public Builder addLinkedInterconnectAttachmentsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureLinkedInterconnectAttachmentsIsMutable(); + linkedInterconnectAttachments_.add(value); + onChanged(); + return this; + } + + private java.util.List + linkedRouterApplianceInstances_ = java.util.Collections.emptyList(); + + private void ensureLinkedRouterApplianceInstancesIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + linkedRouterApplianceInstances_ = + new java.util.ArrayList< + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance>( + linkedRouterApplianceInstances_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance, + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance.Builder, + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstanceOrBuilder> + linkedRouterApplianceInstancesBuilder_; + + /** + * + * + *
+     * The URIs of linked Router appliance resources
+     * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + public java.util.List + getLinkedRouterApplianceInstancesList() { + if (linkedRouterApplianceInstancesBuilder_ == null) { + return java.util.Collections.unmodifiableList(linkedRouterApplianceInstances_); + } else { + return linkedRouterApplianceInstancesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The URIs of linked Router appliance resources
+     * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + public int getLinkedRouterApplianceInstancesCount() { + if (linkedRouterApplianceInstancesBuilder_ == null) { + return linkedRouterApplianceInstances_.size(); + } else { + return linkedRouterApplianceInstancesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The URIs of linked Router appliance resources
+     * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + public com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance + getLinkedRouterApplianceInstances(int index) { + if (linkedRouterApplianceInstancesBuilder_ == null) { + return linkedRouterApplianceInstances_.get(index); + } else { + return linkedRouterApplianceInstancesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The URIs of linked Router appliance resources
+     * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + public Builder setLinkedRouterApplianceInstances( + int index, com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance value) { + if (linkedRouterApplianceInstancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkedRouterApplianceInstancesIsMutable(); + linkedRouterApplianceInstances_.set(index, value); + onChanged(); + } else { + linkedRouterApplianceInstancesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The URIs of linked Router appliance resources
+     * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + public Builder setLinkedRouterApplianceInstances( + int index, + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance.Builder + builderForValue) { + if (linkedRouterApplianceInstancesBuilder_ == null) { + ensureLinkedRouterApplianceInstancesIsMutable(); + linkedRouterApplianceInstances_.set(index, builderForValue.build()); + onChanged(); + } else { + linkedRouterApplianceInstancesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The URIs of linked Router appliance resources
+     * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + public Builder addLinkedRouterApplianceInstances( + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance value) { + if (linkedRouterApplianceInstancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkedRouterApplianceInstancesIsMutable(); + linkedRouterApplianceInstances_.add(value); + onChanged(); + } else { + linkedRouterApplianceInstancesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The URIs of linked Router appliance resources
+     * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + public Builder addLinkedRouterApplianceInstances( + int index, com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance value) { + if (linkedRouterApplianceInstancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkedRouterApplianceInstancesIsMutable(); + linkedRouterApplianceInstances_.add(index, value); + onChanged(); + } else { + linkedRouterApplianceInstancesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The URIs of linked Router appliance resources
+     * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + public Builder addLinkedRouterApplianceInstances( + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance.Builder + builderForValue) { + if (linkedRouterApplianceInstancesBuilder_ == null) { + ensureLinkedRouterApplianceInstancesIsMutable(); + linkedRouterApplianceInstances_.add(builderForValue.build()); + onChanged(); + } else { + linkedRouterApplianceInstancesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The URIs of linked Router appliance resources
+     * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + public Builder addLinkedRouterApplianceInstances( + int index, + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance.Builder + builderForValue) { + if (linkedRouterApplianceInstancesBuilder_ == null) { + ensureLinkedRouterApplianceInstancesIsMutable(); + linkedRouterApplianceInstances_.add(index, builderForValue.build()); + onChanged(); + } else { + linkedRouterApplianceInstancesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The URIs of linked Router appliance resources
+     * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + public Builder addAllLinkedRouterApplianceInstances( + java.lang.Iterable< + ? extends com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance> + values) { + if (linkedRouterApplianceInstancesBuilder_ == null) { + ensureLinkedRouterApplianceInstancesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, linkedRouterApplianceInstances_); + onChanged(); + } else { + linkedRouterApplianceInstancesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The URIs of linked Router appliance resources
+     * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + public Builder clearLinkedRouterApplianceInstances() { + if (linkedRouterApplianceInstancesBuilder_ == null) { + linkedRouterApplianceInstances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + linkedRouterApplianceInstancesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The URIs of linked Router appliance resources
+     * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + public Builder removeLinkedRouterApplianceInstances(int index) { + if (linkedRouterApplianceInstancesBuilder_ == null) { + ensureLinkedRouterApplianceInstancesIsMutable(); + linkedRouterApplianceInstances_.remove(index); + onChanged(); + } else { + linkedRouterApplianceInstancesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The URIs of linked Router appliance resources
+     * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + public com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance.Builder + getLinkedRouterApplianceInstancesBuilder(int index) { + return getLinkedRouterApplianceInstancesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The URIs of linked Router appliance resources
+     * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + public com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstanceOrBuilder + getLinkedRouterApplianceInstancesOrBuilder(int index) { + if (linkedRouterApplianceInstancesBuilder_ == null) { + return linkedRouterApplianceInstances_.get(index); + } else { + return linkedRouterApplianceInstancesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The URIs of linked Router appliance resources
+     * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + public java.util.List< + ? extends + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstanceOrBuilder> + getLinkedRouterApplianceInstancesOrBuilderList() { + if (linkedRouterApplianceInstancesBuilder_ != null) { + return linkedRouterApplianceInstancesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(linkedRouterApplianceInstances_); + } + } + /** + * + * + *
+     * The URIs of linked Router appliance resources
+     * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + public com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance.Builder + addLinkedRouterApplianceInstancesBuilder() { + return getLinkedRouterApplianceInstancesFieldBuilder() + .addBuilder( + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance + .getDefaultInstance()); + } + /** + * + * + *
+     * The URIs of linked Router appliance resources
+     * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + public com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance.Builder + addLinkedRouterApplianceInstancesBuilder(int index) { + return getLinkedRouterApplianceInstancesFieldBuilder() + .addBuilder( + index, + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance + .getDefaultInstance()); + } + /** + * + * + *
+     * The URIs of linked Router appliance resources
+     * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + public java.util.List< + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance.Builder> + getLinkedRouterApplianceInstancesBuilderList() { + return getLinkedRouterApplianceInstancesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance, + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance.Builder, + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstanceOrBuilder> + getLinkedRouterApplianceInstancesFieldBuilder() { + if (linkedRouterApplianceInstancesBuilder_ == null) { + linkedRouterApplianceInstancesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance, + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance.Builder, + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstanceOrBuilder>( + linkedRouterApplianceInstances_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + linkedRouterApplianceInstances_ = null; + } + return linkedRouterApplianceInstancesBuilder_; + } + + private java.lang.Object uniqueId_ = ""; + /** + * + * + *
+     * Output only. Google-generated UUID for this resource. This is unique across all Spoke
+     * resources. If a Spoke resource is deleted and another with the same name is
+     * created, it gets a different unique_id.
+     * 
+ * + * string unique_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uniqueId. + */ + public java.lang.String getUniqueId() { + java.lang.Object ref = uniqueId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uniqueId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Google-generated UUID for this resource. This is unique across all Spoke
+     * resources. If a Spoke resource is deleted and another with the same name is
+     * created, it gets a different unique_id.
+     * 
+ * + * string unique_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uniqueId. + */ + public com.google.protobuf.ByteString getUniqueIdBytes() { + java.lang.Object ref = uniqueId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uniqueId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Google-generated UUID for this resource. This is unique across all Spoke
+     * resources. If a Spoke resource is deleted and another with the same name is
+     * created, it gets a different unique_id.
+     * 
+ * + * string unique_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uniqueId to set. + * @return This builder for chaining. + */ + public Builder setUniqueId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uniqueId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Google-generated UUID for this resource. This is unique across all Spoke
+     * resources. If a Spoke resource is deleted and another with the same name is
+     * created, it gets a different unique_id.
+     * 
+ * + * string unique_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUniqueId() { + + uniqueId_ = getDefaultInstance().getUniqueId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Google-generated UUID for this resource. This is unique across all Spoke
+     * resources. If a Spoke resource is deleted and another with the same name is
+     * created, it gets a different unique_id.
+     * 
+ * + * string unique_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uniqueId to set. + * @return This builder for chaining. + */ + public Builder setUniqueIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uniqueId_ = 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.networkconnectivity.v1alpha1.Spoke) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1alpha1.Spoke) + private static final com.google.cloud.networkconnectivity.v1alpha1.Spoke DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1alpha1.Spoke(); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.Spoke getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Spoke parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Spoke(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.networkconnectivity.v1alpha1.Spoke getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/SpokeName.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/SpokeName.java new file mode 100644 index 00000000..4e571cec --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/SpokeName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.networkconnectivity.v1alpha1; + +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; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class SpokeName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_SPOKE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/spokes/{spoke}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String spoke; + + @Deprecated + protected SpokeName() { + project = null; + location = null; + spoke = null; + } + + private SpokeName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + spoke = Preconditions.checkNotNull(builder.getSpoke()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getSpoke() { + return spoke; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SpokeName of(String project, String location, String spoke) { + return newBuilder().setProject(project).setLocation(location).setSpoke(spoke).build(); + } + + public static String format(String project, String location, String spoke) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setSpoke(spoke) + .build() + .toString(); + } + + public static SpokeName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_SPOKE.validatedMatch( + formattedString, "SpokeName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("spoke")); + } + + 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 (SpokeName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_SPOKE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (spoke != null) { + fieldMapBuilder.put("spoke", spoke); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_SPOKE.instantiate( + "project", project, "location", location, "spoke", spoke); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + SpokeName that = ((SpokeName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.spoke, that.spoke); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(spoke); + return h; + } + + /** Builder for projects/{project}/locations/{location}/spokes/{spoke}. */ + public static class Builder { + private String project; + private String location; + private String spoke; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getSpoke() { + return spoke; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setSpoke(String spoke) { + this.spoke = spoke; + return this; + } + + private Builder(SpokeName spokeName) { + project = spokeName.project; + location = spokeName.location; + spoke = spokeName.spoke; + } + + public SpokeName build() { + return new SpokeName(this); + } + } +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/SpokeOrBuilder.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/SpokeOrBuilder.java new file mode 100644 index 00000000..25f28e75 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/SpokeOrBuilder.java @@ -0,0 +1,433 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +public interface SpokeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1alpha1.Spoke) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. The name of a Spoke resource.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. The name of a Spoke resource.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The time when the Spoke was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * The time when the Spoke was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * The time when the Spoke was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * The time when the Spoke was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * The time when the Spoke was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * The time when the Spoke was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * User-defined labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + int getLabelsCount(); + /** + * + * + *
+   * User-defined labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * User-defined labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * User-defined labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * User-defined labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Short description of the spoke resource
+   * 
+ * + * string description = 5; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Short description of the spoke resource
+   * 
+ * + * string description = 5; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * The resource URL of the hub resource that the spoke is attached to
+   * 
+ * + * string hub = 6 [(.google.api.resource_reference) = { ... } + * + * @return The hub. + */ + java.lang.String getHub(); + /** + * + * + *
+   * The resource URL of the hub resource that the spoke is attached to
+   * 
+ * + * string hub = 6 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for hub. + */ + com.google.protobuf.ByteString getHubBytes(); + + /** + * + * + *
+   * The URIs of linked VPN tunnel resources
+   * 
+ * + * repeated string linked_vpn_tunnels = 12 [(.google.api.resource_reference) = { ... } + * + * + * @return A list containing the linkedVpnTunnels. + */ + java.util.List getLinkedVpnTunnelsList(); + /** + * + * + *
+   * The URIs of linked VPN tunnel resources
+   * 
+ * + * repeated string linked_vpn_tunnels = 12 [(.google.api.resource_reference) = { ... } + * + * + * @return The count of linkedVpnTunnels. + */ + int getLinkedVpnTunnelsCount(); + /** + * + * + *
+   * The URIs of linked VPN tunnel resources
+   * 
+ * + * repeated string linked_vpn_tunnels = 12 [(.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The linkedVpnTunnels at the given index. + */ + java.lang.String getLinkedVpnTunnels(int index); + /** + * + * + *
+   * The URIs of linked VPN tunnel resources
+   * 
+ * + * repeated string linked_vpn_tunnels = 12 [(.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the linkedVpnTunnels at the given index. + */ + com.google.protobuf.ByteString getLinkedVpnTunnelsBytes(int index); + + /** + * + * + *
+   * The URIs of linked interconnect attachment resources
+   * 
+ * + * + * repeated string linked_interconnect_attachments = 13 [(.google.api.resource_reference) = { ... } + * + * + * @return A list containing the linkedInterconnectAttachments. + */ + java.util.List getLinkedInterconnectAttachmentsList(); + /** + * + * + *
+   * The URIs of linked interconnect attachment resources
+   * 
+ * + * + * repeated string linked_interconnect_attachments = 13 [(.google.api.resource_reference) = { ... } + * + * + * @return The count of linkedInterconnectAttachments. + */ + int getLinkedInterconnectAttachmentsCount(); + /** + * + * + *
+   * The URIs of linked interconnect attachment resources
+   * 
+ * + * + * repeated string linked_interconnect_attachments = 13 [(.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The linkedInterconnectAttachments at the given index. + */ + java.lang.String getLinkedInterconnectAttachments(int index); + /** + * + * + *
+   * The URIs of linked interconnect attachment resources
+   * 
+ * + * + * repeated string linked_interconnect_attachments = 13 [(.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the linkedInterconnectAttachments at the given index. + */ + com.google.protobuf.ByteString getLinkedInterconnectAttachmentsBytes(int index); + + /** + * + * + *
+   * The URIs of linked Router appliance resources
+   * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + java.util.List + getLinkedRouterApplianceInstancesList(); + /** + * + * + *
+   * The URIs of linked Router appliance resources
+   * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance + getLinkedRouterApplianceInstances(int index); + /** + * + * + *
+   * The URIs of linked Router appliance resources
+   * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + int getLinkedRouterApplianceInstancesCount(); + /** + * + * + *
+   * The URIs of linked Router appliance resources
+   * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + java.util.List< + ? extends com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstanceOrBuilder> + getLinkedRouterApplianceInstancesOrBuilderList(); + /** + * + * + *
+   * The URIs of linked Router appliance resources
+   * 
+ * + * + * repeated .google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstance linked_router_appliance_instances = 14; + * + */ + com.google.cloud.networkconnectivity.v1alpha1.RouterApplianceInstanceOrBuilder + getLinkedRouterApplianceInstancesOrBuilder(int index); + + /** + * + * + *
+   * Output only. Google-generated UUID for this resource. This is unique across all Spoke
+   * resources. If a Spoke resource is deleted and another with the same name is
+   * created, it gets a different unique_id.
+   * 
+ * + * string unique_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uniqueId. + */ + java.lang.String getUniqueId(); + /** + * + * + *
+   * Output only. Google-generated UUID for this resource. This is unique across all Spoke
+   * resources. If a Spoke resource is deleted and another with the same name is
+   * created, it gets a different unique_id.
+   * 
+ * + * string unique_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uniqueId. + */ + com.google.protobuf.ByteString getUniqueIdBytes(); +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/UpdateHubRequest.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/UpdateHubRequest.java new file mode 100644 index 00000000..20f144b5 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/UpdateHubRequest.java @@ -0,0 +1,1348 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +/** + * + * + *
+ * Request for [HubService.UpdateHub][google.cloud.networkconnectivity.v1alpha1.HubService.UpdateHub] method.
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest} + */ +public final class UpdateHubRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest) + UpdateHubRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateHubRequest.newBuilder() to construct. + private UpdateHubRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateHubRequest() { + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateHubRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateHubRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.networkconnectivity.v1alpha1.Hub.Builder subBuilder = null; + if (hub_ != null) { + subBuilder = hub_.toBuilder(); + } + hub_ = + input.readMessage( + com.google.cloud.networkconnectivity.v1alpha1.Hub.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(hub_); + hub_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = 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.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_UpdateHubRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_UpdateHubRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest.class, + com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Hub resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Hub resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Hub resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int HUB_FIELD_NUMBER = 2; + private com.google.cloud.networkconnectivity.v1alpha1.Hub hub_; + /** + * + * + *
+   * Required. The state that the Hub should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the hub field is set. + */ + @java.lang.Override + public boolean hasHub() { + return hub_ != null; + } + /** + * + * + *
+   * Required. The state that the Hub should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The hub. + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.Hub getHub() { + return hub_ == null + ? com.google.cloud.networkconnectivity.v1alpha1.Hub.getDefaultInstance() + : hub_; + } + /** + * + * + *
+   * Required. The state that the Hub should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.HubOrBuilder getHubOrBuilder() { + return getHub(); + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (hub_ != null) { + output.writeMessage(2, getHub()); + } + if (!getRequestIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (hub_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getHub()); + } + if (!getRequestIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + 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.networkconnectivity.v1alpha1.UpdateHubRequest)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest other = + (com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasHub() != other.hasHub()) return false; + if (hasHub()) { + if (!getHub().equals(other.getHub())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasHub()) { + hash = (37 * hash) + HUB_FIELD_NUMBER; + hash = (53 * hash) + getHub().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest 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.networkconnectivity.v1alpha1.UpdateHubRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest 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.networkconnectivity.v1alpha1.UpdateHubRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest 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.networkconnectivity.v1alpha1.UpdateHubRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest 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.networkconnectivity.v1alpha1.UpdateHubRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest 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.networkconnectivity.v1alpha1.UpdateHubRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for [HubService.UpdateHub][google.cloud.networkconnectivity.v1alpha1.HubService.UpdateHub] method.
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest) + com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_UpdateHubRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_UpdateHubRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest.class, + com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + if (hubBuilder_ == null) { + hub_ = null; + } else { + hub_ = null; + hubBuilder_ = null; + } + requestId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_UpdateHubRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest + getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest build() { + com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest buildPartial() { + com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest result = + new com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest(this); + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + if (hubBuilder_ == null) { + result.hub_ = hub_; + } else { + result.hub_ = hubBuilder_.build(); + } + result.requestId_ = requestId_; + 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.networkconnectivity.v1alpha1.UpdateHubRequest) { + return mergeFrom((com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest other) { + if (other + == com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasHub()) { + mergeHub(other.getHub()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + 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.networkconnectivity.v1alpha1.UpdateHubRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Hub resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Hub resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Hub resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Hub resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Hub resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Hub resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Hub resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Hub resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Hub resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.cloud.networkconnectivity.v1alpha1.Hub hub_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1alpha1.Hub, + com.google.cloud.networkconnectivity.v1alpha1.Hub.Builder, + com.google.cloud.networkconnectivity.v1alpha1.HubOrBuilder> + hubBuilder_; + /** + * + * + *
+     * Required. The state that the Hub should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the hub field is set. + */ + public boolean hasHub() { + return hubBuilder_ != null || hub_ != null; + } + /** + * + * + *
+     * Required. The state that the Hub should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The hub. + */ + public com.google.cloud.networkconnectivity.v1alpha1.Hub getHub() { + if (hubBuilder_ == null) { + return hub_ == null + ? com.google.cloud.networkconnectivity.v1alpha1.Hub.getDefaultInstance() + : hub_; + } else { + return hubBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The state that the Hub should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setHub(com.google.cloud.networkconnectivity.v1alpha1.Hub value) { + if (hubBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + hub_ = value; + onChanged(); + } else { + hubBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The state that the Hub should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setHub( + com.google.cloud.networkconnectivity.v1alpha1.Hub.Builder builderForValue) { + if (hubBuilder_ == null) { + hub_ = builderForValue.build(); + onChanged(); + } else { + hubBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The state that the Hub should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeHub(com.google.cloud.networkconnectivity.v1alpha1.Hub value) { + if (hubBuilder_ == null) { + if (hub_ != null) { + hub_ = + com.google.cloud.networkconnectivity.v1alpha1.Hub.newBuilder(hub_) + .mergeFrom(value) + .buildPartial(); + } else { + hub_ = value; + } + onChanged(); + } else { + hubBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The state that the Hub should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearHub() { + if (hubBuilder_ == null) { + hub_ = null; + onChanged(); + } else { + hub_ = null; + hubBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The state that the Hub should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networkconnectivity.v1alpha1.Hub.Builder getHubBuilder() { + + onChanged(); + return getHubFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The state that the Hub should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networkconnectivity.v1alpha1.HubOrBuilder getHubOrBuilder() { + if (hubBuilder_ != null) { + return hubBuilder_.getMessageOrBuilder(); + } else { + return hub_ == null + ? com.google.cloud.networkconnectivity.v1alpha1.Hub.getDefaultInstance() + : hub_; + } + } + /** + * + * + *
+     * Required. The state that the Hub should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1alpha1.Hub, + com.google.cloud.networkconnectivity.v1alpha1.Hub.Builder, + com.google.cloud.networkconnectivity.v1alpha1.HubOrBuilder> + getHubFieldBuilder() { + if (hubBuilder_ == null) { + hubBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1alpha1.Hub, + com.google.cloud.networkconnectivity.v1alpha1.Hub.Builder, + com.google.cloud.networkconnectivity.v1alpha1.HubOrBuilder>( + getHub(), getParentForChildren(), isClean()); + hub_ = null; + } + return hubBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + @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.networkconnectivity.v1alpha1.UpdateHubRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest) + private static final com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest(); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateHubRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateHubRequest(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.networkconnectivity.v1alpha1.UpdateHubRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/UpdateHubRequestOrBuilder.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/UpdateHubRequestOrBuilder.java new file mode 100644 index 00000000..1a2cf0c6 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/UpdateHubRequestOrBuilder.java @@ -0,0 +1,161 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +public interface UpdateHubRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1alpha1.UpdateHubRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Hub resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Hub resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Hub resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The state that the Hub should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the hub field is set. + */ + boolean hasHub(); + /** + * + * + *
+   * Required. The state that the Hub should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The hub. + */ + com.google.cloud.networkconnectivity.v1alpha1.Hub getHub(); + /** + * + * + *
+   * Required. The state that the Hub should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.networkconnectivity.v1alpha1.HubOrBuilder getHubOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/UpdateSpokeRequest.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/UpdateSpokeRequest.java new file mode 100644 index 00000000..351e47b6 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/UpdateSpokeRequest.java @@ -0,0 +1,1349 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +/** + * + * + *
+ * Request for [HubService.UpdateSpoke][google.cloud.networkconnectivity.v1alpha1.HubService.UpdateSpoke] method.
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest} + */ +public final class UpdateSpokeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest) + UpdateSpokeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateSpokeRequest.newBuilder() to construct. + private UpdateSpokeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateSpokeRequest() { + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateSpokeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateSpokeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder subBuilder = null; + if (spoke_ != null) { + subBuilder = spoke_.toBuilder(); + } + spoke_ = + input.readMessage( + com.google.cloud.networkconnectivity.v1alpha1.Spoke.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(spoke_); + spoke_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = 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.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_UpdateSpokeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_UpdateSpokeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest.class, + com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Spoke resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Spoke resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Spoke resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int SPOKE_FIELD_NUMBER = 2; + private com.google.cloud.networkconnectivity.v1alpha1.Spoke spoke_; + /** + * + * + *
+   * Required. The state that the Spoke should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the spoke field is set. + */ + @java.lang.Override + public boolean hasSpoke() { + return spoke_ != null; + } + /** + * + * + *
+   * Required. The state that the Spoke should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The spoke. + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.Spoke getSpoke() { + return spoke_ == null + ? com.google.cloud.networkconnectivity.v1alpha1.Spoke.getDefaultInstance() + : spoke_; + } + /** + * + * + *
+   * Required. The state that the Spoke should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder getSpokeOrBuilder() { + return getSpoke(); + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (spoke_ != null) { + output.writeMessage(2, getSpoke()); + } + if (!getRequestIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (spoke_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSpoke()); + } + if (!getRequestIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + 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.networkconnectivity.v1alpha1.UpdateSpokeRequest)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest other = + (com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasSpoke() != other.hasSpoke()) return false; + if (hasSpoke()) { + if (!getSpoke().equals(other.getSpoke())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasSpoke()) { + hash = (37 * hash) + SPOKE_FIELD_NUMBER; + hash = (53 * hash) + getSpoke().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest 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.networkconnectivity.v1alpha1.UpdateSpokeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest 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.networkconnectivity.v1alpha1.UpdateSpokeRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest 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.networkconnectivity.v1alpha1.UpdateSpokeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest 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.networkconnectivity.v1alpha1.UpdateSpokeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest 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.networkconnectivity.v1alpha1.UpdateSpokeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for [HubService.UpdateSpoke][google.cloud.networkconnectivity.v1alpha1.HubService.UpdateSpoke] method.
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest) + com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_UpdateSpokeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_UpdateSpokeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest.class, + com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + if (spokeBuilder_ == null) { + spoke_ = null; + } else { + spoke_ = null; + spokeBuilder_ = null; + } + requestId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1alpha1.HubProto + .internal_static_google_cloud_networkconnectivity_v1alpha1_UpdateSpokeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest + getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest build() { + com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest buildPartial() { + com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest result = + new com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest(this); + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + if (spokeBuilder_ == null) { + result.spoke_ = spoke_; + } else { + result.spoke_ = spokeBuilder_.build(); + } + result.requestId_ = requestId_; + 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.networkconnectivity.v1alpha1.UpdateSpokeRequest) { + return mergeFrom((com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest other) { + if (other + == com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasSpoke()) { + mergeSpoke(other.getSpoke()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + 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.networkconnectivity.v1alpha1.UpdateSpokeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Spoke resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Spoke resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Spoke resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Spoke resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Spoke resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Spoke resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Spoke resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Spoke resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * Spoke resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.cloud.networkconnectivity.v1alpha1.Spoke spoke_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1alpha1.Spoke, + com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder, + com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder> + spokeBuilder_; + /** + * + * + *
+     * Required. The state that the Spoke should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the spoke field is set. + */ + public boolean hasSpoke() { + return spokeBuilder_ != null || spoke_ != null; + } + /** + * + * + *
+     * Required. The state that the Spoke should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The spoke. + */ + public com.google.cloud.networkconnectivity.v1alpha1.Spoke getSpoke() { + if (spokeBuilder_ == null) { + return spoke_ == null + ? com.google.cloud.networkconnectivity.v1alpha1.Spoke.getDefaultInstance() + : spoke_; + } else { + return spokeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The state that the Spoke should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSpoke(com.google.cloud.networkconnectivity.v1alpha1.Spoke value) { + if (spokeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + spoke_ = value; + onChanged(); + } else { + spokeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The state that the Spoke should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSpoke( + com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder builderForValue) { + if (spokeBuilder_ == null) { + spoke_ = builderForValue.build(); + onChanged(); + } else { + spokeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The state that the Spoke should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSpoke(com.google.cloud.networkconnectivity.v1alpha1.Spoke value) { + if (spokeBuilder_ == null) { + if (spoke_ != null) { + spoke_ = + com.google.cloud.networkconnectivity.v1alpha1.Spoke.newBuilder(spoke_) + .mergeFrom(value) + .buildPartial(); + } else { + spoke_ = value; + } + onChanged(); + } else { + spokeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The state that the Spoke should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSpoke() { + if (spokeBuilder_ == null) { + spoke_ = null; + onChanged(); + } else { + spoke_ = null; + spokeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The state that the Spoke should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder getSpokeBuilder() { + + onChanged(); + return getSpokeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The state that the Spoke should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder getSpokeOrBuilder() { + if (spokeBuilder_ != null) { + return spokeBuilder_.getMessageOrBuilder(); + } else { + return spoke_ == null + ? com.google.cloud.networkconnectivity.v1alpha1.Spoke.getDefaultInstance() + : spoke_; + } + } + /** + * + * + *
+     * Required. The state that the Spoke should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1alpha1.Spoke, + com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder, + com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder> + getSpokeFieldBuilder() { + if (spokeBuilder_ == null) { + spokeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1alpha1.Spoke, + com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder, + com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder>( + getSpoke(), getParentForChildren(), isClean()); + spoke_ = null; + } + return spokeBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique request ID
+     * so that if you must retry your request, the server will know to ignore
+     * the request if it has already been completed. The server will guarantee
+     * that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + @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.networkconnectivity.v1alpha1.UpdateSpokeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest) + private static final com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest(); + } + + public static com.google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateSpokeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateSpokeRequest(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.networkconnectivity.v1alpha1.UpdateSpokeRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/UpdateSpokeRequestOrBuilder.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/UpdateSpokeRequestOrBuilder.java new file mode 100644 index 00000000..122c9f80 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/UpdateSpokeRequestOrBuilder.java @@ -0,0 +1,161 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/networkconnectivity/v1alpha1/hub.proto + +package com.google.cloud.networkconnectivity.v1alpha1; + +public interface UpdateSpokeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1alpha1.UpdateSpokeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Spoke resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Spoke resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * Spoke resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The state that the Spoke should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the spoke field is set. + */ + boolean hasSpoke(); + /** + * + * + *
+   * Required. The state that the Spoke should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The spoke. + */ + com.google.cloud.networkconnectivity.v1alpha1.Spoke getSpoke(); + /** + * + * + *
+   * Required. The state that the Spoke should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1alpha1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder getSpokeOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique request ID
+   * so that if you must retry your request, the server will know to ignore
+   * the request if it has already been completed. The server will guarantee
+   * that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/VpnTunnelName.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/VpnTunnelName.java new file mode 100644 index 00000000..66fd97be --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/VpnTunnelName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.networkconnectivity.v1alpha1; + +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; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class VpnTunnelName implements ResourceName { + private static final PathTemplate PROJECT_REGION_RESOURCE_ID = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/regions/{region}/vpnTunnels/{resource_id}"); + private volatile Map fieldValuesMap; + private final String project; + private final String region; + private final String resourceId; + + @Deprecated + protected VpnTunnelName() { + project = null; + region = null; + resourceId = null; + } + + private VpnTunnelName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + region = Preconditions.checkNotNull(builder.getRegion()); + resourceId = Preconditions.checkNotNull(builder.getResourceId()); + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + public String getResourceId() { + return resourceId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static VpnTunnelName of(String project, String region, String resourceId) { + return newBuilder().setProject(project).setRegion(region).setResourceId(resourceId).build(); + } + + public static String format(String project, String region, String resourceId) { + return newBuilder() + .setProject(project) + .setRegion(region) + .setResourceId(resourceId) + .build() + .toString(); + } + + public static VpnTunnelName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_REGION_RESOURCE_ID.validatedMatch( + formattedString, "VpnTunnelName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("region"), matchMap.get("resource_id")); + } + + 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 (VpnTunnelName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_REGION_RESOURCE_ID.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (region != null) { + fieldMapBuilder.put("region", region); + } + if (resourceId != null) { + fieldMapBuilder.put("resource_id", resourceId); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_REGION_RESOURCE_ID.instantiate( + "project", project, "region", region, "resource_id", resourceId); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + VpnTunnelName that = ((VpnTunnelName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.region, that.region) + && Objects.equals(this.resourceId, that.resourceId); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(region); + h *= 1000003; + h ^= Objects.hashCode(resourceId); + return h; + } + + /** Builder for projects/{project}/regions/{region}/vpnTunnels/{resource_id}. */ + public static class Builder { + private String project; + private String region; + private String resourceId; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + public String getResourceId() { + return resourceId; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public Builder setResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + private Builder(VpnTunnelName vpnTunnelName) { + project = vpnTunnelName.project; + region = vpnTunnelName.region; + resourceId = vpnTunnelName.resourceId; + } + + public VpnTunnelName build() { + return new VpnTunnelName(this); + } + } +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/proto/google/cloud/networkconnectivity/v1alpha1/common.proto b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/proto/google/cloud/networkconnectivity/v1alpha1/common.proto new file mode 100644 index 00000000..fbf806af --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/proto/google/cloud/networkconnectivity/v1alpha1/common.proto @@ -0,0 +1,53 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.networkconnectivity.v1alpha1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/networkconnectivity/v1alpha1;networkconnectivity"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.cloud.networkconnectivity.v1alpha1"; + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/proto/google/cloud/networkconnectivity/v1alpha1/hub.proto b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/proto/google/cloud/networkconnectivity/v1alpha1/hub.proto new file mode 100644 index 00000000..970559cb --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/proto/google/cloud/networkconnectivity/v1alpha1/hub.proto @@ -0,0 +1,525 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.networkconnectivity.v1alpha1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/networkconnectivity/v1alpha1;networkconnectivity"; +option java_multiple_files = true; +option java_outer_classname = "HubProto"; +option java_package = "com.google.cloud.networkconnectivity.v1alpha1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/VpnTunnel" + pattern: "projects/{project}/regions/{region}/vpnTunnels/{resource_id}" +}; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/InterconnectAttachment" + pattern: "projects/{project}/regions/{region}/interconnectAttachments/{resource_id}" +}; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Instance" + pattern: "projects/{project}/zones/{zone}/instances/{instance}" +}; + +// Connectivity Hub is a hub-and-spoke abstraction for network connectivity +// management in Google Cloud. The Hub aims to reduce operational complexity +// through a simple, centralized connectivity management model. +service HubService { + option (google.api.default_host) = "networkconnectivity.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Hubs in a given project and location. + rpc ListHubs(ListHubsRequest) returns (ListHubsResponse) { + option (google.api.http) = { + get: "/v1alpha1/{parent=projects/*/locations/global}/hubs" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Hub. + rpc GetHub(GetHubRequest) returns (Hub) { + option (google.api.http) = { + get: "/v1alpha1/{name=projects/*/locations/global/hubs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Hub in a given project and location. + rpc CreateHub(CreateHubRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha1/{parent=projects/*/locations/global}/hubs" + body: "hub" + }; + option (google.api.method_signature) = "parent,hub,hub_id"; + option (google.longrunning.operation_info) = { + response_type: "Hub" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Hub. + rpc UpdateHub(UpdateHubRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha1/{hub.name=projects/*/locations/global/hubs/*}" + body: "hub" + }; + option (google.api.method_signature) = "hub,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Hub" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Hub. + rpc DeleteHub(DeleteHubRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha1/{name=projects/*/locations/global/hubs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists Spokes in a given project and location. + rpc ListSpokes(ListSpokesRequest) returns (ListSpokesResponse) { + option (google.api.http) = { + get: "/v1alpha1/{parent=projects/*/locations/*}/spokes" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Spoke. + rpc GetSpoke(GetSpokeRequest) returns (Spoke) { + option (google.api.http) = { + get: "/v1alpha1/{name=projects/*/locations/*/spokes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Spoke in a given project and location. + rpc CreateSpoke(CreateSpokeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha1/{parent=projects/*/locations/*}/spokes" + body: "spoke" + }; + option (google.api.method_signature) = "parent,spoke,spoke_id"; + option (google.longrunning.operation_info) = { + response_type: "Spoke" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Spoke. + rpc UpdateSpoke(UpdateSpokeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha1/{spoke.name=projects/*/locations/*/spokes/*}" + body: "spoke" + }; + option (google.api.method_signature) = "spoke,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Spoke" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Spoke. + rpc DeleteSpoke(DeleteSpokeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha1/{name=projects/*/locations/*/spokes/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } +} + +// The Connectivity Hub is a hub-and-spoke abstraction for network connectivity +// management in Google Cloud. It aims to reduce operational complexity +// through a simple, centralized connectivity management model. Here is the +// resource message of a Hub. +message Hub { + option (google.api.resource) = { + type: "networkconnectivity.googleapis.com/Hub" + pattern: "projects/{project}/locations/global/hubs/{hub}" + }; + + // Immutable. The name of a Hub resource. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Time when the Hub was created. + google.protobuf.Timestamp create_time = 2; + + // Time when the Hub was updated. + google.protobuf.Timestamp update_time = 3; + + // User-defined labels. + map labels = 4; + + // Short description of the hub resource. + string description = 5; + + // Output only. A list of the URIs of all attached spokes + repeated string spokes = 6 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/Spoke" + } + ]; + + // Output only. Google-generated UUID for this resource. This is unique across all Hub + // resources. If a Hub resource is deleted and another with the same name is + // created, it gets a different unique_id. + string unique_id = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A Spoke is an abstraction of a network attachment being attached +// to a Hub. A Spoke can be underlying a VPN tunnel, a +// VLAN (interconnect) attachment, a Router appliance, etc. +message Spoke { + option (google.api.resource) = { + type: "networkconnectivity.googleapis.com/Spoke" + pattern: "projects/{project}/locations/{location}/spokes/{spoke}" + }; + + // Immutable. The name of a Spoke resource. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // The time when the Spoke was created. + google.protobuf.Timestamp create_time = 2; + + // The time when the Spoke was updated. + google.protobuf.Timestamp update_time = 3; + + // User-defined labels. + map labels = 4; + + // Short description of the spoke resource + string description = 5; + + // The resource URL of the hub resource that the spoke is attached to + string hub = 6 [(google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/Hub" + }]; + + // The URIs of linked VPN tunnel resources + repeated string linked_vpn_tunnels = 12 [(google.api.resource_reference) = { + type: "compute.googleapis.com/VpnTunnel" + }]; + + // The URIs of linked interconnect attachment resources + repeated string linked_interconnect_attachments = 13 [(google.api.resource_reference) = { + type: "compute.googleapis.com/InterconnectAttachment" + }]; + + // The URIs of linked Router appliance resources + repeated RouterApplianceInstance linked_router_appliance_instances = 14; + + // Output only. Google-generated UUID for this resource. This is unique across all Spoke + // resources. If a Spoke resource is deleted and another with the same name is + // created, it gets a different unique_id. + string unique_id = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request for [HubService.ListHubs][google.cloud.networkconnectivity.v1alpha1.HubService.ListHubs] method. +message ListHubsRequest { + // Required. The parent resource's name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of results per page that should be returned. + int32 page_size = 2; + + // The page token. + string page_token = 3; + + // A filter expression that filters the results listed in the response. + string filter = 4; + + // Sort the results by a certain order. + string order_by = 5; +} + +// Response for [HubService.ListHubs][google.cloud.networkconnectivity.v1alpha1.HubService.ListHubs] method. +message ListHubsResponse { + // Hubs to be returned. + repeated Hub hubs = 1; + + // The next pagination token in the List response. It should be used as + // page_token for the following request. An empty value means no more result. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request for [HubService.GetHub][google.cloud.networkconnectivity.v1alpha1.HubService.GetHub] method. +message GetHubRequest { + // Required. Name of the Hub resource to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/Hub" + } + ]; +} + +// Request for [HubService.CreateHub][google.cloud.networkconnectivity.v1alpha1.HubService.CreateHub] method. +message CreateHubRequest { + // Required. The parent resource's name of the Hub. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. Unique id for the Hub to create. + string hub_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Initial values for a new Hub. + Hub hub = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for [HubService.UpdateHub][google.cloud.networkconnectivity.v1alpha1.HubService.UpdateHub] method. +message UpdateHubRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // Hub resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The state that the Hub should be in after the update. + Hub hub = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request for [HubService.DeleteHub][google.cloud.networkconnectivity.v1alpha1.HubService.DeleteHub]. +message DeleteHubRequest { + // Required. The name of the Hub to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/Hub" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request for [HubService.ListSpokes][google.cloud.networkconnectivity.v1alpha1.HubService.ListSpokes]. +message ListSpokesRequest { + // Required. The parent's resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of results per page that should be returned. + int32 page_size = 2; + + // The page token. + string page_token = 3; + + // A filter expression that filters the results listed in the response. + string filter = 4; + + // Sort the results by a certain order. + string order_by = 5; +} + +// The response for [HubService.ListSpokes][google.cloud.networkconnectivity.v1alpha1.HubService.ListSpokes]. +message ListSpokesResponse { + // Spokes to be returned. + repeated Spoke spokes = 1; + + // The next pagination token in the List response. It should be used as + // page_token for the following request. An empty value means no more result. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// The request for [HubService.GetSpoke][google.cloud.networkconnectivity.v1alpha1.HubService.GetSpoke]. +message GetSpokeRequest { + // Required. The name of Spoke resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/Spoke" + } + ]; +} + +// The request for [HubService.CreateSpoke][google.cloud.networkconnectivity.v1alpha1.HubService.CreateSpoke]. +message CreateSpokeRequest { + // Required. The parent's resource name of the Spoke. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. Unique id for the Spoke to create. + string spoke_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Initial values for a new Hub. + Spoke spoke = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for [HubService.UpdateSpoke][google.cloud.networkconnectivity.v1alpha1.HubService.UpdateSpoke] method. +message UpdateSpokeRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // Spoke resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The state that the Spoke should be in after the update. + Spoke spoke = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request for [HubService.DeleteSpoke][google.cloud.networkconnectivity.v1alpha1.HubService.DeleteSpoke]. +message DeleteSpokeRequest { + // Required. The name of the Spoke to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/Spoke" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// RouterAppliance represents a Router appliance which is specified by a VM URI +// and a NIC address. +message RouterApplianceInstance { + // The URI of the virtual machine resource + string virtual_machine = 1 [(google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + }]; + + // The IP address of the network interface to use for peering. + string ip_address = 3; + + string network_interface = 2 [deprecated = true]; +} diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..b9919979 --- /dev/null +++ b/renovate.json @@ -0,0 +1,73 @@ +{ + "extends": [ + ":separateMajorReleases", + ":combinePatchMinorReleases", + ":ignoreUnstable", + ":prImmediately", + ":updateNotScheduled", + ":automergeDisabled", + ":ignoreModulesAndTests", + ":maintainLockFilesDisabled", + ":autodetectPinVersions" + ], + "packageRules": [ + { + "packagePatterns": [ + "^com.google.guava:" + ], + "versionScheme": "docker" + }, + { + "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-networkconnectivity", + "^com.google.cloud:libraries-bom", + "^com.google.cloud.samples:shared-configuration" + ], + "semanticCommitType": "chore", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^junit:junit", + "^com.google.truth:truth", + "^org.mockito:mockito-core", + "^org.objenesis:objenesis" + ], + "semanticCommitType": "test", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-" + ], + "ignoreUnstable": false + }, + { + "packagePatterns": [ + "^com.fasterxml.jackson.core" + ], + "groupName": "jackson dependencies" + } + ], + "semanticCommits": true, + "masterIssue": true +} diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml new file mode 100644 index 00000000..718bf776 --- /dev/null +++ b/samples/install-without-bom/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + com.google.cloud + networkconnectivity-install-without-bom + jar + Google Network Connectivity Center Install Without Bom + https://github.com/googleapis/java-networkconnectivity + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + google-cloud-networkconnectivity + 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..270c3c91 --- /dev/null +++ b/samples/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud-networkconnectivity-samples + 0.0.1-SNAPSHOT + pom + Google Network Connectivity Center Samples Parent + https://github.com/googleapis/java-networkconnectivity + + Java idiomatic client for Google Cloud Platform services. + + + + + com.google.cloud.samples + shared-configuration + 1.0.18 + + + + 1.8 + 1.8 + UTF-8 + + + + install-without-bom + snapshot + snippets + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.8 + + true + + + + + diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml new file mode 100644 index 00000000..1a22f8d7 --- /dev/null +++ b/samples/snapshot/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + com.google.cloud + networkconnectivity-snapshot + jar + Google Network Connectivity Center Snapshot Samples + https://github.com/googleapis/java-networkconnectivity + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-networkconnectivity + 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..881acd71 --- /dev/null +++ b/samples/snippets/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + com.google.cloud + networkconnectivity-snippets + jar + Google Network Connectivity Center Snippets + https://github.com/googleapis/java-networkconnectivity + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-networkconnectivity + 0.0.0 + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + diff --git a/synth.metadata b/synth.metadata new file mode 100644 index 00000000..24f367ad --- /dev/null +++ b/synth.metadata @@ -0,0 +1,37 @@ +{ + "sources": [ + { + "git": { + "name": ".", + "remote": "sso://devrel/cloud/libraries/java/repo-splitter", + "sha": "969e04ee2cb1154fa535e0f2104ad06d36d00667" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "f1b2cc9c37f453c3b15e8945af32812f71634022", + "internalRef": "351867503" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "16ec872dd898d7de6e1822badfac32484b5d9031" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "networkconnectivity", + "apiVersion": "v1alpha1", + "language": "java", + "generator": "bazel" + } + } + ] +} \ No newline at end of file diff --git a/synth.py b/synth.py new file mode 100644 index 00000000..ebce0a2c --- /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 = 'networkconnectivity' +versions = ['v1alpha1'] + +for version in versions: + java.bazel_library( + service=service, + version=version, + proto_path=f'google/cloud/{service}/{version}', + bazel_target=f'//google/cloud/{service}/{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..e501afee --- /dev/null +++ b/versions.txt @@ -0,0 +1,6 @@ +# Format: +# module:released-version:current-version + +google-cloud-networkconnectivity:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-networkconnectivity-v1alpha1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-networkconnectivity-v1alpha1:0.0.0:0.0.1-SNAPSHOT \ No newline at end of file