diff --git a/java-beyondcorp-appconnections/.github/.OwlBot.lock.yaml b/java-beyondcorp-appconnections/.github/.OwlBot.lock.yaml new file mode 100644 index 000000000000..8218fd869c27 --- /dev/null +++ b/java-beyondcorp-appconnections/.github/.OwlBot.lock.yaml @@ -0,0 +1,16 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +docker: + digest: sha256:7a9a7eb50ca2af5bfffab3abd2f38d408735c990a74bacf9b7fde2af0a086a0b + image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest \ No newline at end of file diff --git a/java-beyondcorp-appconnections/.github/.OwlBot.yaml b/java-beyondcorp-appconnections/.github/.OwlBot.yaml new file mode 100644 index 000000000000..01653951744c --- /dev/null +++ b/java-beyondcorp-appconnections/.github/.OwlBot.yaml @@ -0,0 +1,32 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +docker: + image: "gcr.io/cloud-devrel-public-resources/owlbot-java:latest" + +deep-remove-regex: +- "/grpc-google-.*/src" +- "/proto-google-.*/src" +- "/google-.*/src" + +deep-preserve-regex: +- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/cloud/beyondcorp/appconnections/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/$1/proto-google-cloud-beyondcorp-appconnections-$1/src" +- source: "/google/cloud/beyondcorp/appconnections/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/$1/grpc-google-cloud-beyondcorp-appconnections-$1/src" +- source: "/google/cloud/beyondcorp/appconnections/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/$1/google-cloud-beyondcorp-appconnections/src" diff --git a/java-beyondcorp-appconnections/.github/CODEOWNERS b/java-beyondcorp-appconnections/.github/CODEOWNERS new file mode 100644 index 000000000000..30fdb7b9c8f7 --- /dev/null +++ b/java-beyondcorp-appconnections/.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/java-beyondcorp-appconnections/.github/ISSUE_TEMPLATE/bug_report.md b/java-beyondcorp-appconnections/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000000..4d30f5a50567 --- /dev/null +++ b/java-beyondcorp-appconnections/.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-beyondcorp-appconnections/issues + - Check for answers on StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform + +If you are still having issues, please include as much information as possible: + +#### Environment details + +1. Specify the API at the beginning of the title. For example, "BigQuery: ..."). + General, Core, and Other are also allowed as types +2. OS type and version: +3. Java version: +4. version(s): + +#### Steps to reproduce + + 1. ? + 2. ? + +#### Code example + +```java +// example +``` + +#### Stack trace +``` +Any relevant stacktrace here. +``` + +#### External references such as API reference guides + +- ? + +#### Any additional information below + + +Following these steps guarantees the quickest resolution possible. + +Thanks! diff --git a/java-beyondcorp-appconnections/.github/ISSUE_TEMPLATE/feature_request.md b/java-beyondcorp-appconnections/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000000..754e30c68a00 --- /dev/null +++ b/java-beyondcorp-appconnections/.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/java-beyondcorp-appconnections/.github/ISSUE_TEMPLATE/support_request.md b/java-beyondcorp-appconnections/.github/ISSUE_TEMPLATE/support_request.md new file mode 100644 index 000000000000..995869032125 --- /dev/null +++ b/java-beyondcorp-appconnections/.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/java-beyondcorp-appconnections/.github/PULL_REQUEST_TEMPLATE.md b/java-beyondcorp-appconnections/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000000..cc7d59807cf3 --- /dev/null +++ b/java-beyondcorp-appconnections/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,10 @@ +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-beyondcorp-appconnections/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea +- [ ] Ensure the tests and linter pass +- [ ] Code coverage does not decrease (if any source code was changed) +- [ ] Appropriate docs were updated (if necessary) + +Fixes # ☕️ + +If you write sample code, please follow the [samples format]( +https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md). diff --git a/java-beyondcorp-appconnections/.github/auto-label.yaml b/java-beyondcorp-appconnections/.github/auto-label.yaml new file mode 100644 index 000000000000..4caef688b745 --- /dev/null +++ b/java-beyondcorp-appconnections/.github/auto-label.yaml @@ -0,0 +1,15 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +requestsize: + enabled: true diff --git a/java-beyondcorp-appconnections/.github/blunderbuss.yml b/java-beyondcorp-appconnections/.github/blunderbuss.yml new file mode 100644 index 000000000000..2176b0543214 --- /dev/null +++ b/java-beyondcorp-appconnections/.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/main/packages/blunderbuss +assign_prs_by: +- labels: + - samples + to: + - googleapis/java-samples-reviewers \ No newline at end of file diff --git a/java-beyondcorp-appconnections/.github/generated-files-bot.yml b/java-beyondcorp-appconnections/.github/generated-files-bot.yml new file mode 100644 index 000000000000..c644a24e1129 --- /dev/null +++ b/java-beyondcorp-appconnections/.github/generated-files-bot.yml @@ -0,0 +1,12 @@ +externalManifests: +- type: json + file: 'synth.metadata' + jsonpath: '$.generatedFiles[*]' +- type: json + file: '.github/readme/synth.metadata/synth.metadata' + jsonpath: '$.generatedFiles[*]' +ignoreAuthors: +- 'renovate-bot' +- 'yoshi-automation' +- 'release-please[bot]' +- 'gcf-owl-bot[bot]' diff --git a/java-beyondcorp-appconnections/.github/release-please.yml b/java-beyondcorp-appconnections/.github/release-please.yml new file mode 100644 index 000000000000..8ca7f9cabc29 --- /dev/null +++ b/java-beyondcorp-appconnections/.github/release-please.yml @@ -0,0 +1,3 @@ +bumpMinorPreMajor: true +handleGHRelease: true +releaseType: java-yoshi diff --git a/java-beyondcorp-appconnections/.github/release-trigger.yml b/java-beyondcorp-appconnections/.github/release-trigger.yml new file mode 100644 index 000000000000..d4ca94189e16 --- /dev/null +++ b/java-beyondcorp-appconnections/.github/release-trigger.yml @@ -0,0 +1 @@ +enabled: true diff --git a/java-beyondcorp-appconnections/.github/snippet-bot.yml b/java-beyondcorp-appconnections/.github/snippet-bot.yml new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/java-beyondcorp-appconnections/.github/sync-repo-settings.yaml b/java-beyondcorp-appconnections/.github/sync-repo-settings.yaml new file mode 100644 index 000000000000..72acb9d8fa25 --- /dev/null +++ b/java-beyondcorp-appconnections/.github/sync-repo-settings.yaml @@ -0,0 +1,63 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Whether or not rebase-merging is enabled on this repository. +# Defaults to `true` +rebaseMergeAllowed: false + +# Whether or not squash-merging is enabled on this repository. +# Defaults to `true` +squashMergeAllowed: true + +# Whether or not PRs are merged with a merge commit on this repository. +# Defaults to `false` +mergeCommitAllowed: false + +# Rules for main branch protection +branchProtectionRules: +# Identifies the protection rule pattern. Name of the branch to be protected. +# Defaults to `main` +- pattern: main + # Can admins overwrite branch protection. + # Defaults to `true` + isAdminEnforced: true + # Number of approving reviews required to update matching branches. + # Defaults to `1` + requiredApprovingReviewCount: 1 + # Are reviews from code owners required to update matching branches. + # Defaults to `false` + requiresCodeOwnerReviews: true + # Require up to date branches + requiresStrictStatusChecks: false + # List of required status check contexts that must pass for commits to be accepted to matching branches. + requiredStatusCheckContexts: + - "dependencies (11)" + - "lint" + - "units (8)" + - "units (11)" + - "Kokoro - Test: Integration" + - "cla/google" + - "OwlBot Post Processor" + - "Kokoro - Test: Java GraalVM Native Image" + - "Kokoro - Test: Java 17 GraalVM Native Image" +# List of explicit permissions to add (additive only) +permissionRules: +- team: yoshi-admins + permission: admin +- team: yoshi-java-admins + permission: admin +- team: yoshi-java + permission: push +- team: java-samples-reviewers + permission: push + diff --git a/java-beyondcorp-appconnections/.github/trusted-contribution.yml b/java-beyondcorp-appconnections/.github/trusted-contribution.yml new file mode 100644 index 000000000000..a0ba1f7d9078 --- /dev/null +++ b/java-beyondcorp-appconnections/.github/trusted-contribution.yml @@ -0,0 +1,3 @@ +trustedContributors: +- renovate-bot +- gcf-owl-bot[bot] diff --git a/java-beyondcorp-appconnections/.github/workflows/approve-readme.yaml b/java-beyondcorp-appconnections/.github/workflows/approve-readme.yaml new file mode 100644 index 000000000000..f5fc7d5169eb --- /dev/null +++ b/java-beyondcorp-appconnections/.github/workflows/approve-readme.yaml @@ -0,0 +1,69 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Github action job to test core java library features on +# downstream client libraries before they are released. +on: + pull_request: +name: auto-merge-readme +jobs: + approve: + runs-on: ubuntu-latest + if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme' + steps: + - uses: actions/github-script@v6 + with: + github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} + script: | + // only approve PRs from yoshi-automation + if (context.payload.pull_request.user.login !== "yoshi-automation") { + return; + } + + // only approve PRs like "chore: release " + if (!context.payload.pull_request.title === "chore: regenerate README") { + return; + } + + // only approve PRs with README.md and synth.metadata changes + const files = new Set( + ( + await github.paginate( + github.pulls.listFiles.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + }) + ) + ).map(file => file.filename) + ); + if (files.size != 2 || !files.has("README.md") || !files.has(".github/readme/synth.metadata/synth.metadata")) { + return; + } + + // approve README regeneration PR + await github.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Rubber stamped PR!', + pull_number: context.payload.pull_request.number, + event: 'APPROVE' + }); + + // attach automerge label + await github.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: ['automerge'] + }); diff --git a/java-beyondcorp-appconnections/.github/workflows/auto-release.yaml b/java-beyondcorp-appconnections/.github/workflows/auto-release.yaml new file mode 100644 index 000000000000..7a106d007edf --- /dev/null +++ b/java-beyondcorp-appconnections/.github/workflows/auto-release.yaml @@ -0,0 +1,103 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Github action job to test core java library features on +# downstream client libraries before they are released. +on: + pull_request: +name: auto-release +jobs: + approve: + runs-on: ubuntu-latest + if: contains(github.head_ref, 'release-please') + steps: + - uses: actions/github-script@v6 + with: + github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} + debug: true + script: | + // only approve PRs from release-please[bot] + if (context.payload.pull_request.user.login !== "release-please[bot]") { + return; + } + + // only approve PRs like "chore(main): release " + if ( !context.payload.pull_request.title.startsWith("chore(main): release") ) { + return; + } + + // only approve PRs with pom.xml and versions.txt changes + const filesPromise = github.rest.pulls.listFiles.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + }); + const changed_files = await github.paginate(filesPromise) + + if ( changed_files.length < 1 ) { + console.log( "Not proceeding since PR is empty!" ) + return; + } + + if ( !changed_files.some(v => v.filename.includes("pom")) || !changed_files.some(v => v.filename.includes("versions.txt")) ) { + console.log( "PR file changes do not have pom.xml or versions.txt -- something is wrong. PTAL!" ) + return; + } + + // trigger auto-release when + // 1) it is a SNAPSHOT release (auto-generated post regular release) + // 2) there are dependency updates only + // 3) there are no open dependency update PRs in this repo (to avoid multiple releases) + if ( + context.payload.pull_request.body.includes("Fix") || + context.payload.pull_request.body.includes("Build") || + context.payload.pull_request.body.includes("Documentation") || + context.payload.pull_request.body.includes("BREAKING CHANGES") || + context.payload.pull_request.body.includes("Features") + ) { + console.log( "Not auto-releasing since it is not a dependency-update-only release." ); + return; + } + + const promise = github.rest.pulls.list.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open' + }); + const open_pulls = await github.paginate(promise) + + if ( open_pulls.length > 1 && !context.payload.pull_request.title.includes("SNAPSHOT") ) { + for ( const pull of open_pulls ) { + if ( pull.title.startsWith("deps: update dependency") ) { + console.log( "Not auto-releasing yet since there are dependency update PRs open in this repo." ); + return; + } + } + } + + // approve release PR + await github.rest.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Rubber stamped release!', + pull_number: context.payload.pull_request.number, + event: 'APPROVE' + }); + + // attach kokoro:force-run and automerge labels + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: ['kokoro:force-run', 'automerge'] + }); diff --git a/java-beyondcorp-appconnections/.github/workflows/ci.yaml b/java-beyondcorp-appconnections/.github/workflows/ci.yaml new file mode 100644 index 000000000000..e3bb26e37719 --- /dev/null +++ b/java-beyondcorp-appconnections/.github/workflows/ci.yaml @@ -0,0 +1,89 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Github action job to test core java library features on +# downstream client libraries before they are released. +on: + push: + branches: + - main + pull_request: +name: ci +jobs: + units: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + java: [8, 11, 17] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: zulu + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: test + windows: + runs-on: windows-latest + steps: + - name: Support longpaths + run: git config --system core.longpaths true + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: zulu + java-version: 8 + - run: java -version + - run: .kokoro/build.bat + env: + JOB_TYPE: test + dependencies: + runs-on: ubuntu-latest + strategy: + matrix: + java: [8, 11, 17] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: zulu + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/dependencies.sh + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: zulu + java-version: 11 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: lint + clirr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: zulu + java-version: 8 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: clirr diff --git a/java-beyondcorp-appconnections/.github/workflows/samples.yaml b/java-beyondcorp-appconnections/.github/workflows/samples.yaml new file mode 100644 index 000000000000..912ed8b2b027 --- /dev/null +++ b/java-beyondcorp-appconnections/.github/workflows/samples.yaml @@ -0,0 +1,30 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Github action job to test core java library features on +# downstream client libraries before they are released. +on: + pull_request: +name: samples +jobs: + checkstyle: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: zulu + java-version: 8 + - name: Run checkstyle + run: mvn -P lint --quiet --batch-mode checkstyle:check + working-directory: samples/snippets diff --git a/java-beyondcorp-appconnections/.gitignore b/java-beyondcorp-appconnections/.gitignore new file mode 100644 index 000000000000..069d08fc73e8 --- /dev/null +++ b/java-beyondcorp-appconnections/.gitignore @@ -0,0 +1,17 @@ +# Maven +target/ + +# Eclipse +.classpath +.project +.settings + +# Intellij +*.iml +.idea/ + +# python utilities +*.pyc +__pycache__ + +.flattened-pom.xml diff --git a/java-beyondcorp-appconnections/.kokoro/build.bat b/java-beyondcorp-appconnections/.kokoro/build.bat new file mode 100644 index 000000000000..067cf4a4c489 --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/build.bat @@ -0,0 +1,18 @@ +:: Copyright 2022 Google LLC +:: +:: Licensed under the Apache License, Version 2.0 (the "License"); +:: you may not use this file except in compliance with the License. +:: You may obtain a copy of the License at +:: +:: http://www.apache.org/licenses/LICENSE-2.0 +:: +:: Unless required by applicable law or agreed to in writing, software +:: distributed under the License is distributed on an "AS IS" BASIS, +:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +:: See the License for the specific language governing permissions and +:: limitations under the License. +:: Github action job to test core java library features on +:: downstream client libraries before they are released. +:: See documentation in type-shell-output.bat + +"C:\Program Files\Git\bin\bash.exe" %~dp0build.sh diff --git a/java-beyondcorp-appconnections/.kokoro/build.sh b/java-beyondcorp-appconnections/.kokoro/build.sh new file mode 100755 index 000000000000..da704e8d2639 --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/build.sh @@ -0,0 +1,134 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Maven & Java version +mvn -version +echo ${JOB_TYPE} + +# attempt to install 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn install -B -V -ntp \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true \ + -T 1C + +# if GOOGLE_APPLICATION_CREDENTIALS is specified as a relative path, prepend Kokoro root directory onto it +if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then + export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS}) +fi + +RETURN_CODE=0 +set +e + +case ${JOB_TYPE} in +test) + mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true + RETURN_CODE=$? + ;; +lint) + mvn com.coveo:fmt-maven-plugin:check -B -ntp + RETURN_CODE=$? + ;; +javadoc) + mvn javadoc:javadoc javadoc:test-javadoc -B -ntp + RETURN_CODE=$? + ;; +integration) + mvn -B ${INTEGRATION_TEST_ARGS} \ + -ntp \ + -Penable-integration-tests \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + ;; +graalvm) + # Run Unit and Integration Tests with Native Image + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test + RETURN_CODE=$? + ;; +graalvm17) + # Run Unit and Integration Tests with Native Image + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test + RETURN_CODE=$? + ;; +samples) + SAMPLES_DIR=samples + # only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise. + if [[ ! -z ${KOKORO_GITHUB_PULL_REQUEST_NUMBER} ]] + then + SAMPLES_DIR=samples/snapshot + fi + + if [[ -f ${SAMPLES_DIR}/pom.xml ]] + then + for FILE in ${KOKORO_GFILE_DIR}/secret_manager/*-samples-secrets; do + [[ -f "$FILE" ]] || continue + source "$FILE" + done + + pushd ${SAMPLES_DIR} + mvn -B \ + -ntp \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + popd + else + echo "no sample pom.xml found - skipping sample tests" + fi + ;; +clirr) + mvn -B -ntp -Denforcer.skip=true clirr:check + RETURN_CODE=$? + ;; +*) + ;; +esac + +if [ "${REPORT_COVERAGE}" == "true" ] +then + bash ${KOKORO_GFILE_DIR}/codecov.sh +fi + +# fix output location of logs +bash .kokoro/coerce_logs.sh + +if [[ "${ENABLE_FLAKYBOT}" == "true" ]] +then + chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot + ${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-beyondcorp-appconnections +fi + +echo "exiting with ${RETURN_CODE}" +exit ${RETURN_CODE} diff --git a/java-beyondcorp-appconnections/.kokoro/coerce_logs.sh b/java-beyondcorp-appconnections/.kokoro/coerce_logs.sh new file mode 100755 index 000000000000..46edbf7f2fcd --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/coerce_logs.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This script finds and moves sponge logs so that they can be found by placer +# and are not flagged as flaky by sponge. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +job=$(basename ${KOKORO_JOB_NAME}) + +echo "coercing sponge logs..." +for xml in `find . -name *-sponge_log.xml` +do + class=$(basename ${xml} | cut -d- -f2) + dir=$(dirname ${xml})/${job}/${class} + text=$(dirname ${xml})/${class}-sponge_log.txt + mkdir -p ${dir} + mv ${xml} ${dir}/sponge_log.xml + mv ${text} ${dir}/sponge_log.txt +done diff --git a/java-beyondcorp-appconnections/.kokoro/common.cfg b/java-beyondcorp-appconnections/.kokoro/common.cfg new file mode 100644 index 000000000000..1140f985b2d5 --- /dev/null +++ b/java-beyondcorp-appconnections/.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-beyondcorp-appconnections/.kokoro/trampoline.sh" + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-appconnections/.kokoro/build.sh" +} diff --git a/java-beyondcorp-appconnections/.kokoro/common.sh b/java-beyondcorp-appconnections/.kokoro/common.sh new file mode 100644 index 000000000000..f8f957af1112 --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/common.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +function retry_with_backoff { + attempts_left=$1 + sleep_seconds=$2 + shift 2 + command=$@ + + + # store current flag state + flags=$- + + # allow a failures to continue + set +e + ${command} + exit_code=$? + + # restore "e" flag + if [[ ${flags} =~ e ]] + then set -e + else set +e + fi + + if [[ $exit_code == 0 ]] + then + return 0 + fi + + # failure + if [[ ${attempts_left} > 0 ]] + then + echo "failure (${exit_code}), sleeping ${sleep_seconds}..." + sleep ${sleep_seconds} + new_attempts=$((${attempts_left} - 1)) + new_sleep=$((${sleep_seconds} * 2)) + retry_with_backoff ${new_attempts} ${new_sleep} ${command} + fi + + return $exit_code +} + +## Helper functionss +function now() { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n'; } +function msg() { println "$*" >&2; } +function println() { printf '%s\n' "$(now) $*"; } + +## Helper comment to trigger updated repo dependency release \ No newline at end of file diff --git a/java-beyondcorp-appconnections/.kokoro/continuous/common.cfg b/java-beyondcorp-appconnections/.kokoro/continuous/common.cfg new file mode 100644 index 000000000000..f367fd0f946f --- /dev/null +++ b/java-beyondcorp-appconnections/.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-beyondcorp-appconnections/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-appconnections/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/java-beyondcorp-appconnections/.kokoro/continuous/java8.cfg b/java-beyondcorp-appconnections/.kokoro/continuous/java8.cfg new file mode 100644 index 000000000000..495cc7bacd63 --- /dev/null +++ b/java-beyondcorp-appconnections/.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/java-beyondcorp-appconnections/.kokoro/dependencies.sh b/java-beyondcorp-appconnections/.kokoro/dependencies.sh new file mode 100755 index 000000000000..d7476cfe9727 --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/dependencies.sh @@ -0,0 +1,110 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail +shopt -s nullglob + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Java +java -version +echo $JOB_TYPE + +function determineMavenOpts() { + local javaVersion=$( + # filter down to the version line, then pull out the version between quotes, + # then trim the version number down to its minimal number (removing any + # update or suffix number). + java -version 2>&1 | grep "version" \ + | sed -E 's/^.*"(.*?)".*$/\1/g' \ + | sed -E 's/^(1\.[0-9]\.0).*$/\1/g' + ) + + if [[ $javaVersion == 17* ]] + then + # MaxPermSize is no longer supported as of jdk 17 + echo -n "-Xmx1024m" + else + echo -n "-Xmx1024m -XX:MaxPermSize=128m" + fi +} + +export MAVEN_OPTS=$(determineMavenOpts) + +# this should run maven enforcer +retry_with_backoff 3 10 \ + mvn install -B -V -ntp \ + -DskipTests=true \ + -Dmaven.javadoc.skip=true \ + -Dclirr.skip=true + +mvn -B dependency:analyze -DfailOnWarning=true + +echo "****************** DEPENDENCY LIST COMPLETENESS CHECK *******************" +## Run dependency list completeness check +function completenessCheck() { + # Output dep list with compile scope generated using the original pom + # Running mvn dependency:list on Java versions that support modules will also include the module of the dependency. + # This is stripped from the output as it is not present in the flattened pom. + # Only dependencies with 'compile' or 'runtime' scope are included from original dependency list. + msg "Generating dependency list using original pom..." + mvn dependency:list -f pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e 's/ --.*//' >.org-list.txt + + # Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes) + msg "Generating dependency list using flattened pom..." + mvn dependency:list -f .flattened-pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt + + # Compare two dependency lists + msg "Comparing dependency lists..." + diff .org-list.txt .new-list.txt >.diff.txt + if [[ $? == 0 ]] + then + msg "Success. No diff!" + else + msg "Diff found. See below: " + msg "You can also check .diff.txt file located in $1." + cat .diff.txt + return 1 + fi +} + +# Allow failures to continue running the script +set +e + +error_count=0 +for path in **/.flattened-pom.xml +do + # Check flattened pom in each dir that contains it for completeness + dir=$(dirname "$path") + pushd "$dir" + completenessCheck "$dir" + error_count=$(($error_count + $?)) + popd +done + +if [[ $error_count == 0 ]] +then + msg "All checks passed." + exit 0 +else + msg "Errors found. See log statements above." + exit 1 +fi diff --git a/java-beyondcorp-appconnections/.kokoro/nightly/common.cfg b/java-beyondcorp-appconnections/.kokoro/nightly/common.cfg new file mode 100644 index 000000000000..f367fd0f946f --- /dev/null +++ b/java-beyondcorp-appconnections/.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-beyondcorp-appconnections/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-appconnections/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/java-beyondcorp-appconnections/.kokoro/nightly/integration.cfg b/java-beyondcorp-appconnections/.kokoro/nightly/integration.cfg new file mode 100644 index 000000000000..a2907a257b2b --- /dev/null +++ b/java-beyondcorp-appconnections/.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: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "ENABLE_FLAKYBOT" + 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/java-beyondcorp-appconnections/.kokoro/nightly/java11-integration.cfg b/java-beyondcorp-appconnections/.kokoro/nightly/java11-integration.cfg new file mode 100644 index 000000000000..58049cc38f11 --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/nightly/java11-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-public-resources/java11014" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "ENABLE_FLAKYBOT" + value: "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/java-beyondcorp-appconnections/.kokoro/nightly/java11.cfg b/java-beyondcorp-appconnections/.kokoro/nightly/java11.cfg new file mode 100644 index 000000000000..709f2b4c73db --- /dev/null +++ b/java-beyondcorp-appconnections/.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/java-beyondcorp-appconnections/.kokoro/nightly/java7.cfg b/java-beyondcorp-appconnections/.kokoro/nightly/java7.cfg new file mode 100644 index 000000000000..cb24f44eea3b --- /dev/null +++ b/java-beyondcorp-appconnections/.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/java-beyondcorp-appconnections/.kokoro/nightly/java8-osx.cfg b/java-beyondcorp-appconnections/.kokoro/nightly/java8-osx.cfg new file mode 100644 index 000000000000..08b94d622392 --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/nightly/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-beyondcorp-appconnections/.kokoro/build.sh" diff --git a/java-beyondcorp-appconnections/.kokoro/nightly/java8-win.cfg b/java-beyondcorp-appconnections/.kokoro/nightly/java8-win.cfg new file mode 100644 index 000000000000..804da342d7f2 --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/nightly/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-beyondcorp-appconnections/.kokoro/build.bat" diff --git a/java-beyondcorp-appconnections/.kokoro/nightly/java8.cfg b/java-beyondcorp-appconnections/.kokoro/nightly/java8.cfg new file mode 100644 index 000000000000..495cc7bacd63 --- /dev/null +++ b/java-beyondcorp-appconnections/.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/java-beyondcorp-appconnections/.kokoro/nightly/samples.cfg b/java-beyondcorp-appconnections/.kokoro/nightly/samples.cfg new file mode 100644 index 000000000000..9761fd8648cb --- /dev/null +++ b/java-beyondcorp-appconnections/.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_FLAKYBOT" + value: "true" +} diff --git a/java-beyondcorp-appconnections/.kokoro/populate-secrets.sh b/java-beyondcorp-appconnections/.kokoro/populate-secrets.sh new file mode 100755 index 000000000000..f52514257ef0 --- /dev/null +++ b/java-beyondcorp-appconnections/.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/java-beyondcorp-appconnections/.kokoro/presubmit/clirr.cfg b/java-beyondcorp-appconnections/.kokoro/presubmit/clirr.cfg new file mode 100644 index 000000000000..ec572442e2e7 --- /dev/null +++ b/java-beyondcorp-appconnections/.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/java-beyondcorp-appconnections/.kokoro/presubmit/common.cfg b/java-beyondcorp-appconnections/.kokoro/presubmit/common.cfg new file mode 100644 index 000000000000..f9bd80576ab5 --- /dev/null +++ b/java-beyondcorp-appconnections/.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-beyondcorp-appconnections/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-appconnections/.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/java-beyondcorp-appconnections/.kokoro/presubmit/dependencies.cfg b/java-beyondcorp-appconnections/.kokoro/presubmit/dependencies.cfg new file mode 100644 index 000000000000..c34be7b768d3 --- /dev/null +++ b/java-beyondcorp-appconnections/.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-beyondcorp-appconnections/.kokoro/dependencies.sh" +} diff --git a/java-beyondcorp-appconnections/.kokoro/presubmit/graalvm-native-17.cfg b/java-beyondcorp-appconnections/.kokoro/presubmit/graalvm-native-17.cfg new file mode 100644 index 000000000000..a3f7fb9d4943 --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/presubmit/graalvm-native-17.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/graalvm17" +} + +env_vars: { + key: "JOB_TYPE" + value: "graalvm17" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} \ No newline at end of file diff --git a/java-beyondcorp-appconnections/.kokoro/presubmit/graalvm-native.cfg b/java-beyondcorp-appconnections/.kokoro/presubmit/graalvm-native.cfg new file mode 100644 index 000000000000..4c7225ec924e --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/presubmit/graalvm-native.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/graalvm" +} + +env_vars: { + key: "JOB_TYPE" + value: "graalvm" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/java-beyondcorp-appconnections/.kokoro/presubmit/integration.cfg b/java-beyondcorp-appconnections/.kokoro/presubmit/integration.cfg new file mode 100644 index 000000000000..dded67a9d54a --- /dev/null +++ b/java-beyondcorp-appconnections/.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/java-beyondcorp-appconnections/.kokoro/presubmit/java11.cfg b/java-beyondcorp-appconnections/.kokoro/presubmit/java11.cfg new file mode 100644 index 000000000000..709f2b4c73db --- /dev/null +++ b/java-beyondcorp-appconnections/.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/java-beyondcorp-appconnections/.kokoro/presubmit/java7.cfg b/java-beyondcorp-appconnections/.kokoro/presubmit/java7.cfg new file mode 100644 index 000000000000..cb24f44eea3b --- /dev/null +++ b/java-beyondcorp-appconnections/.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/java-beyondcorp-appconnections/.kokoro/presubmit/java8-osx.cfg b/java-beyondcorp-appconnections/.kokoro/presubmit/java8-osx.cfg new file mode 100644 index 000000000000..08b94d622392 --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/presubmit/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-beyondcorp-appconnections/.kokoro/build.sh" diff --git a/java-beyondcorp-appconnections/.kokoro/presubmit/java8-win.cfg b/java-beyondcorp-appconnections/.kokoro/presubmit/java8-win.cfg new file mode 100644 index 000000000000..804da342d7f2 --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/presubmit/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-beyondcorp-appconnections/.kokoro/build.bat" diff --git a/java-beyondcorp-appconnections/.kokoro/presubmit/java8.cfg b/java-beyondcorp-appconnections/.kokoro/presubmit/java8.cfg new file mode 100644 index 000000000000..495cc7bacd63 --- /dev/null +++ b/java-beyondcorp-appconnections/.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/java-beyondcorp-appconnections/.kokoro/presubmit/linkage-monitor.cfg b/java-beyondcorp-appconnections/.kokoro/presubmit/linkage-monitor.cfg new file mode 100644 index 000000000000..b46af6cd053e --- /dev/null +++ b/java-beyondcorp-appconnections/.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-beyondcorp-appconnections/.kokoro/linkage-monitor.sh" +} \ No newline at end of file diff --git a/java-beyondcorp-appconnections/.kokoro/presubmit/lint.cfg b/java-beyondcorp-appconnections/.kokoro/presubmit/lint.cfg new file mode 100644 index 000000000000..6d323c8ae768 --- /dev/null +++ b/java-beyondcorp-appconnections/.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/java-beyondcorp-appconnections/.kokoro/presubmit/samples.cfg b/java-beyondcorp-appconnections/.kokoro/presubmit/samples.cfg new file mode 100644 index 000000000000..01e0960047b8 --- /dev/null +++ b/java-beyondcorp-appconnections/.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/java-beyondcorp-appconnections/.kokoro/readme.sh b/java-beyondcorp-appconnections/.kokoro/readme.sh new file mode 100755 index 000000000000..e7884a00b0bf --- /dev/null +++ b/java-beyondcorp-appconnections/.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-beyondcorp-appconnections + +# 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-beyondcorp-appconnections \ + --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/java-beyondcorp-appconnections/.kokoro/release/bump_snapshot.cfg b/java-beyondcorp-appconnections/.kokoro/release/bump_snapshot.cfg new file mode 100644 index 000000000000..1b357fdf7ed3 --- /dev/null +++ b/java-beyondcorp-appconnections/.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-beyondcorp-appconnections/.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-beyondcorp-appconnections/.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/java-beyondcorp-appconnections/.kokoro/release/common.cfg b/java-beyondcorp-appconnections/.kokoro/release/common.cfg new file mode 100644 index 000000000000..bdd3c6ebad3b --- /dev/null +++ b/java-beyondcorp-appconnections/.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-beyondcorp-appconnections/.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/java-beyondcorp-appconnections/.kokoro/release/common.sh b/java-beyondcorp-appconnections/.kokoro/release/common.sh new file mode 100755 index 000000000000..7f78ee414faf --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/release/common.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# Get secrets from keystore and set and environment variables +setup_environment_secrets() { + export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) + export GPG_TTY=$(tty) + export GPG_HOMEDIR=/gpg + mkdir $GPG_HOMEDIR + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg + export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|') + export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') +} + +create_settings_xml_file() { + echo " + + + ossrh + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-staging + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-snapshots + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + +" > $1 +} \ No newline at end of file diff --git a/java-beyondcorp-appconnections/.kokoro/release/drop.cfg b/java-beyondcorp-appconnections/.kokoro/release/drop.cfg new file mode 100644 index 000000000000..41dbe0224dbb --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/release/drop.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-appconnections/.kokoro/release/drop.sh" +} diff --git a/java-beyondcorp-appconnections/.kokoro/release/drop.sh b/java-beyondcorp-appconnections/.kokoro/release/drop.sh new file mode 100755 index 000000000000..742ec1a88600 --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/release/drop.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:drop -B \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/java-beyondcorp-appconnections/.kokoro/release/promote.cfg b/java-beyondcorp-appconnections/.kokoro/release/promote.cfg new file mode 100644 index 000000000000..c9d1ee886339 --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/release/promote.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-appconnections/.kokoro/release/promote.sh" +} diff --git a/java-beyondcorp-appconnections/.kokoro/release/promote.sh b/java-beyondcorp-appconnections/.kokoro/release/promote.sh new file mode 100755 index 000000000000..3cac3d8a97d7 --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/release/promote.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh + +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/java-beyondcorp-appconnections/.kokoro/release/publish_javadoc.cfg b/java-beyondcorp-appconnections/.kokoro/release/publish_javadoc.cfg new file mode 100644 index 000000000000..602768312a77 --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/release/publish_javadoc.cfg @@ -0,0 +1,23 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/doc-templates/" + +env_vars: { + key: "STAGING_BUCKET" + value: "docs-staging" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-appconnections/.kokoro/release/publish_javadoc.sh" +} + + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} diff --git a/java-beyondcorp-appconnections/.kokoro/release/publish_javadoc.sh b/java-beyondcorp-appconnections/.kokoro/release/publish_javadoc.sh new file mode 100755 index 000000000000..bdade5e1f501 --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/release/publish_javadoc.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +if [[ -z "${CREDENTIALS}" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +fi + +if [[ -z "${STAGING_BUCKET}" ]]; then + echo "Need to set STAGING_BUCKET environment variable" + exit 1 +fi + +# work from the git root directory +pushd $(dirname "$0")/../../ + +# install docuploader package +python3 -m pip install gcp-docuploader + +# compile all packages +mvn clean install -B -q -DskipTests=true + +export NAME=google-cloud-beyondcorp-appconnections +export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# build the docs +mvn site -B -q + +pushd target/site/apidocs + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --language java + +# upload docs +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET} diff --git a/java-beyondcorp-appconnections/.kokoro/release/publish_javadoc11.cfg b/java-beyondcorp-appconnections/.kokoro/release/publish_javadoc11.cfg new file mode 100644 index 000000000000..47541935c767 --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/release/publish_javadoc11.cfg @@ -0,0 +1,30 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# cloud-rad production +env_vars: { + key: "STAGING_BUCKET_V2" + value: "docs-staging-v2" +} + +# Configure the docker image for kokoro-trampoline +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-appconnections/.kokoro/release/publish_javadoc11.sh" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} + +# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/ +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx" diff --git a/java-beyondcorp-appconnections/.kokoro/release/publish_javadoc11.sh b/java-beyondcorp-appconnections/.kokoro/release/publish_javadoc11.sh new file mode 100755 index 000000000000..58527dc1a942 --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/release/publish_javadoc11.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +if [[ -z "${CREDENTIALS}" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +fi + +if [[ -z "${STAGING_BUCKET_V2}" ]]; then + echo "Need to set STAGING_BUCKET_V2 environment variable" + exit 1 +fi + +# work from the git root directory +pushd $(dirname "$0")/../../ + +# install docuploader package +python3 -m pip install gcp-docuploader + +# compile all packages +mvn clean install -B -q -DskipTests=true + +export NAME=google-cloud-beyondcorp-appconnections +export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# cloud RAD generation +mvn clean javadoc:aggregate -B -q -P docFX +# include CHANGELOG +cp CHANGELOG.md target/docfx-yml/history.md + +pushd target/docfx-yml + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --xrefs devsite://java/gax \ + --xrefs devsite://java/google-cloud-core \ + --xrefs devsite://java/api-common \ + --xrefs devsite://java/proto-google-common-protos \ + --xrefs devsite://java/google-api-client \ + --xrefs devsite://java/google-http-client \ + --xrefs devsite://java/protobuf \ + --language java + +# upload yml to production bucket +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET_V2} \ + --destination-prefix docfx diff --git a/java-beyondcorp-appconnections/.kokoro/release/snapshot.cfg b/java-beyondcorp-appconnections/.kokoro/release/snapshot.cfg new file mode 100644 index 000000000000..dfde773b9521 --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/release/snapshot.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-appconnections/.kokoro/release/snapshot.sh" +} \ No newline at end of file diff --git a/java-beyondcorp-appconnections/.kokoro/release/snapshot.sh b/java-beyondcorp-appconnections/.kokoro/release/snapshot.sh new file mode 100755 index 000000000000..1f55b77024d8 --- /dev/null +++ b/java-beyondcorp-appconnections/.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 deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} diff --git a/java-beyondcorp-appconnections/.kokoro/release/stage.cfg b/java-beyondcorp-appconnections/.kokoro/release/stage.cfg new file mode 100644 index 000000000000..9a6c81a1d7cc --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/release/stage.cfg @@ -0,0 +1,19 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-appconnections/.kokoro/release/stage.sh" +} + +# Need to save the properties file +action { + define_artifacts { + regex: "github/java-beyondcorp-appconnections/target/nexus-staging/staging/*.properties" + strip_prefix: "github/java-beyondcorp-appconnections" + } +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" +} diff --git a/java-beyondcorp-appconnections/.kokoro/release/stage.sh b/java-beyondcorp-appconnections/.kokoro/release/stage.sh new file mode 100755 index 000000000000..1dba8de10857 --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/release/stage.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# Start the releasetool reporter +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 deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DskipTests=true \ + -Dclirr.skip=true \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} + +if [[ -n "${AUTORELEASE_PR}" ]] +then + mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml +fi diff --git a/java-beyondcorp-appconnections/.kokoro/trampoline.sh b/java-beyondcorp-appconnections/.kokoro/trampoline.sh new file mode 100644 index 000000000000..8b69b793c9ec --- /dev/null +++ b/java-beyondcorp-appconnections/.kokoro/trampoline.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -eo pipefail +# Always run the cleanup script, regardless of the success of bouncing into +# the container. +function cleanup() { + chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + echo "cleanup"; +} +trap cleanup EXIT + +$(dirname $0)/populate-secrets.sh # Secret Manager secrets. +python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/java-beyondcorp-appconnections/.repo-metadata.json b/java-beyondcorp-appconnections/.repo-metadata.json new file mode 100644 index 000000000000..6aa0f4da528c --- /dev/null +++ b/java-beyondcorp-appconnections/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "beyondcorp-appconnections", + "name_pretty": "BeyondCorp AppConnections", + "product_documentation": "https://cloud.google.com/beyondcorp-enterprise/", + "api_description": "is Google's implementation of the zero trust model. It builds upon a decade of experience at Google, combined with ideas and best practices from the community. By shifting access controls from the network perimeter to individual users, BeyondCorp enables secure work from virtually any location without the need for a traditional VPN.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-beyondcorp-appconnections/latest/overview", + "release_level": "preview", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-beyondcorp-appconnections", + "repo_short": "java-beyondcorp-appconnections", + "distribution_name": "com.google.cloud:google-cloud-beyondcorp-appconnections", + "api_id": "beyondcorp-appconnections.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/java-beyondcorp-appconnections/CODE_OF_CONDUCT.md b/java-beyondcorp-appconnections/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/java-beyondcorp-appconnections/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/java-beyondcorp-appconnections/CONTRIBUTING.md b/java-beyondcorp-appconnections/CONTRIBUTING.md new file mode 100644 index 000000000000..b65dd279c946 --- /dev/null +++ b/java-beyondcorp-appconnections/CONTRIBUTING.md @@ -0,0 +1,92 @@ +# 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 + +All code samples must be in compliance with the [java sample formatting guide][3]. +Code Samples must be bundled in separate Maven modules. + +The samples must be separate from the primary project for a few reasons: +1. Primary projects have a minimum Java version of Java 8 whereas samples can have + Java version of Java 11. 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 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 clean verify +``` + +### 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 +``` + +[1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account +[2]: https://maven.apache.org/settings.html#Active_Profiles +[3]: https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md \ No newline at end of file diff --git a/java-beyondcorp-appconnections/LICENSE b/java-beyondcorp-appconnections/LICENSE new file mode 100644 index 000000000000..261eeb9e9f8b --- /dev/null +++ b/java-beyondcorp-appconnections/LICENSE @@ -0,0 +1,201 @@ + 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/java-beyondcorp-appconnections/README.md b/java-beyondcorp-appconnections/README.md new file mode 100644 index 000000000000..336964d7731b --- /dev/null +++ b/java-beyondcorp-appconnections/README.md @@ -0,0 +1,201 @@ +# Google BeyondCorp AppConnections Client for Java + +Java idiomatic client for [BeyondCorp AppConnections][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + + +## Quickstart + + +If you are using Maven, add this to your pom.xml file: + + +```xml + + com.google.cloud + google-cloud-beyondcorp-appconnections + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-beyondcorp-appconnections:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-beyondcorp-appconnections" % "0.0.0" +``` + +## Authentication + +See the [Authentication][authentication] section in the base directory's README. + +## Authorization + +The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired BeyondCorp AppConnections APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the BeyondCorp AppConnections API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the BeyondCorp AppConnections [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google BeyondCorp AppConnections. +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud SDK][cloud-sdk] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `google-cloud-beyondcorp-appconnections` library. See the [Quickstart](#quickstart) section +to add `google-cloud-beyondcorp-appconnections` as a dependency in your code. + +## About BeyondCorp AppConnections + + +[BeyondCorp AppConnections][product-docs] is Google's implementation of the zero trust model. It builds upon a decade of experience at Google, combined with ideas and best practices from the community. By shifting access controls from the network perimeter to individual users, BeyondCorp enables secure work from virtually any location without the need for a traditional VPN. + +See the [BeyondCorp AppConnections client library docs][javadocs] to learn how to +use this BeyondCorp AppConnections Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +BeyondCorp AppConnections uses gRPC for the transport layer. + +## Supported Java Versions + +Java 8 or above is required for using this client. + +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. + +## Versioning + + +This library follows [Semantic Versioning](http://semver.org/). + + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. + + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +## CI Status + +Java Version | Status +------------ | ------ +Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] +Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] +Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] +Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: https://cloud.google.com/beyondcorp-enterprise/ +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-beyondcorp-appconnections/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-appconnections/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-appconnections/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-appconnections/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-appconnections/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-appconnections/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-appconnections/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-appconnections/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-appconnections/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-appconnections/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-appconnections/java11.html +[stability-image]: https://img.shields.io/badge/stability-preview-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-beyondcorp-appconnections.svg +[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-beyondcorp-appconnections&core=gav +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes +[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles +[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-sdk]: https://cloud.google.com/sdk/ +[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting +[contributing]: https://github.com/googleapis/java-beyondcorp-appconnections/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-beyondcorp-appconnections/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-beyondcorp-appconnections/blob/main/LICENSE +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing +[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=beyondcorp-appconnections.googleapis.com +[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png + +[semver]: https://semver.org/ +[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained +[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries +[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html +[g-c-j]: http://github.com/googleapis/google-cloud-java diff --git a/java-beyondcorp-appconnections/SECURITY.md b/java-beyondcorp-appconnections/SECURITY.md new file mode 100644 index 000000000000..8b58ae9c01ae --- /dev/null +++ b/java-beyondcorp-appconnections/SECURITY.md @@ -0,0 +1,7 @@ +# Security Policy + +To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). + +The Google Security Team will respond within 5 working days of your report on g.co/vulnz. + +We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. diff --git a/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections-bom/pom.xml b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections-bom/pom.xml new file mode 100644 index 000000000000..c60aad55938a --- /dev/null +++ b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections-bom/pom.xml @@ -0,0 +1,94 @@ + + + 4.0.0 + com.google.cloud + google-cloud-beyondcorp-appconnections-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-shared-config + 1.2.7 + + + Google BeyondCorp AppConnections BOM + https://github.com/googleapis/java-beyondcorp-appconnections + + BOM for BeyondCorp AppConnections + + + + Google LLC + + + + + chingor13 + Jeff Ching + chingor@google.com + Google LLC + + Developer + + + + neenushaji + Neenu Shaji + neenushaji@google.com + Google LLC + + Developer + + + + + + scm:git:https://github.com/googleapis/java-beyondcorp-appconnections.git + scm:git:git@github.com:googleapis/java-beyondcorp-appconnections.git + https://github.com/googleapis/java-beyondcorp-appconnections + + + + true + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + + com.google.cloud + google-cloud-beyondcorp-appconnections + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-beyondcorp-appconnections-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-beyondcorp-appconnections-v1 + 0.0.1-SNAPSHOT + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + diff --git a/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/pom.xml b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/pom.xml new file mode 100644 index 000000000000..8c7987085716 --- /dev/null +++ b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/pom.xml @@ -0,0 +1,139 @@ + + + 4.0.0 + com.google.cloud + google-cloud-beyondcorp-appconnections + 0.0.1-SNAPSHOT + jar + Google BeyondCorp AppConnections + https://github.com/googleapis/java-beyondcorp-appconnections + BeyondCorp AppConnections is Google's implementation of the zero trust model. It builds upon a decade of experience at Google, combined with ideas and best practices from the community. By shifting access controls from the network perimeter to individual users, BeyondCorp enables secure work from virtually any location without the need for a traditional VPN. + + com.google.cloud + google-cloud-beyondcorp-appconnections-parent + 0.0.1-SNAPSHOT + + + google-cloud-beyondcorp-appconnections + + + + 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-beyondcorp-appconnections-v1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + com.google.api.grpc + grpc-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + grpc-google-iam-v1 + + + org.threeten + threetenbp + + + + + junit + junit + test + 4.13.2 + + + + com.google.api.grpc + grpc-google-cloud-beyondcorp-appconnections-v1 + test + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionsServiceClient.java b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionsServiceClient.java new file mode 100644 index 000000000000..fcc39dfb04b0 --- /dev/null +++ b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionsServiceClient.java @@ -0,0 +1,1709 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.beyondcorp.appconnections.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +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.beyondcorp.appconnections.v1.stub.AppConnectionsServiceStub; +import com.google.cloud.beyondcorp.appconnections.v1.stub.AppConnectionsServiceStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.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: ## API Overview + * + *

The `beyondcorp.googleapis.com` service implements the Google Cloud BeyondCorp API. + * + *

## Data Model + * + *

The AppConnectionsService exposes the following resources: + * + *

    + *
  • AppConnections, named as follows: + * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`. + *
+ * + *

The AppConnectionsService service provides methods to manage (create/read/update/delete) + * BeyondCorp AppConnections. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AppConnectionsServiceClient appConnectionsServiceClient =
+ *     AppConnectionsServiceClient.create()) {
+ *   AppConnectionName name = AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]");
+ *   AppConnection response = appConnectionsServiceClient.getAppConnection(name);
+ * }
+ * }
+ * + *

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

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * AppConnectionsServiceSettings appConnectionsServiceSettings =
+ *     AppConnectionsServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * AppConnectionsServiceClient appConnectionsServiceClient =
+ *     AppConnectionsServiceClient.create(appConnectionsServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * AppConnectionsServiceSettings appConnectionsServiceSettings =
+ *     AppConnectionsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AppConnectionsServiceClient appConnectionsServiceClient =
+ *     AppConnectionsServiceClient.create(appConnectionsServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class AppConnectionsServiceClient implements BackgroundResource { + private final AppConnectionsServiceSettings settings; + private final AppConnectionsServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of AppConnectionsServiceClient with default settings. */ + public static final AppConnectionsServiceClient create() throws IOException { + return create(AppConnectionsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AppConnectionsServiceClient, 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 AppConnectionsServiceClient create(AppConnectionsServiceSettings settings) + throws IOException { + return new AppConnectionsServiceClient(settings); + } + + /** + * Constructs an instance of AppConnectionsServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(AppConnectionsServiceSettings). + */ + public static final AppConnectionsServiceClient create(AppConnectionsServiceStub stub) { + return new AppConnectionsServiceClient(stub); + } + + /** + * Constructs an instance of AppConnectionsServiceClient, 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 AppConnectionsServiceClient(AppConnectionsServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((AppConnectionsServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + protected AppConnectionsServiceClient(AppConnectionsServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final AppConnectionsServiceSettings getSettings() { + return settings; + } + + public AppConnectionsServiceStub 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 AppConnections in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (AppConnection element :
+   *       appConnectionsServiceClient.listAppConnections(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the AppConnection location using the form: + * `projects/{project_id}/locations/{location_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAppConnectionsPagedResponse listAppConnections(LocationName parent) { + ListAppConnectionsRequest request = + ListAppConnectionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listAppConnections(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists AppConnections in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (AppConnection element :
+   *       appConnectionsServiceClient.listAppConnections(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the AppConnection location using the form: + * `projects/{project_id}/locations/{location_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAppConnectionsPagedResponse listAppConnections(String parent) { + ListAppConnectionsRequest request = + ListAppConnectionsRequest.newBuilder().setParent(parent).build(); + return listAppConnections(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists AppConnections in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   ListAppConnectionsRequest request =
+   *       ListAppConnectionsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (AppConnection element :
+   *       appConnectionsServiceClient.listAppConnections(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAppConnectionsPagedResponse listAppConnections( + ListAppConnectionsRequest request) { + return listAppConnectionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists AppConnections in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   ListAppConnectionsRequest request =
+   *       ListAppConnectionsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       appConnectionsServiceClient.listAppConnectionsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (AppConnection element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listAppConnectionsPagedCallable() { + return stub.listAppConnectionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists AppConnections in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   ListAppConnectionsRequest request =
+   *       ListAppConnectionsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListAppConnectionsResponse response =
+   *         appConnectionsServiceClient.listAppConnectionsCallable().call(request);
+   *     for (AppConnection element : response.getAppConnectionsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listAppConnectionsCallable() { + return stub.listAppConnectionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single AppConnection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   AppConnectionName name = AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]");
+   *   AppConnection response = appConnectionsServiceClient.getAppConnection(name);
+   * }
+   * }
+ * + * @param name Required. BeyondCorp AppConnection name using the form: + * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AppConnection getAppConnection(AppConnectionName name) { + GetAppConnectionRequest request = + GetAppConnectionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getAppConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single AppConnection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   String name = AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString();
+   *   AppConnection response = appConnectionsServiceClient.getAppConnection(name);
+   * }
+   * }
+ * + * @param name Required. BeyondCorp AppConnection name using the form: + * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AppConnection getAppConnection(String name) { + GetAppConnectionRequest request = GetAppConnectionRequest.newBuilder().setName(name).build(); + return getAppConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single AppConnection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   GetAppConnectionRequest request =
+   *       GetAppConnectionRequest.newBuilder()
+   *           .setName(
+   *               AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString())
+   *           .build();
+   *   AppConnection response = appConnectionsServiceClient.getAppConnection(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AppConnection getAppConnection(GetAppConnectionRequest request) { + return getAppConnectionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single AppConnection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   GetAppConnectionRequest request =
+   *       GetAppConnectionRequest.newBuilder()
+   *           .setName(
+   *               AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       appConnectionsServiceClient.getAppConnectionCallable().futureCall(request);
+   *   // Do something.
+   *   AppConnection response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getAppConnectionCallable() { + return stub.getAppConnectionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new AppConnection in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   AppConnection appConnection = AppConnection.newBuilder().build();
+   *   String appConnectionId = "appConnectionId-1293292198";
+   *   AppConnection response =
+   *       appConnectionsServiceClient
+   *           .createAppConnectionAsync(parent, appConnection, appConnectionId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The resource project name of the AppConnection location using the form: + * `projects/{project_id}/locations/{location_id}` + * @param appConnection Required. A BeyondCorp AppConnection resource. + * @param appConnectionId Optional. User-settable AppConnection resource ID. * Must start with + * a letter. * Must contain between 4-63 characters from `/[a-z][0-9]-/`. * Must end + * with a number or a letter. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + createAppConnectionAsync( + LocationName parent, AppConnection appConnection, String appConnectionId) { + CreateAppConnectionRequest request = + CreateAppConnectionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setAppConnection(appConnection) + .setAppConnectionId(appConnectionId) + .build(); + return createAppConnectionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new AppConnection in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   AppConnection appConnection = AppConnection.newBuilder().build();
+   *   String appConnectionId = "appConnectionId-1293292198";
+   *   AppConnection response =
+   *       appConnectionsServiceClient
+   *           .createAppConnectionAsync(parent, appConnection, appConnectionId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The resource project name of the AppConnection location using the form: + * `projects/{project_id}/locations/{location_id}` + * @param appConnection Required. A BeyondCorp AppConnection resource. + * @param appConnectionId Optional. User-settable AppConnection resource ID. * Must start with + * a letter. * Must contain between 4-63 characters from `/[a-z][0-9]-/`. * Must end + * with a number or a letter. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + createAppConnectionAsync(String parent, AppConnection appConnection, String appConnectionId) { + CreateAppConnectionRequest request = + CreateAppConnectionRequest.newBuilder() + .setParent(parent) + .setAppConnection(appConnection) + .setAppConnectionId(appConnectionId) + .build(); + return createAppConnectionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new AppConnection in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   CreateAppConnectionRequest request =
+   *       CreateAppConnectionRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setAppConnectionId("appConnectionId-1293292198")
+   *           .setAppConnection(AppConnection.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   AppConnection response = appConnectionsServiceClient.createAppConnectionAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + createAppConnectionAsync(CreateAppConnectionRequest request) { + return createAppConnectionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new AppConnection in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   CreateAppConnectionRequest request =
+   *       CreateAppConnectionRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setAppConnectionId("appConnectionId-1293292198")
+   *           .setAppConnection(AppConnection.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       appConnectionsServiceClient.createAppConnectionOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AppConnection response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + CreateAppConnectionRequest, AppConnection, AppConnectionOperationMetadata> + createAppConnectionOperationCallable() { + return stub.createAppConnectionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new AppConnection in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   CreateAppConnectionRequest request =
+   *       CreateAppConnectionRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setAppConnectionId("appConnectionId-1293292198")
+   *           .setAppConnection(AppConnection.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       appConnectionsServiceClient.createAppConnectionCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createAppConnectionCallable() { + return stub.createAppConnectionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single AppConnection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   AppConnection appConnection = AppConnection.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   AppConnection response =
+   *       appConnectionsServiceClient.updateAppConnectionAsync(appConnection, updateMask).get();
+   * }
+   * }
+ * + * @param appConnection Required. AppConnection message with updated fields. Only supported fields + * specified in update_mask are updated. + * @param updateMask Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these fields from + * [BeyondCorp.AppConnection]: + *
    + *
  • `labels` + *
  • `display_name` + *
  • `application_endpoint` + *
  • `connectors` + *
+ * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + updateAppConnectionAsync(AppConnection appConnection, FieldMask updateMask) { + UpdateAppConnectionRequest request = + UpdateAppConnectionRequest.newBuilder() + .setAppConnection(appConnection) + .setUpdateMask(updateMask) + .build(); + return updateAppConnectionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single AppConnection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   UpdateAppConnectionRequest request =
+   *       UpdateAppConnectionRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setAppConnection(AppConnection.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   AppConnection response = appConnectionsServiceClient.updateAppConnectionAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + updateAppConnectionAsync(UpdateAppConnectionRequest request) { + return updateAppConnectionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single AppConnection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   UpdateAppConnectionRequest request =
+   *       UpdateAppConnectionRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setAppConnection(AppConnection.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       appConnectionsServiceClient.updateAppConnectionOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AppConnection response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + UpdateAppConnectionRequest, AppConnection, AppConnectionOperationMetadata> + updateAppConnectionOperationCallable() { + return stub.updateAppConnectionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single AppConnection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   UpdateAppConnectionRequest request =
+   *       UpdateAppConnectionRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setAppConnection(AppConnection.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future =
+   *       appConnectionsServiceClient.updateAppConnectionCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateAppConnectionCallable() { + return stub.updateAppConnectionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single AppConnection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   AppConnectionName name = AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]");
+   *   appConnectionsServiceClient.deleteAppConnectionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. BeyondCorp Connector name using the form: + * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteAppConnectionAsync( + AppConnectionName name) { + DeleteAppConnectionRequest request = + DeleteAppConnectionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return deleteAppConnectionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single AppConnection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   String name = AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString();
+   *   appConnectionsServiceClient.deleteAppConnectionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. BeyondCorp Connector name using the form: + * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteAppConnectionAsync( + String name) { + DeleteAppConnectionRequest request = + DeleteAppConnectionRequest.newBuilder().setName(name).build(); + return deleteAppConnectionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single AppConnection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   DeleteAppConnectionRequest request =
+   *       DeleteAppConnectionRequest.newBuilder()
+   *           .setName(
+   *               AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   appConnectionsServiceClient.deleteAppConnectionAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteAppConnectionAsync( + DeleteAppConnectionRequest request) { + return deleteAppConnectionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single AppConnection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   DeleteAppConnectionRequest request =
+   *       DeleteAppConnectionRequest.newBuilder()
+   *           .setName(
+   *               AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       appConnectionsServiceClient.deleteAppConnectionOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteAppConnectionOperationCallable() { + return stub.deleteAppConnectionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single AppConnection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   DeleteAppConnectionRequest request =
+   *       DeleteAppConnectionRequest.newBuilder()
+   *           .setName(
+   *               AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       appConnectionsServiceClient.deleteAppConnectionCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteAppConnectionCallable() { + return stub.deleteAppConnectionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Resolves AppConnections details for a given AppConnector. An internal method called by a + * connector to find AppConnections to connect to. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (ResolveAppConnectionsResponse.AppConnectionDetails element :
+   *       appConnectionsServiceClient.resolveAppConnections(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the AppConnection location using the form: + * `projects/{project_id}/locations/{location_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ResolveAppConnectionsPagedResponse resolveAppConnections(LocationName parent) { + ResolveAppConnectionsRequest request = + ResolveAppConnectionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return resolveAppConnections(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Resolves AppConnections details for a given AppConnector. An internal method called by a + * connector to find AppConnections to connect to. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (ResolveAppConnectionsResponse.AppConnectionDetails element :
+   *       appConnectionsServiceClient.resolveAppConnections(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the AppConnection location using the form: + * `projects/{project_id}/locations/{location_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ResolveAppConnectionsPagedResponse resolveAppConnections(String parent) { + ResolveAppConnectionsRequest request = + ResolveAppConnectionsRequest.newBuilder().setParent(parent).build(); + return resolveAppConnections(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Resolves AppConnections details for a given AppConnector. An internal method called by a + * connector to find AppConnections to connect to. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   ResolveAppConnectionsRequest request =
+   *       ResolveAppConnectionsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setAppConnectorId(
+   *               AppConnectorName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTOR]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (ResolveAppConnectionsResponse.AppConnectionDetails element :
+   *       appConnectionsServiceClient.resolveAppConnections(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ResolveAppConnectionsPagedResponse resolveAppConnections( + ResolveAppConnectionsRequest request) { + return resolveAppConnectionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Resolves AppConnections details for a given AppConnector. An internal method called by a + * connector to find AppConnections to connect to. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   ResolveAppConnectionsRequest request =
+   *       ResolveAppConnectionsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setAppConnectorId(
+   *               AppConnectorName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTOR]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       appConnectionsServiceClient.resolveAppConnectionsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (ResolveAppConnectionsResponse.AppConnectionDetails element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + resolveAppConnectionsPagedCallable() { + return stub.resolveAppConnectionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Resolves AppConnections details for a given AppConnector. An internal method called by a + * connector to find AppConnections to connect to. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   ResolveAppConnectionsRequest request =
+   *       ResolveAppConnectionsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setAppConnectorId(
+   *               AppConnectorName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTOR]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ResolveAppConnectionsResponse response =
+   *         appConnectionsServiceClient.resolveAppConnectionsCallable().call(request);
+   *     for (ResolveAppConnectionsResponse.AppConnectionDetails element :
+   *         response.getAppConnectionDetailsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + resolveAppConnectionsCallable() { + return stub.resolveAppConnectionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : appConnectionsServiceClient.listLocations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       appConnectionsServiceClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response =
+   *         appConnectionsServiceClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = appConnectionsServiceClient.getLocation(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future =
+   *       appConnectionsServiceClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = appConnectionsServiceClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       appConnectionsServiceClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = appConnectionsServiceClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       appConnectionsServiceClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(
+   *               AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = appConnectionsServiceClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppConnectionsServiceClient appConnectionsServiceClient =
+   *     AppConnectionsServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(
+   *               AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       appConnectionsServiceClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListAppConnectionsPagedResponse + extends AbstractPagedListResponse< + ListAppConnectionsRequest, + ListAppConnectionsResponse, + AppConnection, + ListAppConnectionsPage, + ListAppConnectionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListAppConnectionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListAppConnectionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListAppConnectionsPagedResponse(ListAppConnectionsPage page) { + super(page, ListAppConnectionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListAppConnectionsPage + extends AbstractPage< + ListAppConnectionsRequest, + ListAppConnectionsResponse, + AppConnection, + ListAppConnectionsPage> { + + private ListAppConnectionsPage( + PageContext context, + ListAppConnectionsResponse response) { + super(context, response); + } + + private static ListAppConnectionsPage createEmptyPage() { + return new ListAppConnectionsPage(null, null); + } + + @Override + protected ListAppConnectionsPage createPage( + PageContext context, + ListAppConnectionsResponse response) { + return new ListAppConnectionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListAppConnectionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListAppConnectionsRequest, + ListAppConnectionsResponse, + AppConnection, + ListAppConnectionsPage, + ListAppConnectionsFixedSizeCollection> { + + private ListAppConnectionsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListAppConnectionsFixedSizeCollection createEmptyCollection() { + return new ListAppConnectionsFixedSizeCollection(null, 0); + } + + @Override + protected ListAppConnectionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListAppConnectionsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ResolveAppConnectionsPagedResponse + extends AbstractPagedListResponse< + ResolveAppConnectionsRequest, + ResolveAppConnectionsResponse, + ResolveAppConnectionsResponse.AppConnectionDetails, + ResolveAppConnectionsPage, + ResolveAppConnectionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ResolveAppConnectionsRequest, + ResolveAppConnectionsResponse, + ResolveAppConnectionsResponse.AppConnectionDetails> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ResolveAppConnectionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ResolveAppConnectionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ResolveAppConnectionsPagedResponse(ResolveAppConnectionsPage page) { + super(page, ResolveAppConnectionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ResolveAppConnectionsPage + extends AbstractPage< + ResolveAppConnectionsRequest, + ResolveAppConnectionsResponse, + ResolveAppConnectionsResponse.AppConnectionDetails, + ResolveAppConnectionsPage> { + + private ResolveAppConnectionsPage( + PageContext< + ResolveAppConnectionsRequest, + ResolveAppConnectionsResponse, + ResolveAppConnectionsResponse.AppConnectionDetails> + context, + ResolveAppConnectionsResponse response) { + super(context, response); + } + + private static ResolveAppConnectionsPage createEmptyPage() { + return new ResolveAppConnectionsPage(null, null); + } + + @Override + protected ResolveAppConnectionsPage createPage( + PageContext< + ResolveAppConnectionsRequest, + ResolveAppConnectionsResponse, + ResolveAppConnectionsResponse.AppConnectionDetails> + context, + ResolveAppConnectionsResponse response) { + return new ResolveAppConnectionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ResolveAppConnectionsRequest, + ResolveAppConnectionsResponse, + ResolveAppConnectionsResponse.AppConnectionDetails> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ResolveAppConnectionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ResolveAppConnectionsRequest, + ResolveAppConnectionsResponse, + ResolveAppConnectionsResponse.AppConnectionDetails, + ResolveAppConnectionsPage, + ResolveAppConnectionsFixedSizeCollection> { + + private ResolveAppConnectionsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ResolveAppConnectionsFixedSizeCollection createEmptyCollection() { + return new ResolveAppConnectionsFixedSizeCollection(null, 0); + } + + @Override + protected ResolveAppConnectionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ResolveAppConnectionsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionsServiceSettings.java b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionsServiceSettings.java new file mode 100644 index 000000000000..04b80cbfe9c1 --- /dev/null +++ b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionsServiceSettings.java @@ -0,0 +1,367 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.beyondcorp.appconnections.v1; + +import static com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceClient.ListAppConnectionsPagedResponse; +import static com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceClient.ResolveAppConnectionsPagedResponse; + +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.beyondcorp.appconnections.v1.stub.AppConnectionsServiceStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.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 AppConnectionsServiceClient}. + * + *

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

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * AppConnectionsServiceSettings.Builder appConnectionsServiceSettingsBuilder =
+ *     AppConnectionsServiceSettings.newBuilder();
+ * appConnectionsServiceSettingsBuilder
+ *     .getAppConnectionSettings()
+ *     .setRetrySettings(
+ *         appConnectionsServiceSettingsBuilder
+ *             .getAppConnectionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AppConnectionsServiceSettings appConnectionsServiceSettings =
+ *     appConnectionsServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class AppConnectionsServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listAppConnections. */ + public PagedCallSettings< + ListAppConnectionsRequest, ListAppConnectionsResponse, ListAppConnectionsPagedResponse> + listAppConnectionsSettings() { + return ((AppConnectionsServiceStubSettings) getStubSettings()).listAppConnectionsSettings(); + } + + /** Returns the object with the settings used for calls to getAppConnection. */ + public UnaryCallSettings getAppConnectionSettings() { + return ((AppConnectionsServiceStubSettings) getStubSettings()).getAppConnectionSettings(); + } + + /** Returns the object with the settings used for calls to createAppConnection. */ + public UnaryCallSettings createAppConnectionSettings() { + return ((AppConnectionsServiceStubSettings) getStubSettings()).createAppConnectionSettings(); + } + + /** Returns the object with the settings used for calls to createAppConnection. */ + public OperationCallSettings< + CreateAppConnectionRequest, AppConnection, AppConnectionOperationMetadata> + createAppConnectionOperationSettings() { + return ((AppConnectionsServiceStubSettings) getStubSettings()) + .createAppConnectionOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateAppConnection. */ + public UnaryCallSettings updateAppConnectionSettings() { + return ((AppConnectionsServiceStubSettings) getStubSettings()).updateAppConnectionSettings(); + } + + /** Returns the object with the settings used for calls to updateAppConnection. */ + public OperationCallSettings< + UpdateAppConnectionRequest, AppConnection, AppConnectionOperationMetadata> + updateAppConnectionOperationSettings() { + return ((AppConnectionsServiceStubSettings) getStubSettings()) + .updateAppConnectionOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteAppConnection. */ + public UnaryCallSettings deleteAppConnectionSettings() { + return ((AppConnectionsServiceStubSettings) getStubSettings()).deleteAppConnectionSettings(); + } + + /** Returns the object with the settings used for calls to deleteAppConnection. */ + public OperationCallSettings + deleteAppConnectionOperationSettings() { + return ((AppConnectionsServiceStubSettings) getStubSettings()) + .deleteAppConnectionOperationSettings(); + } + + /** Returns the object with the settings used for calls to resolveAppConnections. */ + public PagedCallSettings< + ResolveAppConnectionsRequest, + ResolveAppConnectionsResponse, + ResolveAppConnectionsPagedResponse> + resolveAppConnectionsSettings() { + return ((AppConnectionsServiceStubSettings) getStubSettings()).resolveAppConnectionsSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((AppConnectionsServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((AppConnectionsServiceStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((AppConnectionsServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((AppConnectionsServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((AppConnectionsServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final AppConnectionsServiceSettings create(AppConnectionsServiceStubSettings stub) + throws IOException { + return new AppConnectionsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return AppConnectionsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return AppConnectionsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return AppConnectionsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return AppConnectionsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return AppConnectionsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return AppConnectionsServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AppConnectionsServiceStubSettings.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 AppConnectionsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for AppConnectionsServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(AppConnectionsServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(AppConnectionsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AppConnectionsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(AppConnectionsServiceStubSettings.newBuilder()); + } + + public AppConnectionsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((AppConnectionsServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listAppConnections. */ + public PagedCallSettings.Builder< + ListAppConnectionsRequest, ListAppConnectionsResponse, ListAppConnectionsPagedResponse> + listAppConnectionsSettings() { + return getStubSettingsBuilder().listAppConnectionsSettings(); + } + + /** Returns the builder for the settings used for calls to getAppConnection. */ + public UnaryCallSettings.Builder + getAppConnectionSettings() { + return getStubSettingsBuilder().getAppConnectionSettings(); + } + + /** Returns the builder for the settings used for calls to createAppConnection. */ + public UnaryCallSettings.Builder + createAppConnectionSettings() { + return getStubSettingsBuilder().createAppConnectionSettings(); + } + + /** Returns the builder for the settings used for calls to createAppConnection. */ + public OperationCallSettings.Builder< + CreateAppConnectionRequest, AppConnection, AppConnectionOperationMetadata> + createAppConnectionOperationSettings() { + return getStubSettingsBuilder().createAppConnectionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateAppConnection. */ + public UnaryCallSettings.Builder + updateAppConnectionSettings() { + return getStubSettingsBuilder().updateAppConnectionSettings(); + } + + /** Returns the builder for the settings used for calls to updateAppConnection. */ + public OperationCallSettings.Builder< + UpdateAppConnectionRequest, AppConnection, AppConnectionOperationMetadata> + updateAppConnectionOperationSettings() { + return getStubSettingsBuilder().updateAppConnectionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteAppConnection. */ + public UnaryCallSettings.Builder + deleteAppConnectionSettings() { + return getStubSettingsBuilder().deleteAppConnectionSettings(); + } + + /** Returns the builder for the settings used for calls to deleteAppConnection. */ + public OperationCallSettings.Builder< + DeleteAppConnectionRequest, Empty, AppConnectionOperationMetadata> + deleteAppConnectionOperationSettings() { + return getStubSettingsBuilder().deleteAppConnectionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to resolveAppConnections. */ + public PagedCallSettings.Builder< + ResolveAppConnectionsRequest, + ResolveAppConnectionsResponse, + ResolveAppConnectionsPagedResponse> + resolveAppConnectionsSettings() { + return getStubSettingsBuilder().resolveAppConnectionsSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public AppConnectionsServiceSettings build() throws IOException { + return new AppConnectionsServiceSettings(this); + } + } +} diff --git a/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/gapic_metadata.json b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/gapic_metadata.json new file mode 100644 index 000000000000..62065eda2b68 --- /dev/null +++ b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/gapic_metadata.json @@ -0,0 +1,51 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.beyondcorp.appconnections.v1", + "libraryPackage": "com.google.cloud.beyondcorp.appconnections.v1", + "services": { + "AppConnectionsService": { + "clients": { + "grpc": { + "libraryClient": "AppConnectionsServiceClient", + "rpcs": { + "CreateAppConnection": { + "methods": ["createAppConnectionAsync", "createAppConnectionAsync", "createAppConnectionAsync", "createAppConnectionOperationCallable", "createAppConnectionCallable"] + }, + "DeleteAppConnection": { + "methods": ["deleteAppConnectionAsync", "deleteAppConnectionAsync", "deleteAppConnectionAsync", "deleteAppConnectionOperationCallable", "deleteAppConnectionCallable"] + }, + "GetAppConnection": { + "methods": ["getAppConnection", "getAppConnection", "getAppConnection", "getAppConnectionCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListAppConnections": { + "methods": ["listAppConnections", "listAppConnections", "listAppConnections", "listAppConnectionsPagedCallable", "listAppConnectionsCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ResolveAppConnections": { + "methods": ["resolveAppConnections", "resolveAppConnections", "resolveAppConnections", "resolveAppConnectionsPagedCallable", "resolveAppConnectionsCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "UpdateAppConnection": { + "methods": ["updateAppConnectionAsync", "updateAppConnectionAsync", "updateAppConnectionOperationCallable", "updateAppConnectionCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/package-info.java b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/package-info.java new file mode 100644 index 000000000000..dd668316d886 --- /dev/null +++ b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/package-info.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to BeyondCorp API + * + *

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

======================= AppConnectionsServiceClient ======================= + * + *

Service Description: ## API Overview + * + *

The `beyondcorp.googleapis.com` service implements the Google Cloud BeyondCorp API. + * + *

## Data Model + * + *

The AppConnectionsService exposes the following resources: + * + *

    + *
  • AppConnections, named as follows: + * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`. + *
+ * + *

The AppConnectionsService service provides methods to manage (create/read/update/delete) + * BeyondCorp AppConnections. + * + *

Sample for AppConnectionsServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AppConnectionsServiceClient appConnectionsServiceClient =
+ *     AppConnectionsServiceClient.create()) {
+ *   AppConnectionName name = AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]");
+ *   AppConnection response = appConnectionsServiceClient.getAppConnection(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.beyondcorp.appconnections.v1; + +import javax.annotation.Generated; diff --git a/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/stub/AppConnectionsServiceStub.java b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/stub/AppConnectionsServiceStub.java new file mode 100644 index 000000000000..a5c7f22f02de --- /dev/null +++ b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/stub/AppConnectionsServiceStub.java @@ -0,0 +1,148 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.beyondcorp.appconnections.v1.stub; + +import static com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceClient.ListAppConnectionsPagedResponse; +import static com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceClient.ResolveAppConnectionsPagedResponse; + +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.beyondcorp.appconnections.v1.AppConnection; +import com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata; +import com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest; +import com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest; +import com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest; +import com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest; +import com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse; +import com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest; +import com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse; +import com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.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 AppConnectionsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class AppConnectionsServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable + listAppConnectionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listAppConnectionsPagedCallable()"); + } + + public UnaryCallable + listAppConnectionsCallable() { + throw new UnsupportedOperationException("Not implemented: listAppConnectionsCallable()"); + } + + public UnaryCallable getAppConnectionCallable() { + throw new UnsupportedOperationException("Not implemented: getAppConnectionCallable()"); + } + + public OperationCallable< + CreateAppConnectionRequest, AppConnection, AppConnectionOperationMetadata> + createAppConnectionOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createAppConnectionOperationCallable()"); + } + + public UnaryCallable createAppConnectionCallable() { + throw new UnsupportedOperationException("Not implemented: createAppConnectionCallable()"); + } + + public OperationCallable< + UpdateAppConnectionRequest, AppConnection, AppConnectionOperationMetadata> + updateAppConnectionOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateAppConnectionOperationCallable()"); + } + + public UnaryCallable updateAppConnectionCallable() { + throw new UnsupportedOperationException("Not implemented: updateAppConnectionCallable()"); + } + + public OperationCallable + deleteAppConnectionOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteAppConnectionOperationCallable()"); + } + + public UnaryCallable deleteAppConnectionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteAppConnectionCallable()"); + } + + public UnaryCallable + resolveAppConnectionsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: resolveAppConnectionsPagedCallable()"); + } + + public UnaryCallable + resolveAppConnectionsCallable() { + throw new UnsupportedOperationException("Not implemented: resolveAppConnectionsCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/stub/AppConnectionsServiceStubSettings.java b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/stub/AppConnectionsServiceStubSettings.java new file mode 100644 index 000000000000..b5cbaf067577 --- /dev/null +++ b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/stub/AppConnectionsServiceStubSettings.java @@ -0,0 +1,910 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.beyondcorp.appconnections.v1.stub; + +import static com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceClient.ListAppConnectionsPagedResponse; +import static com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceClient.ResolveAppConnectionsPagedResponse; + +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.beyondcorp.appconnections.v1.AppConnection; +import com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata; +import com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest; +import com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest; +import com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest; +import com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest; +import com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse; +import com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest; +import com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse; +import com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.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 AppConnectionsServiceStub}. + * + *

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

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * AppConnectionsServiceStubSettings.Builder appConnectionsServiceSettingsBuilder =
+ *     AppConnectionsServiceStubSettings.newBuilder();
+ * appConnectionsServiceSettingsBuilder
+ *     .getAppConnectionSettings()
+ *     .setRetrySettings(
+ *         appConnectionsServiceSettingsBuilder
+ *             .getAppConnectionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AppConnectionsServiceStubSettings appConnectionsServiceSettings =
+ *     appConnectionsServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class AppConnectionsServiceStubSettings + 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< + ListAppConnectionsRequest, ListAppConnectionsResponse, ListAppConnectionsPagedResponse> + listAppConnectionsSettings; + private final UnaryCallSettings getAppConnectionSettings; + private final UnaryCallSettings + createAppConnectionSettings; + private final OperationCallSettings< + CreateAppConnectionRequest, AppConnection, AppConnectionOperationMetadata> + createAppConnectionOperationSettings; + private final UnaryCallSettings + updateAppConnectionSettings; + private final OperationCallSettings< + UpdateAppConnectionRequest, AppConnection, AppConnectionOperationMetadata> + updateAppConnectionOperationSettings; + private final UnaryCallSettings + deleteAppConnectionSettings; + private final OperationCallSettings< + DeleteAppConnectionRequest, Empty, AppConnectionOperationMetadata> + deleteAppConnectionOperationSettings; + private final PagedCallSettings< + ResolveAppConnectionsRequest, + ResolveAppConnectionsResponse, + ResolveAppConnectionsPagedResponse> + resolveAppConnectionsSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor< + ListAppConnectionsRequest, ListAppConnectionsResponse, AppConnection> + LIST_APP_CONNECTIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListAppConnectionsRequest, ListAppConnectionsResponse, AppConnection>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListAppConnectionsRequest injectToken( + ListAppConnectionsRequest payload, String token) { + return ListAppConnectionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListAppConnectionsRequest injectPageSize( + ListAppConnectionsRequest payload, int pageSize) { + return ListAppConnectionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListAppConnectionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListAppConnectionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListAppConnectionsResponse payload) { + return payload.getAppConnectionsList() == null + ? ImmutableList.of() + : payload.getAppConnectionsList(); + } + }; + + private static final PagedListDescriptor< + ResolveAppConnectionsRequest, + ResolveAppConnectionsResponse, + ResolveAppConnectionsResponse.AppConnectionDetails> + RESOLVE_APP_CONNECTIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ResolveAppConnectionsRequest, + ResolveAppConnectionsResponse, + ResolveAppConnectionsResponse.AppConnectionDetails>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ResolveAppConnectionsRequest injectToken( + ResolveAppConnectionsRequest payload, String token) { + return ResolveAppConnectionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ResolveAppConnectionsRequest injectPageSize( + ResolveAppConnectionsRequest payload, int pageSize) { + return ResolveAppConnectionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ResolveAppConnectionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ResolveAppConnectionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ResolveAppConnectionsResponse payload) { + return payload.getAppConnectionDetailsList() == null + ? ImmutableList.of() + : payload.getAppConnectionDetailsList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListAppConnectionsRequest, ListAppConnectionsResponse, ListAppConnectionsPagedResponse> + LIST_APP_CONNECTIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListAppConnectionsRequest, + ListAppConnectionsResponse, + ListAppConnectionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListAppConnectionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_APP_CONNECTIONS_PAGE_STR_DESC, request, context); + return ListAppConnectionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ResolveAppConnectionsRequest, + ResolveAppConnectionsResponse, + ResolveAppConnectionsPagedResponse> + RESOLVE_APP_CONNECTIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ResolveAppConnectionsRequest, + ResolveAppConnectionsResponse, + ResolveAppConnectionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ResolveAppConnectionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ResolveAppConnectionsRequest, + ResolveAppConnectionsResponse, + ResolveAppConnectionsResponse.AppConnectionDetails> + pageContext = + PageContext.create( + callable, RESOLVE_APP_CONNECTIONS_PAGE_STR_DESC, request, context); + return ResolveAppConnectionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listAppConnections. */ + public PagedCallSettings< + ListAppConnectionsRequest, ListAppConnectionsResponse, ListAppConnectionsPagedResponse> + listAppConnectionsSettings() { + return listAppConnectionsSettings; + } + + /** Returns the object with the settings used for calls to getAppConnection. */ + public UnaryCallSettings getAppConnectionSettings() { + return getAppConnectionSettings; + } + + /** Returns the object with the settings used for calls to createAppConnection. */ + public UnaryCallSettings createAppConnectionSettings() { + return createAppConnectionSettings; + } + + /** Returns the object with the settings used for calls to createAppConnection. */ + public OperationCallSettings< + CreateAppConnectionRequest, AppConnection, AppConnectionOperationMetadata> + createAppConnectionOperationSettings() { + return createAppConnectionOperationSettings; + } + + /** Returns the object with the settings used for calls to updateAppConnection. */ + public UnaryCallSettings updateAppConnectionSettings() { + return updateAppConnectionSettings; + } + + /** Returns the object with the settings used for calls to updateAppConnection. */ + public OperationCallSettings< + UpdateAppConnectionRequest, AppConnection, AppConnectionOperationMetadata> + updateAppConnectionOperationSettings() { + return updateAppConnectionOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteAppConnection. */ + public UnaryCallSettings deleteAppConnectionSettings() { + return deleteAppConnectionSettings; + } + + /** Returns the object with the settings used for calls to deleteAppConnection. */ + public OperationCallSettings + deleteAppConnectionOperationSettings() { + return deleteAppConnectionOperationSettings; + } + + /** Returns the object with the settings used for calls to resolveAppConnections. */ + public PagedCallSettings< + ResolveAppConnectionsRequest, + ResolveAppConnectionsResponse, + ResolveAppConnectionsPagedResponse> + resolveAppConnectionsSettings() { + return resolveAppConnectionsSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public AppConnectionsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcAppConnectionsServiceStub.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 "beyondcorp.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "beyondcorp.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default 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(AppConnectionsServiceStubSettings.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 AppConnectionsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listAppConnectionsSettings = settingsBuilder.listAppConnectionsSettings().build(); + getAppConnectionSettings = settingsBuilder.getAppConnectionSettings().build(); + createAppConnectionSettings = settingsBuilder.createAppConnectionSettings().build(); + createAppConnectionOperationSettings = + settingsBuilder.createAppConnectionOperationSettings().build(); + updateAppConnectionSettings = settingsBuilder.updateAppConnectionSettings().build(); + updateAppConnectionOperationSettings = + settingsBuilder.updateAppConnectionOperationSettings().build(); + deleteAppConnectionSettings = settingsBuilder.deleteAppConnectionSettings().build(); + deleteAppConnectionOperationSettings = + settingsBuilder.deleteAppConnectionOperationSettings().build(); + resolveAppConnectionsSettings = settingsBuilder.resolveAppConnectionsSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for AppConnectionsServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListAppConnectionsRequest, ListAppConnectionsResponse, ListAppConnectionsPagedResponse> + listAppConnectionsSettings; + private final UnaryCallSettings.Builder + getAppConnectionSettings; + private final UnaryCallSettings.Builder + createAppConnectionSettings; + private final OperationCallSettings.Builder< + CreateAppConnectionRequest, AppConnection, AppConnectionOperationMetadata> + createAppConnectionOperationSettings; + private final UnaryCallSettings.Builder + updateAppConnectionSettings; + private final OperationCallSettings.Builder< + UpdateAppConnectionRequest, AppConnection, AppConnectionOperationMetadata> + updateAppConnectionOperationSettings; + private final UnaryCallSettings.Builder + deleteAppConnectionSettings; + private final OperationCallSettings.Builder< + DeleteAppConnectionRequest, Empty, AppConnectionOperationMetadata> + deleteAppConnectionOperationSettings; + private final PagedCallSettings.Builder< + ResolveAppConnectionsRequest, + ResolveAppConnectionsResponse, + ResolveAppConnectionsPagedResponse> + resolveAppConnectionsSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_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().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listAppConnectionsSettings = PagedCallSettings.newBuilder(LIST_APP_CONNECTIONS_PAGE_STR_FACT); + getAppConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createAppConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createAppConnectionOperationSettings = OperationCallSettings.newBuilder(); + updateAppConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateAppConnectionOperationSettings = OperationCallSettings.newBuilder(); + deleteAppConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteAppConnectionOperationSettings = OperationCallSettings.newBuilder(); + resolveAppConnectionsSettings = + PagedCallSettings.newBuilder(RESOLVE_APP_CONNECTIONS_PAGE_STR_FACT); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listAppConnectionsSettings, + getAppConnectionSettings, + createAppConnectionSettings, + updateAppConnectionSettings, + deleteAppConnectionSettings, + resolveAppConnectionsSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(AppConnectionsServiceStubSettings settings) { + super(settings); + + listAppConnectionsSettings = settings.listAppConnectionsSettings.toBuilder(); + getAppConnectionSettings = settings.getAppConnectionSettings.toBuilder(); + createAppConnectionSettings = settings.createAppConnectionSettings.toBuilder(); + createAppConnectionOperationSettings = + settings.createAppConnectionOperationSettings.toBuilder(); + updateAppConnectionSettings = settings.updateAppConnectionSettings.toBuilder(); + updateAppConnectionOperationSettings = + settings.updateAppConnectionOperationSettings.toBuilder(); + deleteAppConnectionSettings = settings.deleteAppConnectionSettings.toBuilder(); + deleteAppConnectionOperationSettings = + settings.deleteAppConnectionOperationSettings.toBuilder(); + resolveAppConnectionsSettings = settings.resolveAppConnectionsSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listAppConnectionsSettings, + getAppConnectionSettings, + createAppConnectionSettings, + updateAppConnectionSettings, + deleteAppConnectionSettings, + resolveAppConnectionsSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listAppConnectionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getAppConnectionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createAppConnectionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateAppConnectionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteAppConnectionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .resolveAppConnectionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createAppConnectionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(AppConnection.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + AppConnectionOperationMetadata.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 + .updateAppConnectionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(AppConnection.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + AppConnectionOperationMetadata.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 + .deleteAppConnectionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + AppConnectionOperationMetadata.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; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listAppConnections. */ + public PagedCallSettings.Builder< + ListAppConnectionsRequest, ListAppConnectionsResponse, ListAppConnectionsPagedResponse> + listAppConnectionsSettings() { + return listAppConnectionsSettings; + } + + /** Returns the builder for the settings used for calls to getAppConnection. */ + public UnaryCallSettings.Builder + getAppConnectionSettings() { + return getAppConnectionSettings; + } + + /** Returns the builder for the settings used for calls to createAppConnection. */ + public UnaryCallSettings.Builder + createAppConnectionSettings() { + return createAppConnectionSettings; + } + + /** Returns the builder for the settings used for calls to createAppConnection. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + CreateAppConnectionRequest, AppConnection, AppConnectionOperationMetadata> + createAppConnectionOperationSettings() { + return createAppConnectionOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateAppConnection. */ + public UnaryCallSettings.Builder + updateAppConnectionSettings() { + return updateAppConnectionSettings; + } + + /** Returns the builder for the settings used for calls to updateAppConnection. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + UpdateAppConnectionRequest, AppConnection, AppConnectionOperationMetadata> + updateAppConnectionOperationSettings() { + return updateAppConnectionOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteAppConnection. */ + public UnaryCallSettings.Builder + deleteAppConnectionSettings() { + return deleteAppConnectionSettings; + } + + /** Returns the builder for the settings used for calls to deleteAppConnection. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + DeleteAppConnectionRequest, Empty, AppConnectionOperationMetadata> + deleteAppConnectionOperationSettings() { + return deleteAppConnectionOperationSettings; + } + + /** Returns the builder for the settings used for calls to resolveAppConnections. */ + public PagedCallSettings.Builder< + ResolveAppConnectionsRequest, + ResolveAppConnectionsResponse, + ResolveAppConnectionsPagedResponse> + resolveAppConnectionsSettings() { + return resolveAppConnectionsSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public AppConnectionsServiceStubSettings build() throws IOException { + return new AppConnectionsServiceStubSettings(this); + } + } +} diff --git a/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/stub/GrpcAppConnectionsServiceCallableFactory.java b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/stub/GrpcAppConnectionsServiceCallableFactory.java new file mode 100644 index 000000000000..ef771bc53df2 --- /dev/null +++ b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/stub/GrpcAppConnectionsServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.beyondcorp.appconnections.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the AppConnectionsService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcAppConnectionsServiceCallableFactory 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/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/stub/GrpcAppConnectionsServiceStub.java b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/stub/GrpcAppConnectionsServiceStub.java new file mode 100644 index 000000000000..97e3a2e0c53c --- /dev/null +++ b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/stub/GrpcAppConnectionsServiceStub.java @@ -0,0 +1,586 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.beyondcorp.appconnections.v1.stub; + +import static com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceClient.ListAppConnectionsPagedResponse; +import static com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceClient.ResolveAppConnectionsPagedResponse; + +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.UnaryCallable; +import com.google.cloud.beyondcorp.appconnections.v1.AppConnection; +import com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata; +import com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest; +import com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest; +import com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest; +import com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest; +import com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse; +import com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest; +import com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse; +import com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.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.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the AppConnectionsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcAppConnectionsServiceStub extends AppConnectionsServiceStub { + private static final MethodDescriptor + listAppConnectionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.beyondcorp.appconnections.v1.AppConnectionsService/ListAppConnections") + .setRequestMarshaller( + ProtoUtils.marshaller(ListAppConnectionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListAppConnectionsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getAppConnectionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.beyondcorp.appconnections.v1.AppConnectionsService/GetAppConnection") + .setRequestMarshaller( + ProtoUtils.marshaller(GetAppConnectionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(AppConnection.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createAppConnectionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.beyondcorp.appconnections.v1.AppConnectionsService/CreateAppConnection") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateAppConnectionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateAppConnectionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.beyondcorp.appconnections.v1.AppConnectionsService/UpdateAppConnection") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateAppConnectionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteAppConnectionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.beyondcorp.appconnections.v1.AppConnectionsService/DeleteAppConnection") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteAppConnectionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + resolveAppConnectionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.beyondcorp.appconnections.v1.AppConnectionsService/ResolveAppConnections") + .setRequestMarshaller( + ProtoUtils.marshaller(ResolveAppConnectionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ResolveAppConnectionsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable + listAppConnectionsCallable; + private final UnaryCallable + listAppConnectionsPagedCallable; + private final UnaryCallable getAppConnectionCallable; + private final UnaryCallable createAppConnectionCallable; + private final OperationCallable< + CreateAppConnectionRequest, AppConnection, AppConnectionOperationMetadata> + createAppConnectionOperationCallable; + private final UnaryCallable updateAppConnectionCallable; + private final OperationCallable< + UpdateAppConnectionRequest, AppConnection, AppConnectionOperationMetadata> + updateAppConnectionOperationCallable; + private final UnaryCallable deleteAppConnectionCallable; + private final OperationCallable + deleteAppConnectionOperationCallable; + private final UnaryCallable + resolveAppConnectionsCallable; + private final UnaryCallable + resolveAppConnectionsPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcAppConnectionsServiceStub create( + AppConnectionsServiceStubSettings settings) throws IOException { + return new GrpcAppConnectionsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcAppConnectionsServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcAppConnectionsServiceStub( + AppConnectionsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcAppConnectionsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcAppConnectionsServiceStub( + AppConnectionsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcAppConnectionsServiceStub, 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 GrpcAppConnectionsServiceStub( + AppConnectionsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcAppConnectionsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcAppConnectionsServiceStub, 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 GrpcAppConnectionsServiceStub( + AppConnectionsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listAppConnectionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listAppConnectionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getAppConnectionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getAppConnectionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createAppConnectionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createAppConnectionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateAppConnectionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateAppConnectionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "app_connection.name", String.valueOf(request.getAppConnection().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteAppConnectionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteAppConnectionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + resolveAppConnectionsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(resolveAppConnectionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + + this.listAppConnectionsCallable = + callableFactory.createUnaryCallable( + listAppConnectionsTransportSettings, + settings.listAppConnectionsSettings(), + clientContext); + this.listAppConnectionsPagedCallable = + callableFactory.createPagedCallable( + listAppConnectionsTransportSettings, + settings.listAppConnectionsSettings(), + clientContext); + this.getAppConnectionCallable = + callableFactory.createUnaryCallable( + getAppConnectionTransportSettings, settings.getAppConnectionSettings(), clientContext); + this.createAppConnectionCallable = + callableFactory.createUnaryCallable( + createAppConnectionTransportSettings, + settings.createAppConnectionSettings(), + clientContext); + this.createAppConnectionOperationCallable = + callableFactory.createOperationCallable( + createAppConnectionTransportSettings, + settings.createAppConnectionOperationSettings(), + clientContext, + operationsStub); + this.updateAppConnectionCallable = + callableFactory.createUnaryCallable( + updateAppConnectionTransportSettings, + settings.updateAppConnectionSettings(), + clientContext); + this.updateAppConnectionOperationCallable = + callableFactory.createOperationCallable( + updateAppConnectionTransportSettings, + settings.updateAppConnectionOperationSettings(), + clientContext, + operationsStub); + this.deleteAppConnectionCallable = + callableFactory.createUnaryCallable( + deleteAppConnectionTransportSettings, + settings.deleteAppConnectionSettings(), + clientContext); + this.deleteAppConnectionOperationCallable = + callableFactory.createOperationCallable( + deleteAppConnectionTransportSettings, + settings.deleteAppConnectionOperationSettings(), + clientContext, + operationsStub); + this.resolveAppConnectionsCallable = + callableFactory.createUnaryCallable( + resolveAppConnectionsTransportSettings, + settings.resolveAppConnectionsSettings(), + clientContext); + this.resolveAppConnectionsPagedCallable = + callableFactory.createPagedCallable( + resolveAppConnectionsTransportSettings, + settings.resolveAppConnectionsSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable + listAppConnectionsCallable() { + return listAppConnectionsCallable; + } + + @Override + public UnaryCallable + listAppConnectionsPagedCallable() { + return listAppConnectionsPagedCallable; + } + + @Override + public UnaryCallable getAppConnectionCallable() { + return getAppConnectionCallable; + } + + @Override + public UnaryCallable createAppConnectionCallable() { + return createAppConnectionCallable; + } + + @Override + public OperationCallable< + CreateAppConnectionRequest, AppConnection, AppConnectionOperationMetadata> + createAppConnectionOperationCallable() { + return createAppConnectionOperationCallable; + } + + @Override + public UnaryCallable updateAppConnectionCallable() { + return updateAppConnectionCallable; + } + + @Override + public OperationCallable< + UpdateAppConnectionRequest, AppConnection, AppConnectionOperationMetadata> + updateAppConnectionOperationCallable() { + return updateAppConnectionOperationCallable; + } + + @Override + public UnaryCallable deleteAppConnectionCallable() { + return deleteAppConnectionCallable; + } + + @Override + public OperationCallable + deleteAppConnectionOperationCallable() { + return deleteAppConnectionOperationCallable; + } + + @Override + public UnaryCallable + resolveAppConnectionsCallable() { + return resolveAppConnectionsCallable; + } + + @Override + public UnaryCallable + resolveAppConnectionsPagedCallable() { + return resolveAppConnectionsPagedCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/test/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionsServiceClientTest.java b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/test/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionsServiceClientTest.java new file mode 100644 index 000000000000..e1484fc9669d --- /dev/null +++ b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/test/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionsServiceClientTest.java @@ -0,0 +1,902 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.beyondcorp.appconnections.v1; + +import static com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceClient.ListAppConnectionsPagedResponse; +import static com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceClient.ResolveAppConnectionsPagedResponse; + +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +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 AppConnectionsServiceClientTest { + private static MockAppConnectionsService mockAppConnectionsService; + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private AppConnectionsServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockAppConnectionsService = new MockAppConnectionsService(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList( + mockAppConnectionsService, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + AppConnectionsServiceSettings settings = + AppConnectionsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AppConnectionsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listAppConnectionsTest() throws Exception { + AppConnection responsesElement = AppConnection.newBuilder().build(); + ListAppConnectionsResponse expectedResponse = + ListAppConnectionsResponse.newBuilder() + .setNextPageToken("") + .addAllAppConnections(Arrays.asList(responsesElement)) + .build(); + mockAppConnectionsService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListAppConnectionsPagedResponse pagedListResponse = client.listAppConnections(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAppConnectionsList().get(0), resources.get(0)); + + List actualRequests = mockAppConnectionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAppConnectionsRequest actualRequest = ((ListAppConnectionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAppConnectionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppConnectionsService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listAppConnections(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAppConnectionsTest2() throws Exception { + AppConnection responsesElement = AppConnection.newBuilder().build(); + ListAppConnectionsResponse expectedResponse = + ListAppConnectionsResponse.newBuilder() + .setNextPageToken("") + .addAllAppConnections(Arrays.asList(responsesElement)) + .build(); + mockAppConnectionsService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListAppConnectionsPagedResponse pagedListResponse = client.listAppConnections(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAppConnectionsList().get(0), resources.get(0)); + + List actualRequests = mockAppConnectionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAppConnectionsRequest actualRequest = ((ListAppConnectionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAppConnectionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppConnectionsService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listAppConnections(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAppConnectionTest() throws Exception { + AppConnection expectedResponse = + AppConnection.newBuilder() + .setName(AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setApplicationEndpoint(AppConnection.ApplicationEndpoint.newBuilder().build()) + .addAllConnectors(new ArrayList()) + .setGateway(AppConnection.Gateway.newBuilder().build()) + .build(); + mockAppConnectionsService.addResponse(expectedResponse); + + AppConnectionName name = AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]"); + + AppConnection actualResponse = client.getAppConnection(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAppConnectionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAppConnectionRequest actualRequest = ((GetAppConnectionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAppConnectionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppConnectionsService.addException(exception); + + try { + AppConnectionName name = AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]"); + client.getAppConnection(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAppConnectionTest2() throws Exception { + AppConnection expectedResponse = + AppConnection.newBuilder() + .setName(AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setApplicationEndpoint(AppConnection.ApplicationEndpoint.newBuilder().build()) + .addAllConnectors(new ArrayList()) + .setGateway(AppConnection.Gateway.newBuilder().build()) + .build(); + mockAppConnectionsService.addResponse(expectedResponse); + + String name = "name3373707"; + + AppConnection actualResponse = client.getAppConnection(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAppConnectionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAppConnectionRequest actualRequest = ((GetAppConnectionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAppConnectionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppConnectionsService.addException(exception); + + try { + String name = "name3373707"; + client.getAppConnection(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createAppConnectionTest() throws Exception { + AppConnection expectedResponse = + AppConnection.newBuilder() + .setName(AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setApplicationEndpoint(AppConnection.ApplicationEndpoint.newBuilder().build()) + .addAllConnectors(new ArrayList()) + .setGateway(AppConnection.Gateway.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createAppConnectionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAppConnectionsService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + AppConnection appConnection = AppConnection.newBuilder().build(); + String appConnectionId = "appConnectionId-1293292198"; + + AppConnection actualResponse = + client.createAppConnectionAsync(parent, appConnection, appConnectionId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAppConnectionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAppConnectionRequest actualRequest = ((CreateAppConnectionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(appConnection, actualRequest.getAppConnection()); + Assert.assertEquals(appConnectionId, actualRequest.getAppConnectionId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createAppConnectionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppConnectionsService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + AppConnection appConnection = AppConnection.newBuilder().build(); + String appConnectionId = "appConnectionId-1293292198"; + client.createAppConnectionAsync(parent, appConnection, appConnectionId).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 createAppConnectionTest2() throws Exception { + AppConnection expectedResponse = + AppConnection.newBuilder() + .setName(AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setApplicationEndpoint(AppConnection.ApplicationEndpoint.newBuilder().build()) + .addAllConnectors(new ArrayList()) + .setGateway(AppConnection.Gateway.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createAppConnectionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAppConnectionsService.addResponse(resultOperation); + + String parent = "parent-995424086"; + AppConnection appConnection = AppConnection.newBuilder().build(); + String appConnectionId = "appConnectionId-1293292198"; + + AppConnection actualResponse = + client.createAppConnectionAsync(parent, appConnection, appConnectionId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAppConnectionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAppConnectionRequest actualRequest = ((CreateAppConnectionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(appConnection, actualRequest.getAppConnection()); + Assert.assertEquals(appConnectionId, actualRequest.getAppConnectionId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createAppConnectionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppConnectionsService.addException(exception); + + try { + String parent = "parent-995424086"; + AppConnection appConnection = AppConnection.newBuilder().build(); + String appConnectionId = "appConnectionId-1293292198"; + client.createAppConnectionAsync(parent, appConnection, appConnectionId).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 updateAppConnectionTest() throws Exception { + AppConnection expectedResponse = + AppConnection.newBuilder() + .setName(AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setApplicationEndpoint(AppConnection.ApplicationEndpoint.newBuilder().build()) + .addAllConnectors(new ArrayList()) + .setGateway(AppConnection.Gateway.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateAppConnectionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAppConnectionsService.addResponse(resultOperation); + + AppConnection appConnection = AppConnection.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + AppConnection actualResponse = client.updateAppConnectionAsync(appConnection, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAppConnectionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateAppConnectionRequest actualRequest = ((UpdateAppConnectionRequest) actualRequests.get(0)); + + Assert.assertEquals(appConnection, actualRequest.getAppConnection()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateAppConnectionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppConnectionsService.addException(exception); + + try { + AppConnection appConnection = AppConnection.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateAppConnectionAsync(appConnection, 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 deleteAppConnectionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteAppConnectionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAppConnectionsService.addResponse(resultOperation); + + AppConnectionName name = AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]"); + + client.deleteAppConnectionAsync(name).get(); + + List actualRequests = mockAppConnectionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteAppConnectionRequest actualRequest = ((DeleteAppConnectionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteAppConnectionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppConnectionsService.addException(exception); + + try { + AppConnectionName name = AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]"); + client.deleteAppConnectionAsync(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 deleteAppConnectionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteAppConnectionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAppConnectionsService.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteAppConnectionAsync(name).get(); + + List actualRequests = mockAppConnectionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteAppConnectionRequest actualRequest = ((DeleteAppConnectionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteAppConnectionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppConnectionsService.addException(exception); + + try { + String name = "name3373707"; + client.deleteAppConnectionAsync(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 resolveAppConnectionsTest() throws Exception { + ResolveAppConnectionsResponse.AppConnectionDetails responsesElement = + ResolveAppConnectionsResponse.AppConnectionDetails.newBuilder().build(); + ResolveAppConnectionsResponse expectedResponse = + ResolveAppConnectionsResponse.newBuilder() + .setNextPageToken("") + .addAllAppConnectionDetails(Arrays.asList(responsesElement)) + .build(); + mockAppConnectionsService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ResolveAppConnectionsPagedResponse pagedListResponse = client.resolveAppConnections(parent); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAppConnectionDetailsList().get(0), resources.get(0)); + + List actualRequests = mockAppConnectionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ResolveAppConnectionsRequest actualRequest = + ((ResolveAppConnectionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void resolveAppConnectionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppConnectionsService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.resolveAppConnections(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void resolveAppConnectionsTest2() throws Exception { + ResolveAppConnectionsResponse.AppConnectionDetails responsesElement = + ResolveAppConnectionsResponse.AppConnectionDetails.newBuilder().build(); + ResolveAppConnectionsResponse expectedResponse = + ResolveAppConnectionsResponse.newBuilder() + .setNextPageToken("") + .addAllAppConnectionDetails(Arrays.asList(responsesElement)) + .build(); + mockAppConnectionsService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ResolveAppConnectionsPagedResponse pagedListResponse = client.resolveAppConnections(parent); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAppConnectionDetailsList().get(0), resources.get(0)); + + List actualRequests = mockAppConnectionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ResolveAppConnectionsRequest actualRequest = + ((ResolveAppConnectionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void resolveAppConnectionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppConnectionsService.addException(exception); + + try { + String parent = "parent-995424086"; + client.resolveAppConnections(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + AppConnectionName.of("[PROJECT]", "[LOCATION]", "[APP_CONNECTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/test/java/com/google/cloud/beyondcorp/appconnections/v1/MockAppConnectionsService.java b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/test/java/com/google/cloud/beyondcorp/appconnections/v1/MockAppConnectionsService.java new file mode 100644 index 000000000000..52b28fe28f5f --- /dev/null +++ b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/test/java/com/google/cloud/beyondcorp/appconnections/v1/MockAppConnectionsService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.beyondcorp.appconnections.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockAppConnectionsService implements MockGrpcService { + private final MockAppConnectionsServiceImpl serviceImpl; + + public MockAppConnectionsService() { + serviceImpl = new MockAppConnectionsServiceImpl(); + } + + @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/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/test/java/com/google/cloud/beyondcorp/appconnections/v1/MockAppConnectionsServiceImpl.java b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/test/java/com/google/cloud/beyondcorp/appconnections/v1/MockAppConnectionsServiceImpl.java new file mode 100644 index 000000000000..64a1bc3d4245 --- /dev/null +++ b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/test/java/com/google/cloud/beyondcorp/appconnections/v1/MockAppConnectionsServiceImpl.java @@ -0,0 +1,189 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.beyondcorp.appconnections.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceGrpc.AppConnectionsServiceImplBase; +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 MockAppConnectionsServiceImpl extends AppConnectionsServiceImplBase { + private List requests; + private Queue responses; + + public MockAppConnectionsServiceImpl() { + 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 listAppConnections( + ListAppConnectionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListAppConnectionsResponse) { + requests.add(request); + responseObserver.onNext(((ListAppConnectionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListAppConnections, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListAppConnectionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getAppConnection( + GetAppConnectionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AppConnection) { + requests.add(request); + responseObserver.onNext(((AppConnection) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetAppConnection, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AppConnection.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createAppConnection( + CreateAppConnectionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + 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( + String.format( + "Unrecognized response type %s for method CreateAppConnection, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateAppConnection( + UpdateAppConnectionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + 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( + String.format( + "Unrecognized response type %s for method UpdateAppConnection, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteAppConnection( + DeleteAppConnectionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + 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( + String.format( + "Unrecognized response type %s for method DeleteAppConnection, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void resolveAppConnections( + ResolveAppConnectionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ResolveAppConnectionsResponse) { + requests.add(request); + responseObserver.onNext(((ResolveAppConnectionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ResolveAppConnections, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ResolveAppConnectionsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/test/java/com/google/cloud/beyondcorp/appconnections/v1/MockIAMPolicy.java b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/test/java/com/google/cloud/beyondcorp/appconnections/v1/MockIAMPolicy.java new file mode 100644 index 000000000000..74716cd553ce --- /dev/null +++ b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/test/java/com/google/cloud/beyondcorp/appconnections/v1/MockIAMPolicy.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.beyondcorp.appconnections.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicy implements MockGrpcService { + private final MockIAMPolicyImpl serviceImpl; + + public MockIAMPolicy() { + serviceImpl = new MockIAMPolicyImpl(); + } + + @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/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/test/java/com/google/cloud/beyondcorp/appconnections/v1/MockIAMPolicyImpl.java b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/test/java/com/google/cloud/beyondcorp/appconnections/v1/MockIAMPolicyImpl.java new file mode 100644 index 000000000000..9adf6c8a73b2 --- /dev/null +++ b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/test/java/com/google/cloud/beyondcorp/appconnections/v1/MockIAMPolicyImpl.java @@ -0,0 +1,127 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.beyondcorp.appconnections.v1; + +import com.google.api.core.BetaApi; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import 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 MockIAMPolicyImpl extends IAMPolicyImplBase { + private List requests; + private Queue responses; + + public MockIAMPolicyImpl() { + 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 testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/test/java/com/google/cloud/beyondcorp/appconnections/v1/MockLocations.java b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/test/java/com/google/cloud/beyondcorp/appconnections/v1/MockLocations.java new file mode 100644 index 000000000000..5b6f275db1ef --- /dev/null +++ b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/test/java/com/google/cloud/beyondcorp/appconnections/v1/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.beyondcorp.appconnections.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @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/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/test/java/com/google/cloud/beyondcorp/appconnections/v1/MockLocationsImpl.java b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/test/java/com/google/cloud/beyondcorp/appconnections/v1/MockLocationsImpl.java new file mode 100644 index 000000000000..847b615b1c49 --- /dev/null +++ b/java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/src/test/java/com/google/cloud/beyondcorp/appconnections/v1/MockLocationsImpl.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.beyondcorp.appconnections.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +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 MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + 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 listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-beyondcorp-appconnections/grpc-google-cloud-beyondcorp-appconnections-v1/pom.xml b/java-beyondcorp-appconnections/grpc-google-cloud-beyondcorp-appconnections-v1/pom.xml new file mode 100644 index 000000000000..662c1cd600a7 --- /dev/null +++ b/java-beyondcorp-appconnections/grpc-google-cloud-beyondcorp-appconnections-v1/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-beyondcorp-appconnections-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-beyondcorp-appconnections-v1 + GRPC library for google-cloud-beyondcorp-appconnections + + com.google.cloud + google-cloud-beyondcorp-appconnections-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-common-protos + + + com.google.api.grpc + proto-google-cloud-beyondcorp-appconnections-v1 + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/java-beyondcorp-appconnections/grpc-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionsServiceGrpc.java b/java-beyondcorp-appconnections/grpc-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionsServiceGrpc.java new file mode 100644 index 000000000000..17ef2f9a745a --- /dev/null +++ b/java-beyondcorp-appconnections/grpc-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionsServiceGrpc.java @@ -0,0 +1,1038 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.beyondcorp.appconnections.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * ## API Overview
+ * The `beyondcorp.googleapis.com` service implements the Google Cloud
+ * BeyondCorp API.
+ * ## Data Model
+ * The AppConnectionsService exposes the following resources:
+ * * AppConnections, named as follows:
+ *   `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`.
+ * The AppConnectionsService service provides methods to manage
+ * (create/read/update/delete) BeyondCorp AppConnections.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class AppConnectionsServiceGrpc { + + private AppConnectionsServiceGrpc() {} + + public static final String SERVICE_NAME = + "google.cloud.beyondcorp.appconnections.v1.AppConnectionsService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest, + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse> + getListAppConnectionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListAppConnections", + requestType = com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest.class, + responseType = com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest, + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse> + getListAppConnectionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest, + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse> + getListAppConnectionsMethod; + if ((getListAppConnectionsMethod = AppConnectionsServiceGrpc.getListAppConnectionsMethod) + == null) { + synchronized (AppConnectionsServiceGrpc.class) { + if ((getListAppConnectionsMethod = AppConnectionsServiceGrpc.getListAppConnectionsMethod) + == null) { + AppConnectionsServiceGrpc.getListAppConnectionsMethod = + getListAppConnectionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListAppConnections")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.beyondcorp.appconnections.v1 + .ListAppConnectionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.beyondcorp.appconnections.v1 + .ListAppConnectionsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new AppConnectionsServiceMethodDescriptorSupplier("ListAppConnections")) + .build(); + } + } + } + return getListAppConnectionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection> + getGetAppConnectionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAppConnection", + requestType = com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest.class, + responseType = com.google.cloud.beyondcorp.appconnections.v1.AppConnection.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection> + getGetAppConnectionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection> + getGetAppConnectionMethod; + if ((getGetAppConnectionMethod = AppConnectionsServiceGrpc.getGetAppConnectionMethod) == null) { + synchronized (AppConnectionsServiceGrpc.class) { + if ((getGetAppConnectionMethod = AppConnectionsServiceGrpc.getGetAppConnectionMethod) + == null) { + AppConnectionsServiceGrpc.getGetAppConnectionMethod = + getGetAppConnectionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetAppConnection")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection + .getDefaultInstance())) + .setSchemaDescriptor( + new AppConnectionsServiceMethodDescriptorSupplier("GetAppConnection")) + .build(); + } + } + } + return getGetAppConnectionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest, + com.google.longrunning.Operation> + getCreateAppConnectionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateAppConnection", + requestType = com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest, + com.google.longrunning.Operation> + getCreateAppConnectionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest, + com.google.longrunning.Operation> + getCreateAppConnectionMethod; + if ((getCreateAppConnectionMethod = AppConnectionsServiceGrpc.getCreateAppConnectionMethod) + == null) { + synchronized (AppConnectionsServiceGrpc.class) { + if ((getCreateAppConnectionMethod = AppConnectionsServiceGrpc.getCreateAppConnectionMethod) + == null) { + AppConnectionsServiceGrpc.getCreateAppConnectionMethod = + getCreateAppConnectionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateAppConnection")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.beyondcorp.appconnections.v1 + .CreateAppConnectionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AppConnectionsServiceMethodDescriptorSupplier("CreateAppConnection")) + .build(); + } + } + } + return getCreateAppConnectionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest, + com.google.longrunning.Operation> + getUpdateAppConnectionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateAppConnection", + requestType = com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest, + com.google.longrunning.Operation> + getUpdateAppConnectionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest, + com.google.longrunning.Operation> + getUpdateAppConnectionMethod; + if ((getUpdateAppConnectionMethod = AppConnectionsServiceGrpc.getUpdateAppConnectionMethod) + == null) { + synchronized (AppConnectionsServiceGrpc.class) { + if ((getUpdateAppConnectionMethod = AppConnectionsServiceGrpc.getUpdateAppConnectionMethod) + == null) { + AppConnectionsServiceGrpc.getUpdateAppConnectionMethod = + getUpdateAppConnectionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateAppConnection")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.beyondcorp.appconnections.v1 + .UpdateAppConnectionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AppConnectionsServiceMethodDescriptorSupplier("UpdateAppConnection")) + .build(); + } + } + } + return getUpdateAppConnectionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest, + com.google.longrunning.Operation> + getDeleteAppConnectionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteAppConnection", + requestType = com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest, + com.google.longrunning.Operation> + getDeleteAppConnectionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest, + com.google.longrunning.Operation> + getDeleteAppConnectionMethod; + if ((getDeleteAppConnectionMethod = AppConnectionsServiceGrpc.getDeleteAppConnectionMethod) + == null) { + synchronized (AppConnectionsServiceGrpc.class) { + if ((getDeleteAppConnectionMethod = AppConnectionsServiceGrpc.getDeleteAppConnectionMethod) + == null) { + AppConnectionsServiceGrpc.getDeleteAppConnectionMethod = + getDeleteAppConnectionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteAppConnection")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.beyondcorp.appconnections.v1 + .DeleteAppConnectionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AppConnectionsServiceMethodDescriptorSupplier("DeleteAppConnection")) + .build(); + } + } + } + return getDeleteAppConnectionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest, + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse> + getResolveAppConnectionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ResolveAppConnections", + requestType = + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest.class, + responseType = + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest, + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse> + getResolveAppConnectionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest, + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse> + getResolveAppConnectionsMethod; + if ((getResolveAppConnectionsMethod = AppConnectionsServiceGrpc.getResolveAppConnectionsMethod) + == null) { + synchronized (AppConnectionsServiceGrpc.class) { + if ((getResolveAppConnectionsMethod = + AppConnectionsServiceGrpc.getResolveAppConnectionsMethod) + == null) { + AppConnectionsServiceGrpc.getResolveAppConnectionsMethod = + getResolveAppConnectionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ResolveAppConnections")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.beyondcorp.appconnections.v1 + .ResolveAppConnectionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.beyondcorp.appconnections.v1 + .ResolveAppConnectionsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new AppConnectionsServiceMethodDescriptorSupplier( + "ResolveAppConnections")) + .build(); + } + } + } + return getResolveAppConnectionsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static AppConnectionsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AppConnectionsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppConnectionsServiceStub(channel, callOptions); + } + }; + return AppConnectionsServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static AppConnectionsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AppConnectionsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppConnectionsServiceBlockingStub(channel, callOptions); + } + }; + return AppConnectionsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static AppConnectionsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AppConnectionsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppConnectionsServiceFutureStub(channel, callOptions); + } + }; + return AppConnectionsServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * ## API Overview
+   * The `beyondcorp.googleapis.com` service implements the Google Cloud
+   * BeyondCorp API.
+   * ## Data Model
+   * The AppConnectionsService exposes the following resources:
+   * * AppConnections, named as follows:
+   *   `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`.
+   * The AppConnectionsService service provides methods to manage
+   * (create/read/update/delete) BeyondCorp AppConnections.
+   * 
+ */ + public abstract static class AppConnectionsServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists AppConnections in a given project and location.
+     * 
+ */ + public void listAppConnections( + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListAppConnectionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single AppConnection.
+     * 
+ */ + public void getAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetAppConnectionMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new AppConnection in a given project and location.
+     * 
+ */ + public void createAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateAppConnectionMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single AppConnection.
+     * 
+ */ + public void updateAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateAppConnectionMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single AppConnection.
+     * 
+ */ + public void deleteAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteAppConnectionMethod(), responseObserver); + } + + /** + * + * + *
+     * Resolves AppConnections details for a given AppConnector.
+     * An internal method called by a connector to find AppConnections to connect
+     * to.
+     * 
+ */ + public void resolveAppConnections( + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getResolveAppConnectionsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListAppConnectionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest, + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse>( + this, METHODID_LIST_APP_CONNECTIONS))) + .addMethod( + getGetAppConnectionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection>( + this, METHODID_GET_APP_CONNECTION))) + .addMethod( + getCreateAppConnectionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_APP_CONNECTION))) + .addMethod( + getUpdateAppConnectionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_APP_CONNECTION))) + .addMethod( + getDeleteAppConnectionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_APP_CONNECTION))) + .addMethod( + getResolveAppConnectionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest, + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse>( + this, METHODID_RESOLVE_APP_CONNECTIONS))) + .build(); + } + } + + /** + * + * + *
+   * ## API Overview
+   * The `beyondcorp.googleapis.com` service implements the Google Cloud
+   * BeyondCorp API.
+   * ## Data Model
+   * The AppConnectionsService exposes the following resources:
+   * * AppConnections, named as follows:
+   *   `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`.
+   * The AppConnectionsService service provides methods to manage
+   * (create/read/update/delete) BeyondCorp AppConnections.
+   * 
+ */ + public static final class AppConnectionsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private AppConnectionsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AppConnectionsServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppConnectionsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists AppConnections in a given project and location.
+     * 
+ */ + public void listAppConnections( + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListAppConnectionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single AppConnection.
+     * 
+ */ + public void getAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetAppConnectionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new AppConnection in a given project and location.
+     * 
+ */ + public void createAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateAppConnectionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single AppConnection.
+     * 
+ */ + public void updateAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateAppConnectionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single AppConnection.
+     * 
+ */ + public void deleteAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteAppConnectionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Resolves AppConnections details for a given AppConnector.
+     * An internal method called by a connector to find AppConnections to connect
+     * to.
+     * 
+ */ + public void resolveAppConnections( + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getResolveAppConnectionsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * ## API Overview
+   * The `beyondcorp.googleapis.com` service implements the Google Cloud
+   * BeyondCorp API.
+   * ## Data Model
+   * The AppConnectionsService exposes the following resources:
+   * * AppConnections, named as follows:
+   *   `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`.
+   * The AppConnectionsService service provides methods to manage
+   * (create/read/update/delete) BeyondCorp AppConnections.
+   * 
+ */ + public static final class AppConnectionsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private AppConnectionsServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AppConnectionsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppConnectionsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists AppConnections in a given project and location.
+     * 
+ */ + public com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse + listAppConnections( + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListAppConnectionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single AppConnection.
+     * 
+ */ + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection getAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetAppConnectionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new AppConnection in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateAppConnectionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of a single AppConnection.
+     * 
+ */ + public com.google.longrunning.Operation updateAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateAppConnectionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single AppConnection.
+     * 
+ */ + public com.google.longrunning.Operation deleteAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteAppConnectionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Resolves AppConnections details for a given AppConnector.
+     * An internal method called by a connector to find AppConnections to connect
+     * to.
+     * 
+ */ + public com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + resolveAppConnections( + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getResolveAppConnectionsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * ## API Overview
+   * The `beyondcorp.googleapis.com` service implements the Google Cloud
+   * BeyondCorp API.
+   * ## Data Model
+   * The AppConnectionsService exposes the following resources:
+   * * AppConnections, named as follows:
+   *   `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`.
+   * The AppConnectionsService service provides methods to manage
+   * (create/read/update/delete) BeyondCorp AppConnections.
+   * 
+ */ + public static final class AppConnectionsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private AppConnectionsServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AppConnectionsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppConnectionsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists AppConnections in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse> + listAppConnections( + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListAppConnectionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single AppConnection.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.beyondcorp.appconnections.v1.AppConnection> + getAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetAppConnectionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new AppConnection in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateAppConnectionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of a single AppConnection.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateAppConnectionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single AppConnection.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteAppConnectionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Resolves AppConnections details for a given AppConnector.
+     * An internal method called by a connector to find AppConnections to connect
+     * to.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse> + resolveAppConnections( + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getResolveAppConnectionsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_APP_CONNECTIONS = 0; + private static final int METHODID_GET_APP_CONNECTION = 1; + private static final int METHODID_CREATE_APP_CONNECTION = 2; + private static final int METHODID_UPDATE_APP_CONNECTION = 3; + private static final int METHODID_DELETE_APP_CONNECTION = 4; + private static final int METHODID_RESOLVE_APP_CONNECTIONS = 5; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AppConnectionsServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(AppConnectionsServiceImplBase 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_APP_CONNECTIONS: + serviceImpl.listAppConnections( + (com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse>) + responseObserver); + break; + case METHODID_GET_APP_CONNECTION: + serviceImpl.getAppConnection( + (com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.beyondcorp.appconnections.v1.AppConnection>) + responseObserver); + break; + case METHODID_CREATE_APP_CONNECTION: + serviceImpl.createAppConnection( + (com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_APP_CONNECTION: + serviceImpl.updateAppConnection( + (com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_APP_CONNECTION: + serviceImpl.deleteAppConnection( + (com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_RESOLVE_APP_CONNECTIONS: + serviceImpl.resolveAppConnections( + (com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse>) + 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 AppConnectionsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + AppConnectionsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("AppConnectionsService"); + } + } + + private static final class AppConnectionsServiceFileDescriptorSupplier + extends AppConnectionsServiceBaseDescriptorSupplier { + AppConnectionsServiceFileDescriptorSupplier() {} + } + + private static final class AppConnectionsServiceMethodDescriptorSupplier + extends AppConnectionsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + AppConnectionsServiceMethodDescriptorSupplier(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 (AppConnectionsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new AppConnectionsServiceFileDescriptorSupplier()) + .addMethod(getListAppConnectionsMethod()) + .addMethod(getGetAppConnectionMethod()) + .addMethod(getCreateAppConnectionMethod()) + .addMethod(getUpdateAppConnectionMethod()) + .addMethod(getDeleteAppConnectionMethod()) + .addMethod(getResolveAppConnectionsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-beyondcorp-appconnections/java.header b/java-beyondcorp-appconnections/java.header new file mode 100644 index 000000000000..d0970ba7d375 --- /dev/null +++ b/java-beyondcorp-appconnections/java.header @@ -0,0 +1,15 @@ +^/\*$ +^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)$ +^ \*$ +^ \* Licensed under the Apache License, Version 2\.0 \(the "License"\);$ +^ \* you may not use this file except in compliance with the License\.$ +^ \* You may obtain a copy of the License at$ +^ \*$ +^ \*[ ]+https?://www.apache.org/licenses/LICENSE-2\.0$ +^ \*$ +^ \* Unless required by applicable law or agreed to in writing, software$ +^ \* distributed under the License is distributed on an "AS IS" BASIS,$ +^ \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.$ +^ \* See the License for the specific language governing permissions and$ +^ \* limitations under the License\.$ +^ \*/$ diff --git a/java-beyondcorp-appconnections/license-checks.xml b/java-beyondcorp-appconnections/license-checks.xml new file mode 100644 index 000000000000..6597fced808e --- /dev/null +++ b/java-beyondcorp-appconnections/license-checks.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/java-beyondcorp-appconnections/owlbot.py b/java-beyondcorp-appconnections/owlbot.py new file mode 100644 index 000000000000..77243461d730 --- /dev/null +++ b/java-beyondcorp-appconnections/owlbot.py @@ -0,0 +1,24 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import synthtool as s +from synthtool.languages import java + + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates() \ No newline at end of file diff --git a/java-beyondcorp-appconnections/pom.xml b/java-beyondcorp-appconnections/pom.xml new file mode 100644 index 000000000000..ff7ed8996c92 --- /dev/null +++ b/java-beyondcorp-appconnections/pom.xml @@ -0,0 +1,188 @@ + + + 4.0.0 + com.google.cloud + google-cloud-beyondcorp-appconnections-parent + pom + 0.0.1-SNAPSHOT + Google BeyondCorp AppConnections Parent + https://github.com/googleapis/java-beyondcorp-appconnections + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-shared-config + 1.5.0 + + + + + chingor + Jeff Ching + chingor@google.com + Google LLC + + Developer + + + + neenushaji + Neenu Shaji + neenushaji@google.com + Google LLC + + Developer + + + + + Google LLC + + + scm:git:git@github.com:googleapis/java-beyondcorp-appconnections.git + scm:git:git@github.com:googleapis/java-beyondcorp-appconnections.git + https://github.com/googleapis/java-beyondcorp-appconnections + HEAD + + + https://github.com/googleapis/java-beyondcorp-appconnections/issues + GitHub Issues + + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + UTF-8 + UTF-8 + github + google-cloud-beyondcorp-appconnections-parent + + + + + + com.google.cloud + google-cloud-beyondcorp-appconnections + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-beyondcorp-appconnections-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-beyondcorp-appconnections-v1 + 0.0.1-SNAPSHOT + + + + com.google.cloud + google-cloud-shared-dependencies + 2.13.0 + pom + import + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + org.objenesis:objenesis + javax.annotation:javax.annotation-api + + + + + + + + + google-cloud-beyondcorp-appconnections + grpc-google-cloud-beyondcorp-appconnections-v1 + proto-google-cloud-beyondcorp-appconnections-v1 + google-cloud-beyondcorp-appconnections-bom + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.3.0 + + + + index + dependency-info + team + ci-management + issue-management + licenses + scm + dependency-management + distribution-management + summary + modules + + + + + true + ${site.installationModule} + jar + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.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/ + + + + + + diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/clirr-ignored-differences.xml b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..692f0dbeebbb --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/beyondcorp/appconnections/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/beyondcorp/appconnections/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/beyondcorp/appconnections/v1/*OrBuilder + boolean has*(*) + + diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/pom.xml b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/pom.xml new file mode 100644 index 000000000000..141dec0c5dc9 --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-beyondcorp-appconnections-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-beyondcorp-appconnections-v1 + Proto library for google-cloud-beyondcorp-appconnections + + com.google.cloud + google-cloud-beyondcorp-appconnections-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnection.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnection.java new file mode 100644 index 000000000000..ff3ea90784a1 --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnection.java @@ -0,0 +1,5724 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto + +package com.google.cloud.beyondcorp.appconnections.v1; + +/** + * + * + *
+ * A BeyondCorp AppConnection resource represents a BeyondCorp protected
+ * AppConnection to a remote application. It creates all the necessary GCP
+ * components needed for creating a BeyondCorp protected AppConnection. Multiple
+ * connectors can be authorised for a single AppConnection.
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appconnections.v1.AppConnection} + */ +public final class AppConnection extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.appconnections.v1.AppConnection) + AppConnectionOrBuilder { + private static final long serialVersionUID = 0L; + // Use AppConnection.newBuilder() to construct. + private AppConnection(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AppConnection() { + name_ = ""; + displayName_ = ""; + uid_ = ""; + type_ = 0; + connectors_ = com.google.protobuf.LazyStringArrayList.EMPTY; + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AppConnection(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AppConnection( + 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(); + + displayName_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + uid_ = s; + break; + } + case 56: + { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 66: + { + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + .Builder + subBuilder = null; + if (applicationEndpoint_ != null) { + subBuilder = applicationEndpoint_.toBuilder(); + } + applicationEndpoint_ = + input.readMessage( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection + .ApplicationEndpoint.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(applicationEndpoint_); + applicationEndpoint_ = subBuilder.buildPartial(); + } + + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + connectors_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + connectors_.add(s); + break; + } + case 80: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 90: + { + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Builder + subBuilder = null; + if (gateway_ != null) { + subBuilder = gateway_.toBuilder(); + } + gateway_ = + input.readMessage( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(gateway_); + gateway_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + connectors_ = connectors_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_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.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.class, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder.class); + } + + /** + * + * + *
+   * Enum containing list of all possible network connectivity options
+   * supported by BeyondCorp AppConnection.
+   * 
+ * + * Protobuf enum {@code google.cloud.beyondcorp.appconnections.v1.AppConnection.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * TCP Proxy based BeyondCorp AppConnection. API will default to this if
+     * unset.
+     * 
+ * + * TCP_PROXY = 1; + */ + TCP_PROXY(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * TCP Proxy based BeyondCorp AppConnection. API will default to this if
+     * unset.
+     * 
+ * + * TCP_PROXY = 1; + */ + public static final int TCP_PROXY_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Type valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return TCP_PROXY; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Type findValueByNumber(int number) { + return Type.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnection.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Type[] VALUES = values(); + + public static Type valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.beyondcorp.appconnections.v1.AppConnection.Type) + } + + /** + * + * + *
+   * Represents the different states of a AppConnection.
+   * 
+ * + * Protobuf enum {@code google.cloud.beyondcorp.appconnections.v1.AppConnection.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * AppConnection is being created.
+     * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + * + * + *
+     * AppConnection has been created.
+     * 
+ * + * CREATED = 2; + */ + CREATED(2), + /** + * + * + *
+     * AppConnection's configuration is being updated.
+     * 
+ * + * UPDATING = 3; + */ + UPDATING(3), + /** + * + * + *
+     * AppConnection is being deleted.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + /** + * + * + *
+     * AppConnection is down and may be restored in the future.
+     * This happens when CCFE sends ProjectState = OFF.
+     * 
+ * + * DOWN = 5; + */ + DOWN(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * AppConnection is being created.
+     * 
+ * + * CREATING = 1; + */ + public static final int CREATING_VALUE = 1; + /** + * + * + *
+     * AppConnection has been created.
+     * 
+ * + * CREATED = 2; + */ + public static final int CREATED_VALUE = 2; + /** + * + * + *
+     * AppConnection's configuration is being updated.
+     * 
+ * + * UPDATING = 3; + */ + public static final int UPDATING_VALUE = 3; + /** + * + * + *
+     * AppConnection is being deleted.
+     * 
+ * + * DELETING = 4; + */ + public static final int DELETING_VALUE = 4; + /** + * + * + *
+     * AppConnection is down and may be restored in the future.
+     * This happens when CCFE sends ProjectState = OFF.
+     * 
+ * + * DOWN = 5; + */ + public static final int DOWN_VALUE = 5; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return CREATING; + case 2: + return CREATED; + case 3: + return UPDATING; + case 4: + return DELETING; + case 5: + return DOWN; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnection.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.beyondcorp.appconnections.v1.AppConnection.State) + } + + public interface ApplicationEndpointOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Hostname or IP address of the remote application endpoint.
+     * 
+ * + * string host = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The host. + */ + java.lang.String getHost(); + /** + * + * + *
+     * Required. Hostname or IP address of the remote application endpoint.
+     * 
+ * + * string host = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for host. + */ + com.google.protobuf.ByteString getHostBytes(); + + /** + * + * + *
+     * Required. Port of the remote application endpoint.
+     * 
+ * + * int32 port = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The port. + */ + int getPort(); + } + /** + * + * + *
+   * ApplicationEndpoint represents a remote application endpoint.
+   * 
+ * + * Protobuf type {@code + * google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint} + */ + public static final class ApplicationEndpoint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint) + ApplicationEndpointOrBuilder { + private static final long serialVersionUID = 0L; + // Use ApplicationEndpoint.newBuilder() to construct. + private ApplicationEndpoint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ApplicationEndpoint() { + host_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ApplicationEndpoint(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ApplicationEndpoint( + 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(); + + host_ = s; + break; + } + case 16: + { + port_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_ApplicationEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_ApplicationEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint.class, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + .Builder.class); + } + + public static final int HOST_FIELD_NUMBER = 1; + private volatile java.lang.Object host_; + /** + * + * + *
+     * Required. Hostname or IP address of the remote application endpoint.
+     * 
+ * + * string host = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The host. + */ + @java.lang.Override + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } + } + /** + * + * + *
+     * Required. Hostname or IP address of the remote application endpoint.
+     * 
+ * + * string host = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for host. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PORT_FIELD_NUMBER = 2; + private int port_; + /** + * + * + *
+     * Required. Port of the remote application endpoint.
+     * 
+ * + * int32 port = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The port. + */ + @java.lang.Override + public int getPort() { + return port_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(host_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, host_); + } + if (port_ != 0) { + output.writeInt32(2, port_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(host_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, host_); + } + if (port_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, port_); + } + 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.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint other = + (com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint) obj; + + if (!getHost().equals(other.getHost())) return false; + if (getPort() != other.getPort()) 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) + HOST_FIELD_NUMBER; + hash = (53 * hash) + getHost().hashCode(); + hash = (37 * hash) + PORT_FIELD_NUMBER; + hash = (53 * hash) + getPort(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + 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.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + 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.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + 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.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + 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.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + 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.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint 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; + } + /** + * + * + *
+     * ApplicationEndpoint represents a remote application endpoint.
+     * 
+ * + * Protobuf type {@code + * google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint) + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpointOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_ApplicationEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_ApplicationEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + .class, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + .Builder.class); + } + + // Construct using + // com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint.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(); + host_ = ""; + + port_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_ApplicationEndpoint_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + build() { + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + buildPartial() { + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint result = + new com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint( + this); + result.host_ = host_; + result.port_ = port_; + 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.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint) { + return mergeFrom( + (com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint other) { + if (other + == com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + .getDefaultInstance()) return this; + if (!other.getHost().isEmpty()) { + host_ = other.host_; + onChanged(); + } + if (other.getPort() != 0) { + setPort(other.getPort()); + } + 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.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object host_ = ""; + /** + * + * + *
+       * Required. Hostname or IP address of the remote application endpoint.
+       * 
+ * + * string host = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The host. + */ + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Required. Hostname or IP address of the remote application endpoint.
+       * 
+ * + * string host = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for host. + */ + public com.google.protobuf.ByteString getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Required. Hostname or IP address of the remote application endpoint.
+       * 
+ * + * string host = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The host to set. + * @return This builder for chaining. + */ + public Builder setHost(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + host_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Hostname or IP address of the remote application endpoint.
+       * 
+ * + * string host = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearHost() { + + host_ = getDefaultInstance().getHost(); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Hostname or IP address of the remote application endpoint.
+       * 
+ * + * string host = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for host to set. + * @return This builder for chaining. + */ + public Builder setHostBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + host_ = value; + onChanged(); + return this; + } + + private int port_; + /** + * + * + *
+       * Required. Port of the remote application endpoint.
+       * 
+ * + * int32 port = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The port. + */ + @java.lang.Override + public int getPort() { + return port_; + } + /** + * + * + *
+       * Required. Port of the remote application endpoint.
+       * 
+ * + * int32 port = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The port to set. + * @return This builder for chaining. + */ + public Builder setPort(int value) { + + port_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Port of the remote application endpoint.
+       * 
+ * + * int32 port = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPort() { + + port_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint) + private static final com.google.cloud.beyondcorp.appconnections.v1.AppConnection + .ApplicationEndpoint + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint(); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ApplicationEndpoint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ApplicationEndpoint(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.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface GatewayOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The type of hosting used by the gateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+     * Required. The type of hosting used by the gateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The type. + */ + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type getType(); + + /** + * + * + *
+     * Output only. Server-defined URI for this resource.
+     * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+     * Output only. Server-defined URI for this resource.
+     * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+     * Output only. Ingress port reserved on the gateways for this
+     * AppConnection, if not specified or zero, the default port is 19443.
+     * 
+ * + * int32 ingress_port = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The ingressPort. + */ + int getIngressPort(); + + /** + * + * + *
+     * Required. AppGateway name in following format:
+     * `projects/{project_id}/locations/{location_id}/appgateways/{gateway_id}`
+     * 
+ * + * + * string app_gateway = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The appGateway. + */ + java.lang.String getAppGateway(); + /** + * + * + *
+     * Required. AppGateway name in following format:
+     * `projects/{project_id}/locations/{location_id}/appgateways/{gateway_id}`
+     * 
+ * + * + * string app_gateway = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for appGateway. + */ + com.google.protobuf.ByteString getAppGatewayBytes(); + } + /** + * + * + *
+   * Gateway represents a user facing component that serves as an entrance to
+   * enable connectivity.
+   * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway} + */ + public static final class Gateway extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway) + GatewayOrBuilder { + private static final long serialVersionUID = 0L; + // Use Gateway.newBuilder() to construct. + private Gateway(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Gateway() { + type_ = 0; + uri_ = ""; + appGateway_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Gateway(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Gateway( + 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 16: + { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + break; + } + case 32: + { + ingressPort_ = input.readInt32(); + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + appGateway_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_Gateway_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_Gateway_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.class, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Builder.class); + } + + /** + * + * + *
+     * Enum listing possible gateway hosting options.
+     * 
+ * + * Protobuf enum {@code google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Default value. This value is unused.
+       * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+       * Gateway hosted in a GCP regional managed instance group.
+       * 
+ * + * GCP_REGIONAL_MIG = 1; + */ + GCP_REGIONAL_MIG(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Default value. This value is unused.
+       * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Gateway hosted in a GCP regional managed instance group.
+       * 
+ * + * GCP_REGIONAL_MIG = 1; + */ + public static final int GCP_REGIONAL_MIG_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Type valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return GCP_REGIONAL_MIG; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Type findValueByNumber(int number) { + return Type.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Type[] VALUES = values(); + + public static Type valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type) + } + + public static final int TYPE_FIELD_NUMBER = 2; + private int type_; + /** + * + * + *
+     * Required. The type of hosting used by the gateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * Required. The type of hosting used by the gateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type getType() { + @SuppressWarnings("deprecation") + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type result = + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type.valueOf(type_); + return result == null + ? com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type.UNRECOGNIZED + : result; + } + + public static final int URI_FIELD_NUMBER = 3; + private volatile java.lang.Object uri_; + /** + * + * + *
+     * Output only. Server-defined URI for this resource.
+     * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } + } + /** + * + * + *
+     * Output only. Server-defined URI for this resource.
+     * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INGRESS_PORT_FIELD_NUMBER = 4; + private int ingressPort_; + /** + * + * + *
+     * Output only. Ingress port reserved on the gateways for this
+     * AppConnection, if not specified or zero, the default port is 19443.
+     * 
+ * + * int32 ingress_port = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The ingressPort. + */ + @java.lang.Override + public int getIngressPort() { + return ingressPort_; + } + + public static final int APP_GATEWAY_FIELD_NUMBER = 5; + private volatile java.lang.Object appGateway_; + /** + * + * + *
+     * Required. AppGateway name in following format:
+     * `projects/{project_id}/locations/{location_id}/appgateways/{gateway_id}`
+     * 
+ * + * + * string app_gateway = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The appGateway. + */ + @java.lang.Override + public java.lang.String getAppGateway() { + java.lang.Object ref = appGateway_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appGateway_ = s; + return s; + } + } + /** + * + * + *
+     * Required. AppGateway name in following format:
+     * `projects/{project_id}/locations/{location_id}/appgateways/{gateway_id}`
+     * 
+ * + * + * string app_gateway = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for appGateway. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAppGatewayBytes() { + java.lang.Object ref = appGateway_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + appGateway_ = 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 (type_ + != com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type + .TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uri_); + } + if (ingressPort_ != 0) { + output.writeInt32(4, ingressPort_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appGateway_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, appGateway_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ + != com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type + .TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uri_); + } + if (ingressPort_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, ingressPort_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appGateway_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, appGateway_); + } + 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.beyondcorp.appconnections.v1.AppConnection.Gateway)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway other = + (com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway) obj; + + if (type_ != other.type_) return false; + if (!getUri().equals(other.getUri())) return false; + if (getIngressPort() != other.getIngressPort()) return false; + if (!getAppGateway().equals(other.getAppGateway())) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (37 * hash) + INGRESS_PORT_FIELD_NUMBER; + hash = (53 * hash) + getIngressPort(); + hash = (37 * hash) + APP_GATEWAY_FIELD_NUMBER; + hash = (53 * hash) + getAppGateway().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway 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.beyondcorp.appconnections.v1.AppConnection.Gateway parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway 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.beyondcorp.appconnections.v1.AppConnection.Gateway parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway 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.beyondcorp.appconnections.v1.AppConnection.Gateway + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway + 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.beyondcorp.appconnections.v1.AppConnection.Gateway parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway 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.beyondcorp.appconnections.v1.AppConnection.Gateway 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; + } + /** + * + * + *
+     * Gateway represents a user facing component that serves as an entrance to
+     * enable connectivity.
+     * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway) + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.GatewayOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_Gateway_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_Gateway_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.class, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Builder.class); + } + + // Construct using + // com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.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(); + type_ = 0; + + uri_ = ""; + + ingressPort_ = 0; + + appGateway_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_Gateway_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway build() { + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway buildPartial() { + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway result = + new com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway(this); + result.type_ = type_; + result.uri_ = uri_; + result.ingressPort_ = ingressPort_; + result.appGateway_ = appGateway_; + 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.beyondcorp.appconnections.v1.AppConnection.Gateway) { + return mergeFrom( + (com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway other) { + if (other + == com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway + .getDefaultInstance()) return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (other.getIngressPort() != 0) { + setIngressPort(other.getIngressPort()); + } + if (!other.getAppGateway().isEmpty()) { + appGateway_ = other.appGateway_; + 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.beyondcorp.appconnections.v1.AppConnection.Gateway parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int type_ = 0; + /** + * + * + *
+       * Required. The type of hosting used by the gateway.
+       * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+       * Required. The type of hosting used by the gateway.
+       * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The type of hosting used by the gateway.
+       * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type getType() { + @SuppressWarnings("deprecation") + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type result = + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type.valueOf(type_); + return result == null + ? com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Required. The type of hosting used by the gateway.
+       * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The type of hosting used by the gateway.
+       * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object uri_ = ""; + /** + * + * + *
+       * Output only. Server-defined URI for this resource.
+       * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Output only. Server-defined URI for this resource.
+       * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Output only. Server-defined URI for this resource.
+       * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Server-defined URI for this resource.
+       * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Server-defined URI for this resource.
+       * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + + private int ingressPort_; + /** + * + * + *
+       * Output only. Ingress port reserved on the gateways for this
+       * AppConnection, if not specified or zero, the default port is 19443.
+       * 
+ * + * int32 ingress_port = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The ingressPort. + */ + @java.lang.Override + public int getIngressPort() { + return ingressPort_; + } + /** + * + * + *
+       * Output only. Ingress port reserved on the gateways for this
+       * AppConnection, if not specified or zero, the default port is 19443.
+       * 
+ * + * int32 ingress_port = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The ingressPort to set. + * @return This builder for chaining. + */ + public Builder setIngressPort(int value) { + + ingressPort_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Ingress port reserved on the gateways for this
+       * AppConnection, if not specified or zero, the default port is 19443.
+       * 
+ * + * int32 ingress_port = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearIngressPort() { + + ingressPort_ = 0; + onChanged(); + return this; + } + + private java.lang.Object appGateway_ = ""; + /** + * + * + *
+       * Required. AppGateway name in following format:
+       * `projects/{project_id}/locations/{location_id}/appgateways/{gateway_id}`
+       * 
+ * + * + * string app_gateway = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The appGateway. + */ + public java.lang.String getAppGateway() { + java.lang.Object ref = appGateway_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appGateway_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Required. AppGateway name in following format:
+       * `projects/{project_id}/locations/{location_id}/appgateways/{gateway_id}`
+       * 
+ * + * + * string app_gateway = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for appGateway. + */ + public com.google.protobuf.ByteString getAppGatewayBytes() { + java.lang.Object ref = appGateway_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + appGateway_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Required. AppGateway name in following format:
+       * `projects/{project_id}/locations/{location_id}/appgateways/{gateway_id}`
+       * 
+ * + * + * string app_gateway = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The appGateway to set. + * @return This builder for chaining. + */ + public Builder setAppGateway(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + appGateway_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. AppGateway name in following format:
+       * `projects/{project_id}/locations/{location_id}/appgateways/{gateway_id}`
+       * 
+ * + * + * string app_gateway = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearAppGateway() { + + appGateway_ = getDefaultInstance().getAppGateway(); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. AppGateway name in following format:
+       * `projects/{project_id}/locations/{location_id}/appgateways/{gateway_id}`
+       * 
+ * + * + * string app_gateway = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for appGateway to set. + * @return This builder for chaining. + */ + public Builder setAppGatewayBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + appGateway_ = 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.beyondcorp.appconnections.v1.AppConnection.Gateway) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway) + private static final com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway(); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Gateway parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Gateway(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.beyondcorp.appconnections.v1.AppConnection.Gateway + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Unique resource name of the AppConnection.
+   * The name is ignored when creating a AppConnection.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Unique resource name of the AppConnection.
+   * The name is ignored when creating a AppConnection.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.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. Timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @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_; + /** + * + * + *
+   * Output only. Timestamp when the resource was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Timestamp when the resource was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Timestamp when the resource was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @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.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Optional. Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Optional. Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Optional. Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 5; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Optional. An arbitrary user-provided name for the AppConnection. Cannot
+   * exceed 64 characters.
+   * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An arbitrary user-provided name for the AppConnection. Cannot
+   * exceed 64 characters.
+   * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UID_FIELD_NUMBER = 6; + private volatile java.lang.Object uid_; + /** + * + * + *
+   * Output only. A unique identifier for the instance generated by the
+   * system.
+   * 
+ * + * string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + @java.lang.Override + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. A unique identifier for the instance generated by the
+   * system.
+   * 
+ * + * string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 7; + private int type_; + /** + * + * + *
+   * Required. The type of network connectivity used by the AppConnection.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+   * Required. The type of network connectivity used by the AppConnection.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Type getType() { + @SuppressWarnings("deprecation") + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Type result = + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Type.valueOf(type_); + return result == null + ? com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Type.UNRECOGNIZED + : result; + } + + public static final int APPLICATION_ENDPOINT_FIELD_NUMBER = 8; + private com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + applicationEndpoint_; + /** + * + * + *
+   * Required. Address of the remote application endpoint for the BeyondCorp
+   * AppConnection.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint application_endpoint = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the applicationEndpoint field is set. + */ + @java.lang.Override + public boolean hasApplicationEndpoint() { + return applicationEndpoint_ != null; + } + /** + * + * + *
+   * Required. Address of the remote application endpoint for the BeyondCorp
+   * AppConnection.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint application_endpoint = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The applicationEndpoint. + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + getApplicationEndpoint() { + return applicationEndpoint_ == null + ? com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + .getDefaultInstance() + : applicationEndpoint_; + } + /** + * + * + *
+   * Required. Address of the remote application endpoint for the BeyondCorp
+   * AppConnection.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint application_endpoint = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpointOrBuilder + getApplicationEndpointOrBuilder() { + return getApplicationEndpoint(); + } + + public static final int CONNECTORS_FIELD_NUMBER = 9; + private com.google.protobuf.LazyStringList connectors_; + /** + * + * + *
+   * Optional. List of [google.cloud.beyondcorp.v1main.Connector.name] that are
+   * authorised to be associated with this AppConnection.
+   * 
+ * + * repeated string connectors = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the connectors. + */ + public com.google.protobuf.ProtocolStringList getConnectorsList() { + return connectors_; + } + /** + * + * + *
+   * Optional. List of [google.cloud.beyondcorp.v1main.Connector.name] that are
+   * authorised to be associated with this AppConnection.
+   * 
+ * + * repeated string connectors = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of connectors. + */ + public int getConnectorsCount() { + return connectors_.size(); + } + /** + * + * + *
+   * Optional. List of [google.cloud.beyondcorp.v1main.Connector.name] that are
+   * authorised to be associated with this AppConnection.
+   * 
+ * + * repeated string connectors = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The connectors at the given index. + */ + public java.lang.String getConnectors(int index) { + return connectors_.get(index); + } + /** + * + * + *
+   * Optional. List of [google.cloud.beyondcorp.v1main.Connector.name] that are
+   * authorised to be associated with this AppConnection.
+   * 
+ * + * repeated string connectors = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the connectors at the given index. + */ + public com.google.protobuf.ByteString getConnectorsBytes(int index) { + return connectors_.getByteString(index); + } + + public static final int STATE_FIELD_NUMBER = 10; + private int state_; + /** + * + * + *
+   * Output only. The current state of the AppConnection.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. The current state of the AppConnection.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.State result = + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.State.valueOf(state_); + return result == null + ? com.google.cloud.beyondcorp.appconnections.v1.AppConnection.State.UNRECOGNIZED + : result; + } + + public static final int GATEWAY_FIELD_NUMBER = 11; + private com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway gateway_; + /** + * + * + *
+   * Optional. Gateway used by the AppConnection.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway gateway = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the gateway field is set. + */ + @java.lang.Override + public boolean hasGateway() { + return gateway_ != null; + } + /** + * + * + *
+   * Optional. Gateway used by the AppConnection.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway gateway = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The gateway. + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway getGateway() { + return gateway_ == null + ? com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.getDefaultInstance() + : gateway_; + } + /** + * + * + *
+   * Optional. Gateway used by the AppConnection.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway gateway = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.GatewayOrBuilder + getGatewayOrBuilder() { + return getGateway(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (createTime_ != null) { + output.writeMessage(2, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(3, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, uid_); + } + if (type_ + != com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Type.TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, type_); + } + if (applicationEndpoint_ != null) { + output.writeMessage(8, getApplicationEndpoint()); + } + for (int i = 0; i < connectors_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, connectors_.getRaw(i)); + } + if (state_ + != com.google.cloud.beyondcorp.appconnections.v1.AppConnection.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(10, state_); + } + if (gateway_ != null) { + output.writeMessage(11, getGateway()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, uid_); + } + if (type_ + != com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Type.TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, type_); + } + if (applicationEndpoint_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getApplicationEndpoint()); + } + { + int dataSize = 0; + for (int i = 0; i < connectors_.size(); i++) { + dataSize += computeStringSizeNoTag(connectors_.getRaw(i)); + } + size += dataSize; + size += 1 * getConnectorsList().size(); + } + if (state_ + != com.google.cloud.beyondcorp.appconnections.v1.AppConnection.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, state_); + } + if (gateway_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getGateway()); + } + 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.beyondcorp.appconnections.v1.AppConnection)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.appconnections.v1.AppConnection other = + (com.google.cloud.beyondcorp.appconnections.v1.AppConnection) 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 (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getUid().equals(other.getUid())) return false; + if (type_ != other.type_) return false; + if (hasApplicationEndpoint() != other.hasApplicationEndpoint()) return false; + if (hasApplicationEndpoint()) { + if (!getApplicationEndpoint().equals(other.getApplicationEndpoint())) return false; + } + if (!getConnectorsList().equals(other.getConnectorsList())) return false; + if (state_ != other.state_) return false; + if (hasGateway() != other.hasGateway()) return false; + if (hasGateway()) { + if (!getGateway().equals(other.getGateway())) 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) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + if (hasApplicationEndpoint()) { + hash = (37 * hash) + APPLICATION_ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getApplicationEndpoint().hashCode(); + } + if (getConnectorsCount() > 0) { + hash = (37 * hash) + CONNECTORS_FIELD_NUMBER; + hash = (53 * hash) + getConnectorsList().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasGateway()) { + hash = (37 * hash) + GATEWAY_FIELD_NUMBER; + hash = (53 * hash) + getGateway().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection 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.beyondcorp.appconnections.v1.AppConnection parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection 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.beyondcorp.appconnections.v1.AppConnection parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection 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.beyondcorp.appconnections.v1.AppConnection parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection 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.beyondcorp.appconnections.v1.AppConnection parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection 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.beyondcorp.appconnections.v1.AppConnection 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 BeyondCorp AppConnection resource represents a BeyondCorp protected
+   * AppConnection to a remote application. It creates all the necessary GCP
+   * components needed for creating a BeyondCorp protected AppConnection. Multiple
+   * connectors can be authorised for a single AppConnection.
+   * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appconnections.v1.AppConnection} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.appconnections.v1.AppConnection) + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_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.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.class, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder.class); + } + + // Construct using com.google.cloud.beyondcorp.appconnections.v1.AppConnection.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(); + displayName_ = ""; + + uid_ = ""; + + type_ = 0; + + if (applicationEndpointBuilder_ == null) { + applicationEndpoint_ = null; + } else { + applicationEndpoint_ = null; + applicationEndpointBuilder_ = null; + } + connectors_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + state_ = 0; + + if (gatewayBuilder_ == null) { + gateway_ = null; + } else { + gateway_ = null; + gatewayBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnection.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection build() { + com.google.cloud.beyondcorp.appconnections.v1.AppConnection result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection buildPartial() { + com.google.cloud.beyondcorp.appconnections.v1.AppConnection result = + new com.google.cloud.beyondcorp.appconnections.v1.AppConnection(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.displayName_ = displayName_; + result.uid_ = uid_; + result.type_ = type_; + if (applicationEndpointBuilder_ == null) { + result.applicationEndpoint_ = applicationEndpoint_; + } else { + result.applicationEndpoint_ = applicationEndpointBuilder_.build(); + } + if (((bitField0_ & 0x00000002) != 0)) { + connectors_ = connectors_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.connectors_ = connectors_; + result.state_ = state_; + if (gatewayBuilder_ == null) { + result.gateway_ = gateway_; + } else { + result.gateway_ = gatewayBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.beyondcorp.appconnections.v1.AppConnection) { + return mergeFrom((com.google.cloud.beyondcorp.appconnections.v1.AppConnection) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.beyondcorp.appconnections.v1.AppConnection other) { + if (other == com.google.cloud.beyondcorp.appconnections.v1.AppConnection.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.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + onChanged(); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.hasApplicationEndpoint()) { + mergeApplicationEndpoint(other.getApplicationEndpoint()); + } + if (!other.connectors_.isEmpty()) { + if (connectors_.isEmpty()) { + connectors_ = other.connectors_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureConnectorsIsMutable(); + connectors_.addAll(other.connectors_); + } + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasGateway()) { + mergeGateway(other.getGateway()); + } + 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.beyondcorp.appconnections.v1.AppConnection parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.appconnections.v1.AppConnection) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Unique resource name of the AppConnection.
+     * The name is ignored when creating a AppConnection.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Unique resource name of the AppConnection.
+     * The name is ignored when creating a AppConnection.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Unique resource name of the AppConnection.
+     * The name is ignored when creating a AppConnection.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Unique resource name of the AppConnection.
+     * The name is ignored when creating a AppConnection.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Unique resource name of the AppConnection.
+     * The name is ignored when creating a AppConnection.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. Timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_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> + 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_; + /** + * + * + *
+     * Output only. Timestamp when the resource was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. Timestamp when the resource was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Timestamp when the resource was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the resource was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the resource was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the resource was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the resource was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Timestamp when the resource was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Timestamp when the resource was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Optional. Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Optional. Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Optional. Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Optional. Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Optional. Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Optional. An arbitrary user-provided name for the AppConnection. Cannot
+     * exceed 64 characters.
+     * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An arbitrary user-provided name for the AppConnection. Cannot
+     * exceed 64 characters.
+     * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An arbitrary user-provided name for the AppConnection. Cannot
+     * exceed 64 characters.
+     * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An arbitrary user-provided name for the AppConnection. Cannot
+     * exceed 64 characters.
+     * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An arbitrary user-provided name for the AppConnection. Cannot
+     * exceed 64 characters.
+     * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object uid_ = ""; + /** + * + * + *
+     * Output only. A unique identifier for the instance generated by the
+     * system.
+     * 
+ * + * string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. A unique identifier for the instance generated by the
+     * system.
+     * 
+ * + * string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. A unique identifier for the instance generated by the
+     * system.
+     * 
+ * + * string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uid to set. + * @return This builder for chaining. + */ + public Builder setUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uid_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A unique identifier for the instance generated by the
+     * system.
+     * 
+ * + * string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUid() { + + uid_ = getDefaultInstance().getUid(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A unique identifier for the instance generated by the
+     * system.
+     * 
+ * + * string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uid to set. + * @return This builder for chaining. + */ + public Builder setUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uid_ = value; + onChanged(); + return this; + } + + private int type_ = 0; + /** + * + * + *
+     * Required. The type of network connectivity used by the AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * Required. The type of network connectivity used by the AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of network connectivity used by the AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Type getType() { + @SuppressWarnings("deprecation") + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Type result = + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Type.valueOf(type_); + return result == null + ? com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Type.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. The type of network connectivity used by the AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Type value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of network connectivity used by the AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + applicationEndpoint_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint.Builder, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection + .ApplicationEndpointOrBuilder> + applicationEndpointBuilder_; + /** + * + * + *
+     * Required. Address of the remote application endpoint for the BeyondCorp
+     * AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint application_endpoint = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the applicationEndpoint field is set. + */ + public boolean hasApplicationEndpoint() { + return applicationEndpointBuilder_ != null || applicationEndpoint_ != null; + } + /** + * + * + *
+     * Required. Address of the remote application endpoint for the BeyondCorp
+     * AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint application_endpoint = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The applicationEndpoint. + */ + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + getApplicationEndpoint() { + if (applicationEndpointBuilder_ == null) { + return applicationEndpoint_ == null + ? com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + .getDefaultInstance() + : applicationEndpoint_; + } else { + return applicationEndpointBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Address of the remote application endpoint for the BeyondCorp
+     * AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint application_endpoint = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setApplicationEndpoint( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint value) { + if (applicationEndpointBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + applicationEndpoint_ = value; + onChanged(); + } else { + applicationEndpointBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Address of the remote application endpoint for the BeyondCorp
+     * AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint application_endpoint = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setApplicationEndpoint( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint.Builder + builderForValue) { + if (applicationEndpointBuilder_ == null) { + applicationEndpoint_ = builderForValue.build(); + onChanged(); + } else { + applicationEndpointBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Address of the remote application endpoint for the BeyondCorp
+     * AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint application_endpoint = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeApplicationEndpoint( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint value) { + if (applicationEndpointBuilder_ == null) { + if (applicationEndpoint_ != null) { + applicationEndpoint_ = + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + .newBuilder(applicationEndpoint_) + .mergeFrom(value) + .buildPartial(); + } else { + applicationEndpoint_ = value; + } + onChanged(); + } else { + applicationEndpointBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Address of the remote application endpoint for the BeyondCorp
+     * AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint application_endpoint = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearApplicationEndpoint() { + if (applicationEndpointBuilder_ == null) { + applicationEndpoint_ = null; + onChanged(); + } else { + applicationEndpoint_ = null; + applicationEndpointBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Address of the remote application endpoint for the BeyondCorp
+     * AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint application_endpoint = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint.Builder + getApplicationEndpointBuilder() { + + onChanged(); + return getApplicationEndpointFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Address of the remote application endpoint for the BeyondCorp
+     * AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint application_endpoint = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpointOrBuilder + getApplicationEndpointOrBuilder() { + if (applicationEndpointBuilder_ != null) { + return applicationEndpointBuilder_.getMessageOrBuilder(); + } else { + return applicationEndpoint_ == null + ? com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + .getDefaultInstance() + : applicationEndpoint_; + } + } + /** + * + * + *
+     * Required. Address of the remote application endpoint for the BeyondCorp
+     * AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint application_endpoint = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint.Builder, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection + .ApplicationEndpointOrBuilder> + getApplicationEndpointFieldBuilder() { + if (applicationEndpointBuilder_ == null) { + applicationEndpointBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + .Builder, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection + .ApplicationEndpointOrBuilder>( + getApplicationEndpoint(), getParentForChildren(), isClean()); + applicationEndpoint_ = null; + } + return applicationEndpointBuilder_; + } + + private com.google.protobuf.LazyStringList connectors_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureConnectorsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + connectors_ = new com.google.protobuf.LazyStringArrayList(connectors_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Optional. List of [google.cloud.beyondcorp.v1main.Connector.name] that are
+     * authorised to be associated with this AppConnection.
+     * 
+ * + * repeated string connectors = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the connectors. + */ + public com.google.protobuf.ProtocolStringList getConnectorsList() { + return connectors_.getUnmodifiableView(); + } + /** + * + * + *
+     * Optional. List of [google.cloud.beyondcorp.v1main.Connector.name] that are
+     * authorised to be associated with this AppConnection.
+     * 
+ * + * repeated string connectors = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of connectors. + */ + public int getConnectorsCount() { + return connectors_.size(); + } + /** + * + * + *
+     * Optional. List of [google.cloud.beyondcorp.v1main.Connector.name] that are
+     * authorised to be associated with this AppConnection.
+     * 
+ * + * repeated string connectors = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The connectors at the given index. + */ + public java.lang.String getConnectors(int index) { + return connectors_.get(index); + } + /** + * + * + *
+     * Optional. List of [google.cloud.beyondcorp.v1main.Connector.name] that are
+     * authorised to be associated with this AppConnection.
+     * 
+ * + * repeated string connectors = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the connectors at the given index. + */ + public com.google.protobuf.ByteString getConnectorsBytes(int index) { + return connectors_.getByteString(index); + } + /** + * + * + *
+     * Optional. List of [google.cloud.beyondcorp.v1main.Connector.name] that are
+     * authorised to be associated with this AppConnection.
+     * 
+ * + * repeated string connectors = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The connectors to set. + * @return This builder for chaining. + */ + public Builder setConnectors(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureConnectorsIsMutable(); + connectors_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of [google.cloud.beyondcorp.v1main.Connector.name] that are
+     * authorised to be associated with this AppConnection.
+     * 
+ * + * repeated string connectors = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The connectors to add. + * @return This builder for chaining. + */ + public Builder addConnectors(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureConnectorsIsMutable(); + connectors_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of [google.cloud.beyondcorp.v1main.Connector.name] that are
+     * authorised to be associated with this AppConnection.
+     * 
+ * + * repeated string connectors = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The connectors to add. + * @return This builder for chaining. + */ + public Builder addAllConnectors(java.lang.Iterable values) { + ensureConnectorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, connectors_); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of [google.cloud.beyondcorp.v1main.Connector.name] that are
+     * authorised to be associated with this AppConnection.
+     * 
+ * + * repeated string connectors = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearConnectors() { + connectors_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of [google.cloud.beyondcorp.v1main.Connector.name] that are
+     * authorised to be associated with this AppConnection.
+     * 
+ * + * repeated string connectors = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the connectors to add. + * @return This builder for chaining. + */ + public Builder addConnectorsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureConnectorsIsMutable(); + connectors_.add(value); + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The current state of the AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. The current state of the AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of the AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.State result = + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.State.valueOf(state_); + return result == null + ? com.google.cloud.beyondcorp.appconnections.v1.AppConnection.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The current state of the AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of the AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway gateway_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Builder, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.GatewayOrBuilder> + gatewayBuilder_; + /** + * + * + *
+     * Optional. Gateway used by the AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway gateway = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the gateway field is set. + */ + public boolean hasGateway() { + return gatewayBuilder_ != null || gateway_ != null; + } + /** + * + * + *
+     * Optional. Gateway used by the AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway gateway = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The gateway. + */ + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway getGateway() { + if (gatewayBuilder_ == null) { + return gateway_ == null + ? com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway + .getDefaultInstance() + : gateway_; + } else { + return gatewayBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Gateway used by the AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway gateway = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setGateway( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway value) { + if (gatewayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gateway_ = value; + onChanged(); + } else { + gatewayBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Gateway used by the AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway gateway = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setGateway( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Builder + builderForValue) { + if (gatewayBuilder_ == null) { + gateway_ = builderForValue.build(); + onChanged(); + } else { + gatewayBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Gateway used by the AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway gateway = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeGateway( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway value) { + if (gatewayBuilder_ == null) { + if (gateway_ != null) { + gateway_ = + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.newBuilder( + gateway_) + .mergeFrom(value) + .buildPartial(); + } else { + gateway_ = value; + } + onChanged(); + } else { + gatewayBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Gateway used by the AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway gateway = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearGateway() { + if (gatewayBuilder_ == null) { + gateway_ = null; + onChanged(); + } else { + gateway_ = null; + gatewayBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Gateway used by the AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway gateway = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Builder + getGatewayBuilder() { + + onChanged(); + return getGatewayFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Gateway used by the AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway gateway = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.GatewayOrBuilder + getGatewayOrBuilder() { + if (gatewayBuilder_ != null) { + return gatewayBuilder_.getMessageOrBuilder(); + } else { + return gateway_ == null + ? com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway + .getDefaultInstance() + : gateway_; + } + } + /** + * + * + *
+     * Optional. Gateway used by the AppConnection.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway gateway = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Builder, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.GatewayOrBuilder> + getGatewayFieldBuilder() { + if (gatewayBuilder_ == null) { + gatewayBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Builder, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.GatewayOrBuilder>( + getGateway(), getParentForChildren(), isClean()); + gateway_ = null; + } + return gatewayBuilder_; + } + + @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.beyondcorp.appconnections.v1.AppConnection) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.appconnections.v1.AppConnection) + private static final com.google.cloud.beyondcorp.appconnections.v1.AppConnection DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.beyondcorp.appconnections.v1.AppConnection(); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnection getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AppConnection parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AppConnection(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.beyondcorp.appconnections.v1.AppConnection getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionName.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionName.java new file mode 100644 index 000000000000..a2bdc8dcc101 --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionName.java @@ -0,0 +1,227 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.beyondcorp.appconnections.v1; + +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 AppConnectionName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_APP_CONNECTION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/appConnections/{app_connection}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String appConnection; + + @Deprecated + protected AppConnectionName() { + project = null; + location = null; + appConnection = null; + } + + private AppConnectionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + appConnection = Preconditions.checkNotNull(builder.getAppConnection()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAppConnection() { + return appConnection; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static AppConnectionName of(String project, String location, String appConnection) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAppConnection(appConnection) + .build(); + } + + public static String format(String project, String location, String appConnection) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAppConnection(appConnection) + .build() + .toString(); + } + + public static AppConnectionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_APP_CONNECTION.validatedMatch( + formattedString, "AppConnectionName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("app_connection")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (AppConnectionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_APP_CONNECTION.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 (appConnection != null) { + fieldMapBuilder.put("app_connection", appConnection); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_APP_CONNECTION.instantiate( + "project", project, "location", location, "app_connection", appConnection); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + AppConnectionName that = ((AppConnectionName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.appConnection, that.appConnection); + } + 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(appConnection); + return h; + } + + /** Builder for projects/{project}/locations/{location}/appConnections/{app_connection}. */ + public static class Builder { + private String project; + private String location; + private String appConnection; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAppConnection() { + return appConnection; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setAppConnection(String appConnection) { + this.appConnection = appConnection; + return this; + } + + private Builder(AppConnectionName appConnectionName) { + this.project = appConnectionName.project; + this.location = appConnectionName.location; + this.appConnection = appConnectionName.appConnection; + } + + public AppConnectionName build() { + return new AppConnectionName(this); + } + } +} diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionOperationMetadata.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionOperationMetadata.java new file mode 100644 index 000000000000..de90546713b9 --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionOperationMetadata.java @@ -0,0 +1,1880 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto + +package com.google.cloud.beyondcorp.appconnections.v1; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata} + */ +public final class AppConnectionOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata) + AppConnectionOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use AppConnectionOperationMetadata.newBuilder() to construct. + private AppConnectionOperationMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AppConnectionOperationMetadata() { + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AppConnectionOperationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AppConnectionOperationMetadata( + 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnectionOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnectionOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata.class, + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusMessage_); + } + if (requestedCancellation_ != false) { + output.writeBool(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusMessage_); + } + if (requestedCancellation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + 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.beyondcorp.appconnections.v1.AppConnectionOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata other = + (com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata) 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.beyondcorp.appconnections.v1.AppConnectionOperationMetadata + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata + 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.beyondcorp.appconnections.v1.AppConnectionOperationMetadata + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata + 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.beyondcorp.appconnections.v1.AppConnectionOperationMetadata + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata + 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.beyondcorp.appconnections.v1.AppConnectionOperationMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata + 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.beyondcorp.appconnections.v1.AppConnectionOperationMetadata + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata + 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.beyondcorp.appconnections.v1.AppConnectionOperationMetadata 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.beyondcorp.appconnections.v1.AppConnectionOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata) + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnectionOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnectionOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata.class, + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata.Builder + .class); + } + + // Construct using + // com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata.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.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnectionOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata build() { + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata + buildPartial() { + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata result = + new com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata(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.beyondcorp.appconnections.v1.AppConnectionOperationMetadata) { + return mergeFrom( + (com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata other) { + if (other + == com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata + .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.beyondcorp.appconnections.v1.AppConnectionOperationMetadata parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata) + 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.beyondcorp.appconnections.v1.AppConnectionOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata) + private static final com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata(); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AppConnectionOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AppConnectionOperationMetadata(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.beyondcorp.appconnections.v1.AppConnectionOperationMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionOperationMetadataOrBuilder.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionOperationMetadataOrBuilder.java new file mode 100644 index 000000000000..9ae33e4b25ec --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionOperationMetadataOrBuilder.java @@ -0,0 +1,218 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto + +package com.google.cloud.beyondcorp.appconnections.v1; + +public interface AppConnectionOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata) + 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/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionOrBuilder.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionOrBuilder.java new file mode 100644 index 000000000000..6ee967c78485 --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionOrBuilder.java @@ -0,0 +1,442 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto + +package com.google.cloud.beyondcorp.appconnections.v1; + +public interface AppConnectionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.appconnections.v1.AppConnection) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Unique resource name of the AppConnection.
+   * The name is ignored when creating a AppConnection.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Unique resource name of the AppConnection.
+   * The name is ignored when creating a AppConnection.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Timestamp when the resource was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Timestamp when the resource was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Timestamp when the resource was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Optional. Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + int getLabelsCount(); + /** + * + * + *
+   * Optional. Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Optional. Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Optional. Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Optional. Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Optional. An arbitrary user-provided name for the AppConnection. Cannot
+   * exceed 64 characters.
+   * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Optional. An arbitrary user-provided name for the AppConnection. Cannot
+   * exceed 64 characters.
+   * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. A unique identifier for the instance generated by the
+   * system.
+   * 
+ * + * string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + java.lang.String getUid(); + /** + * + * + *
+   * Output only. A unique identifier for the instance generated by the
+   * system.
+   * 
+ * + * string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Required. The type of network connectivity used by the AppConnection.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+   * Required. The type of network connectivity used by the AppConnection.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The type. + */ + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Type getType(); + + /** + * + * + *
+   * Required. Address of the remote application endpoint for the BeyondCorp
+   * AppConnection.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint application_endpoint = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the applicationEndpoint field is set. + */ + boolean hasApplicationEndpoint(); + /** + * + * + *
+   * Required. Address of the remote application endpoint for the BeyondCorp
+   * AppConnection.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint application_endpoint = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The applicationEndpoint. + */ + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint + getApplicationEndpoint(); + /** + * + * + *
+   * Required. Address of the remote application endpoint for the BeyondCorp
+   * AppConnection.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint application_endpoint = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpointOrBuilder + getApplicationEndpointOrBuilder(); + + /** + * + * + *
+   * Optional. List of [google.cloud.beyondcorp.v1main.Connector.name] that are
+   * authorised to be associated with this AppConnection.
+   * 
+ * + * repeated string connectors = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the connectors. + */ + java.util.List getConnectorsList(); + /** + * + * + *
+   * Optional. List of [google.cloud.beyondcorp.v1main.Connector.name] that are
+   * authorised to be associated with this AppConnection.
+   * 
+ * + * repeated string connectors = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of connectors. + */ + int getConnectorsCount(); + /** + * + * + *
+   * Optional. List of [google.cloud.beyondcorp.v1main.Connector.name] that are
+   * authorised to be associated with this AppConnection.
+   * 
+ * + * repeated string connectors = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The connectors at the given index. + */ + java.lang.String getConnectors(int index); + /** + * + * + *
+   * Optional. List of [google.cloud.beyondcorp.v1main.Connector.name] that are
+   * authorised to be associated with this AppConnection.
+   * 
+ * + * repeated string connectors = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the connectors at the given index. + */ + com.google.protobuf.ByteString getConnectorsBytes(int index); + + /** + * + * + *
+   * Output only. The current state of the AppConnection.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The current state of the AppConnection.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.State getState(); + + /** + * + * + *
+   * Optional. Gateway used by the AppConnection.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway gateway = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the gateway field is set. + */ + boolean hasGateway(); + /** + * + * + *
+   * Optional. Gateway used by the AppConnection.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway gateway = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The gateway. + */ + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway getGateway(); + /** + * + * + *
+   * Optional. Gateway used by the AppConnection.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway gateway = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.GatewayOrBuilder + getGatewayOrBuilder(); +} diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionsServiceProto.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionsServiceProto.java new file mode 100644 index 000000000000..27c786a34424 --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectionsServiceProto.java @@ -0,0 +1,411 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto + +package com.google.cloud.beyondcorp.appconnections.v1; + +public final class AppConnectionsServiceProto { + private AppConnectionsServiceProto() {} + + 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_beyondcorp_appconnections_v1_ListAppConnectionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_appconnections_v1_ListAppConnectionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_appconnections_v1_ListAppConnectionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_appconnections_v1_ListAppConnectionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_appconnections_v1_GetAppConnectionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_appconnections_v1_GetAppConnectionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_appconnections_v1_CreateAppConnectionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_appconnections_v1_CreateAppConnectionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_appconnections_v1_UpdateAppConnectionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_appconnections_v1_UpdateAppConnectionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_appconnections_v1_DeleteAppConnectionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_appconnections_v1_DeleteAppConnectionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsResponse_AppConnectionDetails_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsResponse_AppConnectionDetails_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_ApplicationEndpoint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_ApplicationEndpoint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_Gateway_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_Gateway_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnectionOperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnectionOperationMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nGgoogle/cloud/beyondcorp/appconnections" + + "/v1/app_connections_service.proto\022)googl" + + "e.cloud.beyondcorp.appconnections.v1\032\034go" + + "ogle/api/annotations.proto\032\027google/api/c" + + "lient.proto\032\037google/api/field_behavior.p" + + "roto\032\031google/api/resource.proto\032#google/" + + "longrunning/operations.proto\032 google/pro" + + "tobuf/field_mask.proto\032\037google/protobuf/" + + "timestamp.proto\"\271\001\n\031ListAppConnectionsRe" + + "quest\022?\n\006parent\030\001 \001(\tB/\340A\002\372A)\022\'beyondcor" + + "p.googleapis.com/AppConnection\022\026\n\tpage_s" + + "ize\030\002 \001(\005B\003\340A\001\022\027\n\npage_token\030\003 \001(\tB\003\340A\001\022" + + "\023\n\006filter\030\004 \001(\tB\003\340A\001\022\025\n\010order_by\030\005 \001(\tB\003" + + "\340A\001\"\235\001\n\032ListAppConnectionsResponse\022Q\n\017ap" + + "p_connections\030\001 \003(\01328.google.cloud.beyon" + + "dcorp.appconnections.v1.AppConnection\022\027\n" + + "\017next_page_token\030\002 \001(\t\022\023\n\013unreachable\030\003 " + + "\003(\t\"X\n\027GetAppConnectionRequest\022=\n\004name\030\001" + + " \001(\tB/\340A\002\372A)\n\'beyondcorp.googleapis.com/" + + "AppConnection\"\211\002\n\032CreateAppConnectionReq" + + "uest\022?\n\006parent\030\001 \001(\tB/\340A\002\372A)\022\'beyondcorp" + + ".googleapis.com/AppConnection\022\036\n\021app_con" + + "nection_id\030\002 \001(\tB\003\340A\001\022U\n\016app_connection\030" + + "\003 \001(\01328.google.cloud.beyondcorp.appconne" + + "ctions.v1.AppConnectionB\003\340A\002\022\027\n\nrequest_" + + "id\030\004 \001(\tB\003\340A\001\022\032\n\rvalidate_only\030\005 \001(\010B\003\340A" + + "\001\"\372\001\n\032UpdateAppConnectionRequest\0224\n\013upda" + + "te_mask\030\001 \001(\0132\032.google.protobuf.FieldMas" + + "kB\003\340A\002\022U\n\016app_connection\030\002 \001(\01328.google." + + "cloud.beyondcorp.appconnections.v1.AppCo" + + "nnectionB\003\340A\002\022\027\n\nrequest_id\030\003 \001(\tB\003\340A\001\022\032" + + "\n\rvalidate_only\030\004 \001(\010B\003\340A\001\022\032\n\rallow_miss" + + "ing\030\005 \001(\010B\003\340A\001\"\220\001\n\032DeleteAppConnectionRe" + + "quest\022=\n\004name\030\001 \001(\tB/\340A\002\372A)\n\'beyondcorp." + + "googleapis.com/AppConnection\022\027\n\nrequest_" + + "id\030\002 \001(\tB\003\340A\001\022\032\n\rvalidate_only\030\003 \001(\010B\003\340A" + + "\001\"\332\001\n\034ResolveAppConnectionsRequest\022?\n\006pa" + + "rent\030\001 \001(\tB/\340A\002\372A)\022\'beyondcorp.googleapi" + + "s.com/AppConnection\022H\n\020app_connector_id\030" + + "\002 \001(\tB.\340A\002\372A(\n&beyondcorp.googleapis.com" + + "/AppConnector\022\026\n\tpage_size\030\003 \001(\005B\003\340A\001\022\027\n" + + "\npage_token\030\004 \001(\tB\003\340A\001\"\317\002\n\035ResolveAppCon" + + "nectionsResponse\022}\n\026app_connection_detai" + + "ls\030\001 \003(\0132].google.cloud.beyondcorp.appco" + + "nnections.v1.ResolveAppConnectionsRespon" + + "se.AppConnectionDetails\022\027\n\017next_page_tok" + + "en\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\032\200\001\n\024AppCon" + + "nectionDetails\022P\n\016app_connection\030\001 \001(\01328" + + ".google.cloud.beyondcorp.appconnections." + + "v1.AppConnection\022\026\n\016recent_mig_vms\030\002 \003(\t" + + "\"\231\n\n\rAppConnection\022\021\n\004name\030\001 \001(\tB\003\340A\002\0224\n" + + "\013create_time\030\002 \001(\0132\032.google.protobuf.Tim" + + "estampB\003\340A\003\0224\n\013update_time\030\003 \001(\0132\032.googl" + + "e.protobuf.TimestampB\003\340A\003\022Y\n\006labels\030\004 \003(" + + "\0132D.google.cloud.beyondcorp.appconnectio" + + "ns.v1.AppConnection.LabelsEntryB\003\340A\001\022\031\n\014" + + "display_name\030\005 \001(\tB\003\340A\001\022\020\n\003uid\030\006 \001(\tB\003\340A" + + "\003\022P\n\004type\030\007 \001(\0162=.google.cloud.beyondcor" + + "p.appconnections.v1.AppConnection.TypeB\003" + + "\340A\002\022o\n\024application_endpoint\030\010 \001(\0132L.goog" + + "le.cloud.beyondcorp.appconnections.v1.Ap" + + "pConnection.ApplicationEndpointB\003\340A\002\022\027\n\n" + + "connectors\030\t \003(\tB\003\340A\001\022R\n\005state\030\n \001(\0162>.g" + + "oogle.cloud.beyondcorp.appconnections.v1" + + ".AppConnection.StateB\003\340A\003\022V\n\007gateway\030\013 \001" + + "(\0132@.google.cloud.beyondcorp.appconnecti" + + "ons.v1.AppConnection.GatewayB\003\340A\001\032;\n\023App" + + "licationEndpoint\022\021\n\004host\030\001 \001(\tB\003\340A\002\022\021\n\004p" + + "ort\030\002 \001(\005B\003\340A\002\032\207\002\n\007Gateway\022X\n\004type\030\002 \001(\016" + + "2E.google.cloud.beyondcorp.appconnection" + + "s.v1.AppConnection.Gateway.TypeB\003\340A\002\022\020\n\003" + + "uri\030\003 \001(\tB\003\340A\003\022\031\n\014ingress_port\030\004 \001(\005B\003\340A" + + "\003\022A\n\013app_gateway\030\005 \001(\tB,\340A\002\372A&\n$beyondco" + + "rp.googleapis.com/AppGateway\"2\n\004Type\022\024\n\020" + + "TYPE_UNSPECIFIED\020\000\022\024\n\020GCP_REGIONAL_MIG\020\001" + + "\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 " + + "\001(\t:\0028\001\"+\n\004Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022\r\n" + + "\tTCP_PROXY\020\001\"_\n\005State\022\025\n\021STATE_UNSPECIFI" + + "ED\020\000\022\014\n\010CREATING\020\001\022\013\n\007CREATED\020\002\022\014\n\010UPDAT" + + "ING\020\003\022\014\n\010DELETING\020\004\022\010\n\004DOWN\020\005:u\352Ar\n\'beyo" + + "ndcorp.googleapis.com/AppConnection\022Gpro" + + "jects/{project}/locations/{location}/app" + + "Connections/{app_connection}\"\215\002\n\036AppConn" + + "ectionOperationMetadata\0224\n\013create_time\030\001" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0221\n" + + "\010end_time\030\002 \001(\0132\032.google.protobuf.Timest" + + "ampB\003\340A\003\022\023\n\006target\030\003 \001(\tB\003\340A\003\022\021\n\004verb\030\004 " + + "\001(\tB\003\340A\003\022\033\n\016status_message\030\005 \001(\tB\003\340A\003\022#\n" + + "\026requested_cancellation\030\006 \001(\010B\003\340A\003\022\030\n\013ap" + + "i_version\030\007 \001(\tB\003\340A\0032\352\014\n\025AppConnectionsS" + + "ervice\022\346\001\n\022ListAppConnections\022D.google.c" + + "loud.beyondcorp.appconnections.v1.ListAp" + + "pConnectionsRequest\032E.google.cloud.beyon" + + "dcorp.appconnections.v1.ListAppConnectio" + + "nsResponse\"C\202\323\344\223\0024\0222/v1/{parent=projects" + + "/*/locations/*}/appConnections\332A\006parent\022" + + "\323\001\n\020GetAppConnection\022B.google.cloud.beyo" + + "ndcorp.appconnections.v1.GetAppConnectio" + + "nRequest\0328.google.cloud.beyondcorp.appco" + + "nnections.v1.AppConnection\"A\202\323\344\223\0024\0222/v1/" + + "{name=projects/*/locations/*/appConnecti" + + "ons/*}\332A\004name\022\244\002\n\023CreateAppConnection\022E." + + "google.cloud.beyondcorp.appconnections.v" + + "1.CreateAppConnectionRequest\032\035.google.lo" + + "ngrunning.Operation\"\246\001\202\323\344\223\002D\"2/v1/{paren" + + "t=projects/*/locations/*}/appConnections" + + ":\016app_connection\332A\'parent,app_connection" + + ",app_connection_id\312A/\n\rAppConnection\022\036Ap" + + "pConnectionOperationMetadata\022\246\002\n\023UpdateA" + + "ppConnection\022E.google.cloud.beyondcorp.a" + + "ppconnections.v1.UpdateAppConnectionRequ" + + "est\032\035.google.longrunning.Operation\"\250\001\202\323\344" + + "\223\002S2A/v1/{app_connection.name=projects/*" + + "/locations/*/appConnections/*}:\016app_conn" + + "ection\332A\032app_connection,update_mask\312A/\n\r" + + "AppConnection\022\036AppConnectionOperationMet" + + "adata\022\370\001\n\023DeleteAppConnection\022E.google.c" + + "loud.beyondcorp.appconnections.v1.Delete" + + "AppConnectionRequest\032\035.google.longrunnin" + + "g.Operation\"{\202\323\344\223\0024*2/v1/{name=projects/" + + "*/locations/*/appConnections/*}\332A\004name\312A" + + "7\n\025google.protobuf.Empty\022\036AppConnectionO" + + "perationMetadata\022\367\001\n\025ResolveAppConnectio" + + "ns\022G.google.cloud.beyondcorp.appconnecti" + + "ons.v1.ResolveAppConnectionsRequest\032H.go" + + "ogle.cloud.beyondcorp.appconnections.v1." + + "ResolveAppConnectionsResponse\"K\202\323\344\223\002<\022:/" + + "v1/{parent=projects/*/locations/*}/appCo" + + "nnections:resolve\332A\006parent\032M\312A\031beyondcor" + + "p.googleapis.com\322A.https://www.googleapi" + + "s.com/auth/cloud-platformB\214\004\n-com.google" + + ".cloud.beyondcorp.appconnections.v1B\032App" + + "ConnectionsServiceProtoP\001ZWgoogle.golang" + + ".org/genproto/googleapis/cloud/beyondcor" + + "p/appconnections/v1;appconnections\252\002)Goo" + + "gle.Cloud.BeyondCorp.AppConnections.V1\312\002" + + ")Google\\Cloud\\BeyondCorp\\AppConnections\\" + + "V1\352\002-Google::Cloud::BeyondCorp::AppConne" + + "ctions::V1\352Ao\n&beyondcorp.googleapis.com" + + "/AppConnector\022Eprojects/{project}/locati" + + "ons/{location}/appConnectors/{app_connec" + + "tor}\352Ai\n$beyondcorp.googleapis.com/AppGa" + + "teway\022Aprojects/{project}/locations/{loc" + + "ation}/appGateways/{app_gateway}b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_beyondcorp_appconnections_v1_ListAppConnectionsRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_beyondcorp_appconnections_v1_ListAppConnectionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_appconnections_v1_ListAppConnectionsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_beyondcorp_appconnections_v1_ListAppConnectionsResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_beyondcorp_appconnections_v1_ListAppConnectionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_appconnections_v1_ListAppConnectionsResponse_descriptor, + new java.lang.String[] { + "AppConnections", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_beyondcorp_appconnections_v1_GetAppConnectionRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_beyondcorp_appconnections_v1_GetAppConnectionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_appconnections_v1_GetAppConnectionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_beyondcorp_appconnections_v1_CreateAppConnectionRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_beyondcorp_appconnections_v1_CreateAppConnectionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_appconnections_v1_CreateAppConnectionRequest_descriptor, + new java.lang.String[] { + "Parent", "AppConnectionId", "AppConnection", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_beyondcorp_appconnections_v1_UpdateAppConnectionRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_beyondcorp_appconnections_v1_UpdateAppConnectionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_appconnections_v1_UpdateAppConnectionRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "AppConnection", "RequestId", "ValidateOnly", "AllowMissing", + }); + internal_static_google_cloud_beyondcorp_appconnections_v1_DeleteAppConnectionRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_beyondcorp_appconnections_v1_DeleteAppConnectionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_appconnections_v1_DeleteAppConnectionRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsRequest_descriptor, + new java.lang.String[] { + "Parent", "AppConnectorId", "PageSize", "PageToken", + }); + internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsResponse_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsResponse_descriptor, + new java.lang.String[] { + "AppConnectionDetails", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsResponse_AppConnectionDetails_descriptor = + internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsResponse_AppConnectionDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsResponse_AppConnectionDetails_descriptor, + new java.lang.String[] { + "AppConnection", "RecentMigVms", + }); + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_descriptor, + new java.lang.String[] { + "Name", + "CreateTime", + "UpdateTime", + "Labels", + "DisplayName", + "Uid", + "Type", + "ApplicationEndpoint", + "Connectors", + "State", + "Gateway", + }); + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_ApplicationEndpoint_descriptor = + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_ApplicationEndpoint_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_ApplicationEndpoint_descriptor, + new java.lang.String[] { + "Host", "Port", + }); + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_Gateway_descriptor = + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_Gateway_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_Gateway_descriptor, + new java.lang.String[] { + "Type", "Uri", "IngressPort", "AppGateway", + }); + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_LabelsEntry_descriptor = + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnection_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnectionOperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnectionOperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_appconnections_v1_AppConnectionOperationMetadata_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.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectorName.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectorName.java new file mode 100644 index 000000000000..2299ca89d61c --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/AppConnectorName.java @@ -0,0 +1,227 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.beyondcorp.appconnections.v1; + +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 AppConnectorName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_APP_CONNECTOR = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/appConnectors/{app_connector}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String appConnector; + + @Deprecated + protected AppConnectorName() { + project = null; + location = null; + appConnector = null; + } + + private AppConnectorName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + appConnector = Preconditions.checkNotNull(builder.getAppConnector()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAppConnector() { + return appConnector; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static AppConnectorName of(String project, String location, String appConnector) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAppConnector(appConnector) + .build(); + } + + public static String format(String project, String location, String appConnector) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAppConnector(appConnector) + .build() + .toString(); + } + + public static AppConnectorName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_APP_CONNECTOR.validatedMatch( + formattedString, "AppConnectorName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("app_connector")); + } + + 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 (AppConnectorName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_APP_CONNECTOR.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 (appConnector != null) { + fieldMapBuilder.put("app_connector", appConnector); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_APP_CONNECTOR.instantiate( + "project", project, "location", location, "app_connector", appConnector); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + AppConnectorName that = ((AppConnectorName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.appConnector, that.appConnector); + } + 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(appConnector); + return h; + } + + /** Builder for projects/{project}/locations/{location}/appConnectors/{app_connector}. */ + public static class Builder { + private String project; + private String location; + private String appConnector; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAppConnector() { + return appConnector; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setAppConnector(String appConnector) { + this.appConnector = appConnector; + return this; + } + + private Builder(AppConnectorName appConnectorName) { + this.project = appConnectorName.project; + this.location = appConnectorName.location; + this.appConnector = appConnectorName.appConnector; + } + + public AppConnectorName build() { + return new AppConnectorName(this); + } + } +} diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/CreateAppConnectionRequest.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/CreateAppConnectionRequest.java new file mode 100644 index 000000000000..ff4eddfe961d --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/CreateAppConnectionRequest.java @@ -0,0 +1,1527 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto + +package com.google.cloud.beyondcorp.appconnections.v1; + +/** + * + * + *
+ * Request message for BeyondCorp.CreateAppConnection.
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest} + */ +public final class CreateAppConnectionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest) + CreateAppConnectionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateAppConnectionRequest.newBuilder() to construct. + private CreateAppConnectionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateAppConnectionRequest() { + parent_ = ""; + appConnectionId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateAppConnectionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateAppConnectionRequest( + 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(); + + appConnectionId_ = s; + break; + } + case 26: + { + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder subBuilder = null; + if (appConnection_ != null) { + subBuilder = appConnection_.toBuilder(); + } + appConnection_ = + input.readMessage( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(appConnection_); + appConnection_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + case 40: + { + validateOnly_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_CreateAppConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_CreateAppConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest.class, + com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The resource project name of the AppConnection location using the
+   * form: `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.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 resource project name of the AppConnection location using the
+   * form: `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @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 APP_CONNECTION_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object appConnectionId_; + /** + * + * + *
+   * Optional. User-settable AppConnection resource ID.
+   *  * Must start with a letter.
+   *  * Must contain between 4-63 characters from `/[a-z][0-9]-/`.
+   *  * Must end with a number or a letter.
+   * 
+ * + * string app_connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The appConnectionId. + */ + @java.lang.Override + public java.lang.String getAppConnectionId() { + java.lang.Object ref = appConnectionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appConnectionId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. User-settable AppConnection resource ID.
+   *  * Must start with a letter.
+   *  * Must contain between 4-63 characters from `/[a-z][0-9]-/`.
+   *  * Must end with a number or a letter.
+   * 
+ * + * string app_connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for appConnectionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAppConnectionIdBytes() { + java.lang.Object ref = appConnectionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + appConnectionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_CONNECTION_FIELD_NUMBER = 3; + private com.google.cloud.beyondcorp.appconnections.v1.AppConnection appConnection_; + /** + * + * + *
+   * Required. A BeyondCorp AppConnection resource.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the appConnection field is set. + */ + @java.lang.Override + public boolean hasAppConnection() { + return appConnection_ != null; + } + /** + * + * + *
+   * Required. A BeyondCorp AppConnection resource.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The appConnection. + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection getAppConnection() { + return appConnection_ == null + ? com.google.cloud.beyondcorp.appconnections.v1.AppConnection.getDefaultInstance() + : appConnection_; + } + /** + * + * + *
+   * Required. A BeyondCorp AppConnection resource.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder + getAppConnectionOrBuilder() { + return getAppConnection(); + } + + 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; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 5; + private boolean validateOnly_; + /** + * + * + *
+   * Optional. If set, validates request by executing a dry-run which would not
+   * alter the resource in any way.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appConnectionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, appConnectionId_); + } + if (appConnection_ != null) { + output.writeMessage(3, getAppConnection()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(5, validateOnly_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appConnectionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, appConnectionId_); + } + if (appConnection_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getAppConnection()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, validateOnly_); + } + 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.beyondcorp.appconnections.v1.CreateAppConnectionRequest)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest other = + (com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getAppConnectionId().equals(other.getAppConnectionId())) return false; + if (hasAppConnection() != other.hasAppConnection()) return false; + if (hasAppConnection()) { + if (!getAppConnection().equals(other.getAppConnection())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + APP_CONNECTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppConnectionId().hashCode(); + if (hasAppConnection()) { + hash = (37 * hash) + APP_CONNECTION_FIELD_NUMBER; + hash = (53 * hash) + getAppConnection().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest 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.beyondcorp.appconnections.v1.CreateAppConnectionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest 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.beyondcorp.appconnections.v1.CreateAppConnectionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest 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.beyondcorp.appconnections.v1.CreateAppConnectionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest + 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.beyondcorp.appconnections.v1.CreateAppConnectionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest 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.beyondcorp.appconnections.v1.CreateAppConnectionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for BeyondCorp.CreateAppConnection.
+   * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest) + com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_CreateAppConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_CreateAppConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest.class, + com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest.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_ = ""; + + appConnectionId_ = ""; + + if (appConnectionBuilder_ == null) { + appConnection_ = null; + } else { + appConnection_ = null; + appConnectionBuilder_ = null; + } + requestId_ = ""; + + validateOnly_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_CreateAppConnectionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest build() { + com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest buildPartial() { + com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest result = + new com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest(this); + result.parent_ = parent_; + result.appConnectionId_ = appConnectionId_; + if (appConnectionBuilder_ == null) { + result.appConnection_ = appConnection_; + } else { + result.appConnection_ = appConnectionBuilder_.build(); + } + result.requestId_ = requestId_; + result.validateOnly_ = validateOnly_; + 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.beyondcorp.appconnections.v1.CreateAppConnectionRequest) { + return mergeFrom( + (com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest other) { + if (other + == com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getAppConnectionId().isEmpty()) { + appConnectionId_ = other.appConnectionId_; + onChanged(); + } + if (other.hasAppConnection()) { + mergeAppConnection(other.getAppConnection()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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.beyondcorp.appconnections.v1.CreateAppConnectionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource project name of the AppConnection location using the
+     * form: `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource project name of the AppConnection location using the
+     * form: `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource project name of the AppConnection location using the
+     * form: `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource project name of the AppConnection location using the
+     * form: `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource project name of the AppConnection location using the
+     * form: `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object appConnectionId_ = ""; + /** + * + * + *
+     * Optional. User-settable AppConnection resource ID.
+     *  * Must start with a letter.
+     *  * Must contain between 4-63 characters from `/[a-z][0-9]-/`.
+     *  * Must end with a number or a letter.
+     * 
+ * + * string app_connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The appConnectionId. + */ + public java.lang.String getAppConnectionId() { + java.lang.Object ref = appConnectionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appConnectionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. User-settable AppConnection resource ID.
+     *  * Must start with a letter.
+     *  * Must contain between 4-63 characters from `/[a-z][0-9]-/`.
+     *  * Must end with a number or a letter.
+     * 
+ * + * string app_connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for appConnectionId. + */ + public com.google.protobuf.ByteString getAppConnectionIdBytes() { + java.lang.Object ref = appConnectionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + appConnectionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. User-settable AppConnection resource ID.
+     *  * Must start with a letter.
+     *  * Must contain between 4-63 characters from `/[a-z][0-9]-/`.
+     *  * Must end with a number or a letter.
+     * 
+ * + * string app_connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The appConnectionId to set. + * @return This builder for chaining. + */ + public Builder setAppConnectionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + appConnectionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. User-settable AppConnection resource ID.
+     *  * Must start with a letter.
+     *  * Must contain between 4-63 characters from `/[a-z][0-9]-/`.
+     *  * Must end with a number or a letter.
+     * 
+ * + * string app_connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAppConnectionId() { + + appConnectionId_ = getDefaultInstance().getAppConnectionId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. User-settable AppConnection resource ID.
+     *  * Must start with a letter.
+     *  * Must contain between 4-63 characters from `/[a-z][0-9]-/`.
+     *  * Must end with a number or a letter.
+     * 
+ * + * string app_connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for appConnectionId to set. + * @return This builder for chaining. + */ + public Builder setAppConnectionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + appConnectionId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.beyondcorp.appconnections.v1.AppConnection appConnection_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.beyondcorp.appconnections.v1.AppConnection, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder, + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder> + appConnectionBuilder_; + /** + * + * + *
+     * Required. A BeyondCorp AppConnection resource.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the appConnection field is set. + */ + public boolean hasAppConnection() { + return appConnectionBuilder_ != null || appConnection_ != null; + } + /** + * + * + *
+     * Required. A BeyondCorp AppConnection resource.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The appConnection. + */ + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection getAppConnection() { + if (appConnectionBuilder_ == null) { + return appConnection_ == null + ? com.google.cloud.beyondcorp.appconnections.v1.AppConnection.getDefaultInstance() + : appConnection_; + } else { + return appConnectionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. A BeyondCorp AppConnection resource.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection value) { + if (appConnectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + appConnection_ = value; + onChanged(); + } else { + appConnectionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. A BeyondCorp AppConnection resource.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder builderForValue) { + if (appConnectionBuilder_ == null) { + appConnection_ = builderForValue.build(); + onChanged(); + } else { + appConnectionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. A BeyondCorp AppConnection resource.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection value) { + if (appConnectionBuilder_ == null) { + if (appConnection_ != null) { + appConnection_ = + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.newBuilder(appConnection_) + .mergeFrom(value) + .buildPartial(); + } else { + appConnection_ = value; + } + onChanged(); + } else { + appConnectionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. A BeyondCorp AppConnection resource.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearAppConnection() { + if (appConnectionBuilder_ == null) { + appConnection_ = null; + onChanged(); + } else { + appConnection_ = null; + appConnectionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. A BeyondCorp AppConnection resource.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder + getAppConnectionBuilder() { + + onChanged(); + return getAppConnectionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. A BeyondCorp AppConnection resource.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder + getAppConnectionOrBuilder() { + if (appConnectionBuilder_ != null) { + return appConnectionBuilder_.getMessageOrBuilder(); + } else { + return appConnection_ == null + ? com.google.cloud.beyondcorp.appconnections.v1.AppConnection.getDefaultInstance() + : appConnection_; + } + } + /** + * + * + *
+     * Required. A BeyondCorp AppConnection resource.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.beyondcorp.appconnections.v1.AppConnection, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder, + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder> + getAppConnectionFieldBuilder() { + if (appConnectionBuilder_ == null) { + appConnectionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.beyondcorp.appconnections.v1.AppConnection, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder, + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder>( + getAppConnection(), getParentForChildren(), isClean()); + appConnection_ = null; + } + return appConnectionBuilder_; + } + + 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; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, validates request by executing a dry-run which would not
+     * alter the resource in any way.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, validates request by executing a dry-run which would not
+     * alter the resource in any way.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, validates request by executing a dry-run which would not
+     * alter the resource in any way.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest) + private static final com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest(); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateAppConnectionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateAppConnectionRequest(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.beyondcorp.appconnections.v1.CreateAppConnectionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/CreateAppConnectionRequestOrBuilder.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/CreateAppConnectionRequestOrBuilder.java new file mode 100644 index 000000000000..711444eb22cb --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/CreateAppConnectionRequestOrBuilder.java @@ -0,0 +1,187 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto + +package com.google.cloud.beyondcorp.appconnections.v1; + +public interface CreateAppConnectionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource project name of the AppConnection location using the
+   * form: `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource project name of the AppConnection location using the
+   * form: `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. User-settable AppConnection resource ID.
+   *  * Must start with a letter.
+   *  * Must contain between 4-63 characters from `/[a-z][0-9]-/`.
+   *  * Must end with a number or a letter.
+   * 
+ * + * string app_connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The appConnectionId. + */ + java.lang.String getAppConnectionId(); + /** + * + * + *
+   * Optional. User-settable AppConnection resource ID.
+   *  * Must start with a letter.
+   *  * Must contain between 4-63 characters from `/[a-z][0-9]-/`.
+   *  * Must end with a number or a letter.
+   * 
+ * + * string app_connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for appConnectionId. + */ + com.google.protobuf.ByteString getAppConnectionIdBytes(); + + /** + * + * + *
+   * Required. A BeyondCorp AppConnection resource.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the appConnection field is set. + */ + boolean hasAppConnection(); + /** + * + * + *
+   * Required. A BeyondCorp AppConnection resource.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The appConnection. + */ + com.google.cloud.beyondcorp.appconnections.v1.AppConnection getAppConnection(); + /** + * + * + *
+   * Required. A BeyondCorp AppConnection resource.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder getAppConnectionOrBuilder(); + + /** + * + * + *
+   * 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(); + + /** + * + * + *
+   * Optional. If set, validates request by executing a dry-run which would not
+   * alter the resource in any way.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/DeleteAppConnectionRequest.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/DeleteAppConnectionRequest.java new file mode 100644 index 000000000000..9b6040792cff --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/DeleteAppConnectionRequest.java @@ -0,0 +1,1019 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto + +package com.google.cloud.beyondcorp.appconnections.v1; + +/** + * + * + *
+ * Request message for BeyondCorp.DeleteAppConnection.
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest} + */ +public final class DeleteAppConnectionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest) + DeleteAppConnectionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteAppConnectionRequest.newBuilder() to construct. + private DeleteAppConnectionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteAppConnectionRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteAppConnectionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteAppConnectionRequest( + 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; + } + case 24: + { + validateOnly_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_DeleteAppConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_DeleteAppConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest.class, + com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. BeyondCorp Connector name using the form:
+   * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. BeyondCorp Connector name using the form:
+   * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int 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; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_; + /** + * + * + *
+   * Optional. If set, validates request by executing a dry-run which would not
+   * alter the resource in any way.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + 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.beyondcorp.appconnections.v1.DeleteAppConnectionRequest)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest other = + (com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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 = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest 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.beyondcorp.appconnections.v1.DeleteAppConnectionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest 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.beyondcorp.appconnections.v1.DeleteAppConnectionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest 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.beyondcorp.appconnections.v1.DeleteAppConnectionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest + 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.beyondcorp.appconnections.v1.DeleteAppConnectionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest 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.beyondcorp.appconnections.v1.DeleteAppConnectionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for BeyondCorp.DeleteAppConnection.
+   * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest) + com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_DeleteAppConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_DeleteAppConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest.class, + com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest.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_ = ""; + + validateOnly_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_DeleteAppConnectionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest build() { + com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest buildPartial() { + com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest result = + new com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest(this); + result.name_ = name_; + result.requestId_ = requestId_; + result.validateOnly_ = validateOnly_; + 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.beyondcorp.appconnections.v1.DeleteAppConnectionRequest) { + return mergeFrom( + (com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest other) { + if (other + == com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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.beyondcorp.appconnections.v1.DeleteAppConnectionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. BeyondCorp Connector name using the form:
+     * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. BeyondCorp Connector name using the form:
+     * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. BeyondCorp Connector name using the form:
+     * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. BeyondCorp Connector name using the form:
+     * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. BeyondCorp Connector name using the form:
+     * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private 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; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, validates request by executing a dry-run which would not
+     * alter the resource in any way.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, validates request by executing a dry-run which would not
+     * alter the resource in any way.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, validates request by executing a dry-run which would not
+     * alter the resource in any way.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest) + private static final com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest(); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteAppConnectionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteAppConnectionRequest(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.beyondcorp.appconnections.v1.DeleteAppConnectionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/DeleteAppConnectionRequestOrBuilder.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/DeleteAppConnectionRequestOrBuilder.java new file mode 100644 index 000000000000..4670544febdb --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/DeleteAppConnectionRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto + +package com.google.cloud.beyondcorp.appconnections.v1; + +public interface DeleteAppConnectionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. BeyondCorp Connector name using the form:
+   * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. BeyondCorp Connector name using the form:
+   * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`
+   * 
+ * + * + * 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(); + + /** + * + * + *
+   * Optional. If set, validates request by executing a dry-run which would not
+   * alter the resource in any way.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/GetAppConnectionRequest.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/GetAppConnectionRequest.java new file mode 100644 index 000000000000..2dde315d3fe1 --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/GetAppConnectionRequest.java @@ -0,0 +1,671 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto + +package com.google.cloud.beyondcorp.appconnections.v1; + +/** + * + * + *
+ * Request message for BeyondCorp.GetAppConnection.
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest} + */ +public final class GetAppConnectionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest) + GetAppConnectionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetAppConnectionRequest.newBuilder() to construct. + private GetAppConnectionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetAppConnectionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetAppConnectionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetAppConnectionRequest( + 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_GetAppConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_GetAppConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest.class, + com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. BeyondCorp AppConnection name using the form:
+   * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. BeyondCorp AppConnection name using the form:
+   * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + 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.beyondcorp.appconnections.v1.GetAppConnectionRequest)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest other = + (com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest) 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.beyondcorp.appconnections.v1.GetAppConnectionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest 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.beyondcorp.appconnections.v1.GetAppConnectionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest 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.beyondcorp.appconnections.v1.GetAppConnectionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest 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.beyondcorp.appconnections.v1.GetAppConnectionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest + 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.beyondcorp.appconnections.v1.GetAppConnectionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest 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.beyondcorp.appconnections.v1.GetAppConnectionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for BeyondCorp.GetAppConnection.
+   * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest) + com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_GetAppConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_GetAppConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest.class, + com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest.Builder.class); + } + + // Construct using + // com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest.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.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_GetAppConnectionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest build() { + com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest buildPartial() { + com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest result = + new com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest(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.beyondcorp.appconnections.v1.GetAppConnectionRequest) { + return mergeFrom( + (com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest other) { + if (other + == com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest + .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.beyondcorp.appconnections.v1.GetAppConnectionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. BeyondCorp AppConnection name using the form:
+     * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. BeyondCorp AppConnection name using the form:
+     * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. BeyondCorp AppConnection name using the form:
+     * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. BeyondCorp AppConnection name using the form:
+     * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. BeyondCorp AppConnection name using the form:
+     * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest) + private static final com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest(); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetAppConnectionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetAppConnectionRequest(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.beyondcorp.appconnections.v1.GetAppConnectionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/GetAppConnectionRequestOrBuilder.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/GetAppConnectionRequestOrBuilder.java new file mode 100644 index 000000000000..b5976209a2a4 --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/GetAppConnectionRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto + +package com.google.cloud.beyondcorp.appconnections.v1; + +public interface GetAppConnectionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. BeyondCorp AppConnection name using the form:
+   * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. BeyondCorp AppConnection name using the form:
+   * `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ListAppConnectionsRequest.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ListAppConnectionsRequest.java new file mode 100644 index 000000000000..d673fdd3e0f0 --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ListAppConnectionsRequest.java @@ -0,0 +1,1350 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto + +package com.google.cloud.beyondcorp.appconnections.v1; + +/** + * + * + *
+ * Request message for BeyondCorp.ListAppConnections.
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest} + */ +public final class ListAppConnectionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest) + ListAppConnectionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAppConnectionsRequest.newBuilder() to construct. + private ListAppConnectionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAppConnectionsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAppConnectionsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListAppConnectionsRequest( + 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ListAppConnectionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ListAppConnectionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest.class, + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The resource name of the AppConnection location using the form:
+   * `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.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 resource name of the AppConnection location using the form:
+   * `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @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_; + /** + * + * + *
+   * Optional. The maximum number of items to return.
+   * If not specified, a default value of 50 will be used by the service.
+   * Regardless of the page_size value, the response may include a partial list
+   * and a caller should only rely on response's
+   * [next_page_token][BeyondCorp.ListAppConnectionsResponse.next_page_token] to
+   * determine if there are more instances left to be queried.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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_; + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous
+   * ListAppConnectionsRequest, if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous
+   * ListAppConnectionsRequest, if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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_; + /** + * + * + *
+   * Optional. A filter specifying constraints of a list operation.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. A filter specifying constraints of a list operation.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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_; + /** + * + * + *
+   * Optional. Specifies the ordering of results. See
+   * [Sorting
+   * order](https://cloud.google.com/apis/design/design_patterns#sorting_order)
+   * for more information.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. Specifies the ordering of results. See
+   * [Sorting
+   * order](https://cloud.google.com/apis/design/design_patterns#sorting_order)
+   * for more information.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + 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.beyondcorp.appconnections.v1.ListAppConnectionsRequest)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest other = + (com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest) 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.beyondcorp.appconnections.v1.ListAppConnectionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest 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.beyondcorp.appconnections.v1.ListAppConnectionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest 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.beyondcorp.appconnections.v1.ListAppConnectionsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest 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.beyondcorp.appconnections.v1.ListAppConnectionsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest + 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.beyondcorp.appconnections.v1.ListAppConnectionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest 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.beyondcorp.appconnections.v1.ListAppConnectionsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for BeyondCorp.ListAppConnections.
+   * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest) + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ListAppConnectionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ListAppConnectionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest.class, + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest.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.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ListAppConnectionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest build() { + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest buildPartial() { + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest result = + new com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest(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.beyondcorp.appconnections.v1.ListAppConnectionsRequest) { + return mergeFrom( + (com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest other) { + if (other + == com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest + .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.beyondcorp.appconnections.v1.ListAppConnectionsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource name of the AppConnection location using the form:
+     * `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the AppConnection location using the form:
+     * `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the AppConnection location using the form:
+     * `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the AppConnection location using the form:
+     * `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the AppConnection location using the form:
+     * `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of items to return.
+     * If not specified, a default value of 50 will be used by the service.
+     * Regardless of the page_size value, the response may include a partial list
+     * and a caller should only rely on response's
+     * [next_page_token][BeyondCorp.ListAppConnectionsResponse.next_page_token] to
+     * determine if there are more instances left to be queried.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of items to return.
+     * If not specified, a default value of 50 will be used by the service.
+     * Regardless of the page_size value, the response may include a partial list
+     * and a caller should only rely on response's
+     * [next_page_token][BeyondCorp.ListAppConnectionsResponse.next_page_token] to
+     * determine if there are more instances left to be queried.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of items to return.
+     * If not specified, a default value of 50 will be used by the service.
+     * Regardless of the page_size value, the response may include a partial list
+     * and a caller should only rely on response's
+     * [next_page_token][BeyondCorp.ListAppConnectionsResponse.next_page_token] to
+     * determine if there are more instances left to be queried.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous
+     * ListAppConnectionsRequest, if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous
+     * ListAppConnectionsRequest, if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous
+     * ListAppConnectionsRequest, if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous
+     * ListAppConnectionsRequest, if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous
+     * ListAppConnectionsRequest, if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. A filter specifying constraints of a list operation.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A filter specifying constraints of a list operation.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A filter specifying constraints of a list operation.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A filter specifying constraints of a list operation.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A filter specifying constraints of a list operation.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. Specifies the ordering of results. See
+     * [Sorting
+     * order](https://cloud.google.com/apis/design/design_patterns#sorting_order)
+     * for more information.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Specifies the ordering of results. See
+     * [Sorting
+     * order](https://cloud.google.com/apis/design/design_patterns#sorting_order)
+     * for more information.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Specifies the ordering of results. See
+     * [Sorting
+     * order](https://cloud.google.com/apis/design/design_patterns#sorting_order)
+     * for more information.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + /** + * + * + *
+     * Optional. Specifies the ordering of results. See
+     * [Sorting
+     * order](https://cloud.google.com/apis/design/design_patterns#sorting_order)
+     * for more information.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the ordering of results. See
+     * [Sorting
+     * order](https://cloud.google.com/apis/design/design_patterns#sorting_order)
+     * for more information.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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.beyondcorp.appconnections.v1.ListAppConnectionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest) + private static final com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest(); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAppConnectionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAppConnectionsRequest(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.beyondcorp.appconnections.v1.ListAppConnectionsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ListAppConnectionsRequestOrBuilder.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ListAppConnectionsRequestOrBuilder.java new file mode 100644 index 000000000000..c863c15751dc --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ListAppConnectionsRequestOrBuilder.java @@ -0,0 +1,157 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto + +package com.google.cloud.beyondcorp.appconnections.v1; + +public interface ListAppConnectionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the AppConnection location using the form:
+   * `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource name of the AppConnection location using the form:
+   * `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of items to return.
+   * If not specified, a default value of 50 will be used by the service.
+   * Regardless of the page_size value, the response may include a partial list
+   * and a caller should only rely on response's
+   * [next_page_token][BeyondCorp.ListAppConnectionsResponse.next_page_token] to
+   * determine if there are more instances left to be queried.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous
+   * ListAppConnectionsRequest, if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous
+   * ListAppConnectionsRequest, if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. A filter specifying constraints of a list operation.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. A filter specifying constraints of a list operation.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Specifies the ordering of results. See
+   * [Sorting
+   * order](https://cloud.google.com/apis/design/design_patterns#sorting_order)
+   * for more information.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Specifies the ordering of results. See
+   * [Sorting
+   * order](https://cloud.google.com/apis/design/design_patterns#sorting_order)
+   * for more information.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ListAppConnectionsResponse.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ListAppConnectionsResponse.java new file mode 100644 index 000000000000..f5746c7edd84 --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ListAppConnectionsResponse.java @@ -0,0 +1,1482 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto + +package com.google.cloud.beyondcorp.appconnections.v1; + +/** + * + * + *
+ * Response message for BeyondCorp.ListAppConnections.
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse} + */ +public final class ListAppConnectionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse) + ListAppConnectionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAppConnectionsResponse.newBuilder() to construct. + private ListAppConnectionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAppConnectionsResponse() { + appConnections_ = 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 ListAppConnectionsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListAppConnectionsResponse( + 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)) { + appConnections_ = + new java.util.ArrayList< + com.google.cloud.beyondcorp.appconnections.v1.AppConnection>(); + mutable_bitField0_ |= 0x00000001; + } + appConnections_.add( + input.readMessage( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + appConnections_ = java.util.Collections.unmodifiableList(appConnections_); + } + 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.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ListAppConnectionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ListAppConnectionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse.class, + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse.Builder.class); + } + + public static final int APP_CONNECTIONS_FIELD_NUMBER = 1; + private java.util.List + appConnections_; + /** + * + * + *
+   * A list of BeyondCorp AppConnections in the project.
+   * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + @java.lang.Override + public java.util.List + getAppConnectionsList() { + return appConnections_; + } + /** + * + * + *
+   * A list of BeyondCorp AppConnections in the project.
+   * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder> + getAppConnectionsOrBuilderList() { + return appConnections_; + } + /** + * + * + *
+   * A list of BeyondCorp AppConnections in the project.
+   * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + @java.lang.Override + public int getAppConnectionsCount() { + return appConnections_.size(); + } + /** + * + * + *
+   * A list of BeyondCorp AppConnections in the project.
+   * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection getAppConnections(int index) { + return appConnections_.get(index); + } + /** + * + * + *
+   * A list of BeyondCorp AppConnections in the project.
+   * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder + getAppConnectionsOrBuilder(int index) { + return appConnections_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * A list of locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * A list of locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * A list of 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); + } + /** + * + * + *
+   * A list of 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 < appConnections_.size(); i++) { + output.writeMessage(1, appConnections_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + 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 < appConnections_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, appConnections_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + 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.beyondcorp.appconnections.v1.ListAppConnectionsResponse)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse other = + (com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse) obj; + + if (!getAppConnectionsList().equals(other.getAppConnectionsList())) 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 (getAppConnectionsCount() > 0) { + hash = (37 * hash) + APP_CONNECTIONS_FIELD_NUMBER; + hash = (53 * hash) + getAppConnectionsList().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.beyondcorp.appconnections.v1.ListAppConnectionsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse 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.beyondcorp.appconnections.v1.ListAppConnectionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse 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.beyondcorp.appconnections.v1.ListAppConnectionsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse 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.beyondcorp.appconnections.v1.ListAppConnectionsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse + 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.beyondcorp.appconnections.v1.ListAppConnectionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse 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.beyondcorp.appconnections.v1.ListAppConnectionsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for BeyondCorp.ListAppConnections.
+   * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse) + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ListAppConnectionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ListAppConnectionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse.class, + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse.Builder + .class); + } + + // Construct using + // com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAppConnectionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (appConnectionsBuilder_ == null) { + appConnections_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + appConnectionsBuilder_.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.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ListAppConnectionsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse build() { + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse buildPartial() { + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse result = + new com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse(this); + int from_bitField0_ = bitField0_; + if (appConnectionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + appConnections_ = java.util.Collections.unmodifiableList(appConnections_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.appConnections_ = appConnections_; + } else { + result.appConnections_ = appConnectionsBuilder_.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.beyondcorp.appconnections.v1.ListAppConnectionsResponse) { + return mergeFrom( + (com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse other) { + if (other + == com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse + .getDefaultInstance()) return this; + if (appConnectionsBuilder_ == null) { + if (!other.appConnections_.isEmpty()) { + if (appConnections_.isEmpty()) { + appConnections_ = other.appConnections_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAppConnectionsIsMutable(); + appConnections_.addAll(other.appConnections_); + } + onChanged(); + } + } else { + if (!other.appConnections_.isEmpty()) { + if (appConnectionsBuilder_.isEmpty()) { + appConnectionsBuilder_.dispose(); + appConnectionsBuilder_ = null; + appConnections_ = other.appConnections_; + bitField0_ = (bitField0_ & ~0x00000001); + appConnectionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAppConnectionsFieldBuilder() + : null; + } else { + appConnectionsBuilder_.addAllMessages(other.appConnections_); + } + } + } + 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.beyondcorp.appconnections.v1.ListAppConnectionsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + appConnections_ = java.util.Collections.emptyList(); + + private void ensureAppConnectionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + appConnections_ = + new java.util.ArrayList( + appConnections_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.beyondcorp.appconnections.v1.AppConnection, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder, + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder> + appConnectionsBuilder_; + + /** + * + * + *
+     * A list of BeyondCorp AppConnections in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + public java.util.List + getAppConnectionsList() { + if (appConnectionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(appConnections_); + } else { + return appConnectionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + public int getAppConnectionsCount() { + if (appConnectionsBuilder_ == null) { + return appConnections_.size(); + } else { + return appConnectionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection getAppConnections( + int index) { + if (appConnectionsBuilder_ == null) { + return appConnections_.get(index); + } else { + return appConnectionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + public Builder setAppConnections( + int index, com.google.cloud.beyondcorp.appconnections.v1.AppConnection value) { + if (appConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAppConnectionsIsMutable(); + appConnections_.set(index, value); + onChanged(); + } else { + appConnectionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + public Builder setAppConnections( + int index, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder builderForValue) { + if (appConnectionsBuilder_ == null) { + ensureAppConnectionsIsMutable(); + appConnections_.set(index, builderForValue.build()); + onChanged(); + } else { + appConnectionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + public Builder addAppConnections( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection value) { + if (appConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAppConnectionsIsMutable(); + appConnections_.add(value); + onChanged(); + } else { + appConnectionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + public Builder addAppConnections( + int index, com.google.cloud.beyondcorp.appconnections.v1.AppConnection value) { + if (appConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAppConnectionsIsMutable(); + appConnections_.add(index, value); + onChanged(); + } else { + appConnectionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + public Builder addAppConnections( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder builderForValue) { + if (appConnectionsBuilder_ == null) { + ensureAppConnectionsIsMutable(); + appConnections_.add(builderForValue.build()); + onChanged(); + } else { + appConnectionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + public Builder addAppConnections( + int index, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder builderForValue) { + if (appConnectionsBuilder_ == null) { + ensureAppConnectionsIsMutable(); + appConnections_.add(index, builderForValue.build()); + onChanged(); + } else { + appConnectionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + public Builder addAllAppConnections( + java.lang.Iterable + values) { + if (appConnectionsBuilder_ == null) { + ensureAppConnectionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, appConnections_); + onChanged(); + } else { + appConnectionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + public Builder clearAppConnections() { + if (appConnectionsBuilder_ == null) { + appConnections_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + appConnectionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + public Builder removeAppConnections(int index) { + if (appConnectionsBuilder_ == null) { + ensureAppConnectionsIsMutable(); + appConnections_.remove(index); + onChanged(); + } else { + appConnectionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder + getAppConnectionsBuilder(int index) { + return getAppConnectionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + public com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder + getAppConnectionsOrBuilder(int index) { + if (appConnectionsBuilder_ == null) { + return appConnections_.get(index); + } else { + return appConnectionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder> + getAppConnectionsOrBuilderList() { + if (appConnectionsBuilder_ != null) { + return appConnectionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(appConnections_); + } + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder + addAppConnectionsBuilder() { + return getAppConnectionsFieldBuilder() + .addBuilder( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.getDefaultInstance()); + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder + addAppConnectionsBuilder(int index) { + return getAppConnectionsFieldBuilder() + .addBuilder( + index, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.getDefaultInstance()); + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + public java.util.List + getAppConnectionsBuilderList() { + return getAppConnectionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.beyondcorp.appconnections.v1.AppConnection, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder, + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder> + getAppConnectionsFieldBuilder() { + if (appConnectionsBuilder_ == null) { + appConnectionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.beyondcorp.appconnections.v1.AppConnection, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder, + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder>( + appConnections_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + appConnections_ = null; + } + return appConnectionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + 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; + } + } + /** + * + * + *
+     * A list of 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(); + } + /** + * + * + *
+     * A list of locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * A list of 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); + } + /** + * + * + *
+     * A list of 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); + } + /** + * + * + *
+     * A list of 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; + } + /** + * + * + *
+     * A list of 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; + } + /** + * + * + *
+     * A list of 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; + } + /** + * + * + *
+     * A list of 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; + } + /** + * + * + *
+     * A list of 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.beyondcorp.appconnections.v1.ListAppConnectionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse) + private static final com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse(); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAppConnectionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAppConnectionsResponse(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.beyondcorp.appconnections.v1.ListAppConnectionsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ListAppConnectionsResponseOrBuilder.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ListAppConnectionsResponseOrBuilder.java new file mode 100644 index 000000000000..1087b980caa8 --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ListAppConnectionsResponseOrBuilder.java @@ -0,0 +1,162 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto + +package com.google.cloud.beyondcorp.appconnections.v1; + +public interface ListAppConnectionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of BeyondCorp AppConnections in the project.
+   * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + java.util.List + getAppConnectionsList(); + /** + * + * + *
+   * A list of BeyondCorp AppConnections in the project.
+   * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + com.google.cloud.beyondcorp.appconnections.v1.AppConnection getAppConnections(int index); + /** + * + * + *
+   * A list of BeyondCorp AppConnections in the project.
+   * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + int getAppConnectionsCount(); + /** + * + * + *
+   * A list of BeyondCorp AppConnections in the project.
+   * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + java.util.List + getAppConnectionsOrBuilderList(); + /** + * + * + *
+   * A list of BeyondCorp AppConnections in the project.
+   * 
+ * + * repeated .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connections = 1; + * + */ + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder getAppConnectionsOrBuilder( + int index); + + /** + * + * + *
+   * A token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * A list of locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * A list of locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * A list of 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); + /** + * + * + *
+   * A list of 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/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/LocationName.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/LocationName.java new file mode 100644 index 000000000000..99f7a1aedaef --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.beyondcorp.appconnections.v1; + +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) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ResolveAppConnectionsRequest.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ResolveAppConnectionsRequest.java new file mode 100644 index 000000000000..88a1c5a0b438 --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ResolveAppConnectionsRequest.java @@ -0,0 +1,1187 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto + +package com.google.cloud.beyondcorp.appconnections.v1; + +/** + * + * + *
+ * Request message for BeyondCorp.ResolveAppConnections.
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest} + */ +public final class ResolveAppConnectionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest) + ResolveAppConnectionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResolveAppConnectionsRequest.newBuilder() to construct. + private ResolveAppConnectionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResolveAppConnectionsRequest() { + parent_ = ""; + appConnectorId_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ResolveAppConnectionsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ResolveAppConnectionsRequest( + 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(); + + appConnectorId_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest.class, + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest.Builder + .class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The resource name of the AppConnection location using the form:
+   * `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.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 resource name of the AppConnection location using the form:
+   * `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @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 APP_CONNECTOR_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object appConnectorId_; + /** + * + * + *
+   * Required. BeyondCorp Connector name of the connector associated with those
+   * AppConnections using the form:
+   * `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}`
+   * 
+ * + * + * string app_connector_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The appConnectorId. + */ + @java.lang.Override + public java.lang.String getAppConnectorId() { + java.lang.Object ref = appConnectorId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appConnectorId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. BeyondCorp Connector name of the connector associated with those
+   * AppConnections using the form:
+   * `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}`
+   * 
+ * + * + * string app_connector_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for appConnectorId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAppConnectorIdBytes() { + java.lang.Object ref = appConnectorId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + appConnectorId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * Optional. The maximum number of items to return.
+   * If not specified, a default value of 50 will be used by the service.
+   * Regardless of the page_size value, the response may include a partial list
+   * and a caller should only rely on response's
+   * [next_page_token][BeyondCorp.ResolveAppConnectionsResponse.next_page_token]
+   * to determine if there are more instances left to be queried.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous
+   * ResolveAppConnectionsResponse, if any.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous
+   * ResolveAppConnectionsResponse, if any.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appConnectorId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, appConnectorId_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appConnectorId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, appConnectorId_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest other = + (com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getAppConnectorId().equals(other.getAppConnectorId())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + APP_CONNECTOR_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppConnectorId().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest + 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.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest + 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.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest + 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.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest + 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.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest + 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.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for BeyondCorp.ResolveAppConnections.
+   * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest) + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest.class, + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest.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_ = ""; + + appConnectorId_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest build() { + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest + buildPartial() { + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest result = + new com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest(this); + result.parent_ = parent_; + result.appConnectorId_ = appConnectorId_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest) { + return mergeFrom( + (com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest other) { + if (other + == com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getAppConnectorId().isEmpty()) { + appConnectorId_ = other.appConnectorId_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource name of the AppConnection location using the form:
+     * `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the AppConnection location using the form:
+     * `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the AppConnection location using the form:
+     * `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the AppConnection location using the form:
+     * `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the AppConnection location using the form:
+     * `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object appConnectorId_ = ""; + /** + * + * + *
+     * Required. BeyondCorp Connector name of the connector associated with those
+     * AppConnections using the form:
+     * `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}`
+     * 
+ * + * + * string app_connector_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The appConnectorId. + */ + public java.lang.String getAppConnectorId() { + java.lang.Object ref = appConnectorId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appConnectorId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. BeyondCorp Connector name of the connector associated with those
+     * AppConnections using the form:
+     * `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}`
+     * 
+ * + * + * string app_connector_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for appConnectorId. + */ + public com.google.protobuf.ByteString getAppConnectorIdBytes() { + java.lang.Object ref = appConnectorId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + appConnectorId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. BeyondCorp Connector name of the connector associated with those
+     * AppConnections using the form:
+     * `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}`
+     * 
+ * + * + * string app_connector_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The appConnectorId to set. + * @return This builder for chaining. + */ + public Builder setAppConnectorId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + appConnectorId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. BeyondCorp Connector name of the connector associated with those
+     * AppConnections using the form:
+     * `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}`
+     * 
+ * + * + * string app_connector_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearAppConnectorId() { + + appConnectorId_ = getDefaultInstance().getAppConnectorId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. BeyondCorp Connector name of the connector associated with those
+     * AppConnections using the form:
+     * `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}`
+     * 
+ * + * + * string app_connector_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for appConnectorId to set. + * @return This builder for chaining. + */ + public Builder setAppConnectorIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + appConnectorId_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of items to return.
+     * If not specified, a default value of 50 will be used by the service.
+     * Regardless of the page_size value, the response may include a partial list
+     * and a caller should only rely on response's
+     * [next_page_token][BeyondCorp.ResolveAppConnectionsResponse.next_page_token]
+     * to determine if there are more instances left to be queried.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of items to return.
+     * If not specified, a default value of 50 will be used by the service.
+     * Regardless of the page_size value, the response may include a partial list
+     * and a caller should only rely on response's
+     * [next_page_token][BeyondCorp.ResolveAppConnectionsResponse.next_page_token]
+     * to determine if there are more instances left to be queried.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of items to return.
+     * If not specified, a default value of 50 will be used by the service.
+     * Regardless of the page_size value, the response may include a partial list
+     * and a caller should only rely on response's
+     * [next_page_token][BeyondCorp.ResolveAppConnectionsResponse.next_page_token]
+     * to determine if there are more instances left to be queried.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous
+     * ResolveAppConnectionsResponse, if any.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous
+     * ResolveAppConnectionsResponse, if any.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous
+     * ResolveAppConnectionsResponse, if any.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous
+     * ResolveAppConnectionsResponse, if any.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous
+     * ResolveAppConnectionsResponse, if any.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest) + private static final com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest(); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResolveAppConnectionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ResolveAppConnectionsRequest(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.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ResolveAppConnectionsRequestOrBuilder.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ResolveAppConnectionsRequestOrBuilder.java new file mode 100644 index 000000000000..a6a83c3a65e0 --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ResolveAppConnectionsRequestOrBuilder.java @@ -0,0 +1,134 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto + +package com.google.cloud.beyondcorp.appconnections.v1; + +public interface ResolveAppConnectionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the AppConnection location using the form:
+   * `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource name of the AppConnection location using the form:
+   * `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. BeyondCorp Connector name of the connector associated with those
+   * AppConnections using the form:
+   * `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}`
+   * 
+ * + * + * string app_connector_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The appConnectorId. + */ + java.lang.String getAppConnectorId(); + /** + * + * + *
+   * Required. BeyondCorp Connector name of the connector associated with those
+   * AppConnections using the form:
+   * `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}`
+   * 
+ * + * + * string app_connector_id = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for appConnectorId. + */ + com.google.protobuf.ByteString getAppConnectorIdBytes(); + + /** + * + * + *
+   * Optional. The maximum number of items to return.
+   * If not specified, a default value of 50 will be used by the service.
+   * Regardless of the page_size value, the response may include a partial list
+   * and a caller should only rely on response's
+   * [next_page_token][BeyondCorp.ResolveAppConnectionsResponse.next_page_token]
+   * to determine if there are more instances left to be queried.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous
+   * ResolveAppConnectionsResponse, if any.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous
+   * ResolveAppConnectionsResponse, if any.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ResolveAppConnectionsResponse.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ResolveAppConnectionsResponse.java new file mode 100644 index 000000000000..0489d78a1099 --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ResolveAppConnectionsResponse.java @@ -0,0 +1,2757 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto + +package com.google.cloud.beyondcorp.appconnections.v1; + +/** + * + * + *
+ * Response message for BeyondCorp.ResolveAppConnections.
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse} + */ +public final class ResolveAppConnectionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse) + ResolveAppConnectionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResolveAppConnectionsResponse.newBuilder() to construct. + private ResolveAppConnectionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResolveAppConnectionsResponse() { + appConnectionDetails_ = 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 ResolveAppConnectionsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ResolveAppConnectionsResponse( + 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)) { + appConnectionDetails_ = + new java.util.ArrayList< + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails>(); + mutable_bitField0_ |= 0x00000001; + } + appConnectionDetails_.add( + input.readMessage( + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails.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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + appConnectionDetails_ = java.util.Collections.unmodifiableList(appConnectionDetails_); + } + 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.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.class, + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.Builder + .class); + } + + public interface AppConnectionDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * A BeyondCorp AppConnection in the project.
+     * 
+ * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 1; + * + * @return Whether the appConnection field is set. + */ + boolean hasAppConnection(); + /** + * + * + *
+     * A BeyondCorp AppConnection in the project.
+     * 
+ * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 1; + * + * @return The appConnection. + */ + com.google.cloud.beyondcorp.appconnections.v1.AppConnection getAppConnection(); + /** + * + * + *
+     * A BeyondCorp AppConnection in the project.
+     * 
+ * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 1; + */ + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder + getAppConnectionOrBuilder(); + + /** + * + * + *
+     * If type=GCP_REGIONAL_MIG, contains most recent VM instances, like
+     * `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}`.
+     * 
+ * + * repeated string recent_mig_vms = 2; + * + * @return A list containing the recentMigVms. + */ + java.util.List getRecentMigVmsList(); + /** + * + * + *
+     * If type=GCP_REGIONAL_MIG, contains most recent VM instances, like
+     * `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}`.
+     * 
+ * + * repeated string recent_mig_vms = 2; + * + * @return The count of recentMigVms. + */ + int getRecentMigVmsCount(); + /** + * + * + *
+     * If type=GCP_REGIONAL_MIG, contains most recent VM instances, like
+     * `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}`.
+     * 
+ * + * repeated string recent_mig_vms = 2; + * + * @param index The index of the element to return. + * @return The recentMigVms at the given index. + */ + java.lang.String getRecentMigVms(int index); + /** + * + * + *
+     * If type=GCP_REGIONAL_MIG, contains most recent VM instances, like
+     * `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}`.
+     * 
+ * + * repeated string recent_mig_vms = 2; + * + * @param index The index of the value to return. + * @return The bytes of the recentMigVms at the given index. + */ + com.google.protobuf.ByteString getRecentMigVmsBytes(int index); + } + /** + * + * + *
+   * Details of the AppConnection.
+   * 
+ * + * Protobuf type {@code + * google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails} + */ + public static final class AppConnectionDetails extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails) + AppConnectionDetailsOrBuilder { + private static final long serialVersionUID = 0L; + // Use AppConnectionDetails.newBuilder() to construct. + private AppConnectionDetails(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AppConnectionDetails() { + recentMigVms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AppConnectionDetails(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AppConnectionDetails( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder subBuilder = + null; + if (appConnection_ != null) { + subBuilder = appConnection_.toBuilder(); + } + appConnection_ = + input.readMessage( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(appConnection_); + appConnection_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + recentMigVms_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + recentMigVms_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + recentMigVms_ = recentMigVms_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsResponse_AppConnectionDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsResponse_AppConnectionDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails.class, + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails.Builder.class); + } + + public static final int APP_CONNECTION_FIELD_NUMBER = 1; + private com.google.cloud.beyondcorp.appconnections.v1.AppConnection appConnection_; + /** + * + * + *
+     * A BeyondCorp AppConnection in the project.
+     * 
+ * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 1; + * + * @return Whether the appConnection field is set. + */ + @java.lang.Override + public boolean hasAppConnection() { + return appConnection_ != null; + } + /** + * + * + *
+     * A BeyondCorp AppConnection in the project.
+     * 
+ * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 1; + * + * @return The appConnection. + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection getAppConnection() { + return appConnection_ == null + ? com.google.cloud.beyondcorp.appconnections.v1.AppConnection.getDefaultInstance() + : appConnection_; + } + /** + * + * + *
+     * A BeyondCorp AppConnection in the project.
+     * 
+ * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 1; + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder + getAppConnectionOrBuilder() { + return getAppConnection(); + } + + public static final int RECENT_MIG_VMS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList recentMigVms_; + /** + * + * + *
+     * If type=GCP_REGIONAL_MIG, contains most recent VM instances, like
+     * `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}`.
+     * 
+ * + * repeated string recent_mig_vms = 2; + * + * @return A list containing the recentMigVms. + */ + public com.google.protobuf.ProtocolStringList getRecentMigVmsList() { + return recentMigVms_; + } + /** + * + * + *
+     * If type=GCP_REGIONAL_MIG, contains most recent VM instances, like
+     * `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}`.
+     * 
+ * + * repeated string recent_mig_vms = 2; + * + * @return The count of recentMigVms. + */ + public int getRecentMigVmsCount() { + return recentMigVms_.size(); + } + /** + * + * + *
+     * If type=GCP_REGIONAL_MIG, contains most recent VM instances, like
+     * `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}`.
+     * 
+ * + * repeated string recent_mig_vms = 2; + * + * @param index The index of the element to return. + * @return The recentMigVms at the given index. + */ + public java.lang.String getRecentMigVms(int index) { + return recentMigVms_.get(index); + } + /** + * + * + *
+     * If type=GCP_REGIONAL_MIG, contains most recent VM instances, like
+     * `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}`.
+     * 
+ * + * repeated string recent_mig_vms = 2; + * + * @param index The index of the value to return. + * @return The bytes of the recentMigVms at the given index. + */ + public com.google.protobuf.ByteString getRecentMigVmsBytes(int index) { + return recentMigVms_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (appConnection_ != null) { + output.writeMessage(1, getAppConnection()); + } + for (int i = 0; i < recentMigVms_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, recentMigVms_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (appConnection_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getAppConnection()); + } + { + int dataSize = 0; + for (int i = 0; i < recentMigVms_.size(); i++) { + dataSize += computeStringSizeNoTag(recentMigVms_.getRaw(i)); + } + size += dataSize; + size += 1 * getRecentMigVmsList().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.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + other = + (com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails) + obj; + + if (hasAppConnection() != other.hasAppConnection()) return false; + if (hasAppConnection()) { + if (!getAppConnection().equals(other.getAppConnection())) return false; + } + if (!getRecentMigVmsList().equals(other.getRecentMigVmsList())) 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 (hasAppConnection()) { + hash = (37 * hash) + APP_CONNECTION_FIELD_NUMBER; + hash = (53 * hash) + getAppConnection().hashCode(); + } + if (getRecentMigVmsCount() > 0) { + hash = (37 * hash) + RECENT_MIG_VMS_FIELD_NUMBER; + hash = (53 * hash) + getRecentMigVmsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + 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.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + 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.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + 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.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + 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.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + 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.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + 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; + } + /** + * + * + *
+     * Details of the AppConnection.
+     * 
+ * + * Protobuf type {@code + * google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails) + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsResponse_AppConnectionDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsResponse_AppConnectionDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails.class, + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails.Builder.class); + } + + // Construct using + // com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails.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 (appConnectionBuilder_ == null) { + appConnection_ = null; + } else { + appConnection_ = null; + appConnectionBuilder_ = null; + } + recentMigVms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsResponse_AppConnectionDetails_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + build() { + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + buildPartial() { + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + result = + new com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails(this); + int from_bitField0_ = bitField0_; + if (appConnectionBuilder_ == null) { + result.appConnection_ = appConnection_; + } else { + result.appConnection_ = appConnectionBuilder_.build(); + } + if (((bitField0_ & 0x00000001) != 0)) { + recentMigVms_ = recentMigVms_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.recentMigVms_ = recentMigVms_; + 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.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails) { + return mergeFrom( + (com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + other) { + if (other + == com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails.getDefaultInstance()) return this; + if (other.hasAppConnection()) { + mergeAppConnection(other.getAppConnection()); + } + if (!other.recentMigVms_.isEmpty()) { + if (recentMigVms_.isEmpty()) { + recentMigVms_ = other.recentMigVms_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRecentMigVmsIsMutable(); + recentMigVms_.addAll(other.recentMigVms_); + } + 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.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.cloud.beyondcorp.appconnections.v1.AppConnection appConnection_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.beyondcorp.appconnections.v1.AppConnection, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder, + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder> + appConnectionBuilder_; + /** + * + * + *
+       * A BeyondCorp AppConnection in the project.
+       * 
+ * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 1; + * + * @return Whether the appConnection field is set. + */ + public boolean hasAppConnection() { + return appConnectionBuilder_ != null || appConnection_ != null; + } + /** + * + * + *
+       * A BeyondCorp AppConnection in the project.
+       * 
+ * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 1; + * + * @return The appConnection. + */ + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection getAppConnection() { + if (appConnectionBuilder_ == null) { + return appConnection_ == null + ? com.google.cloud.beyondcorp.appconnections.v1.AppConnection.getDefaultInstance() + : appConnection_; + } else { + return appConnectionBuilder_.getMessage(); + } + } + /** + * + * + *
+       * A BeyondCorp AppConnection in the project.
+       * 
+ * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 1; + */ + public Builder setAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection value) { + if (appConnectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + appConnection_ = value; + onChanged(); + } else { + appConnectionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * A BeyondCorp AppConnection in the project.
+       * 
+ * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 1; + */ + public Builder setAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder builderForValue) { + if (appConnectionBuilder_ == null) { + appConnection_ = builderForValue.build(); + onChanged(); + } else { + appConnectionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * A BeyondCorp AppConnection in the project.
+       * 
+ * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 1; + */ + public Builder mergeAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection value) { + if (appConnectionBuilder_ == null) { + if (appConnection_ != null) { + appConnection_ = + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.newBuilder( + appConnection_) + .mergeFrom(value) + .buildPartial(); + } else { + appConnection_ = value; + } + onChanged(); + } else { + appConnectionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * A BeyondCorp AppConnection in the project.
+       * 
+ * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 1; + */ + public Builder clearAppConnection() { + if (appConnectionBuilder_ == null) { + appConnection_ = null; + onChanged(); + } else { + appConnection_ = null; + appConnectionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * A BeyondCorp AppConnection in the project.
+       * 
+ * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 1; + */ + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder + getAppConnectionBuilder() { + + onChanged(); + return getAppConnectionFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * A BeyondCorp AppConnection in the project.
+       * 
+ * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 1; + */ + public com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder + getAppConnectionOrBuilder() { + if (appConnectionBuilder_ != null) { + return appConnectionBuilder_.getMessageOrBuilder(); + } else { + return appConnection_ == null + ? com.google.cloud.beyondcorp.appconnections.v1.AppConnection.getDefaultInstance() + : appConnection_; + } + } + /** + * + * + *
+       * A BeyondCorp AppConnection in the project.
+       * 
+ * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.beyondcorp.appconnections.v1.AppConnection, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder, + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder> + getAppConnectionFieldBuilder() { + if (appConnectionBuilder_ == null) { + appConnectionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.beyondcorp.appconnections.v1.AppConnection, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder, + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder>( + getAppConnection(), getParentForChildren(), isClean()); + appConnection_ = null; + } + return appConnectionBuilder_; + } + + private com.google.protobuf.LazyStringList recentMigVms_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureRecentMigVmsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + recentMigVms_ = new com.google.protobuf.LazyStringArrayList(recentMigVms_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * If type=GCP_REGIONAL_MIG, contains most recent VM instances, like
+       * `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}`.
+       * 
+ * + * repeated string recent_mig_vms = 2; + * + * @return A list containing the recentMigVms. + */ + public com.google.protobuf.ProtocolStringList getRecentMigVmsList() { + return recentMigVms_.getUnmodifiableView(); + } + /** + * + * + *
+       * If type=GCP_REGIONAL_MIG, contains most recent VM instances, like
+       * `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}`.
+       * 
+ * + * repeated string recent_mig_vms = 2; + * + * @return The count of recentMigVms. + */ + public int getRecentMigVmsCount() { + return recentMigVms_.size(); + } + /** + * + * + *
+       * If type=GCP_REGIONAL_MIG, contains most recent VM instances, like
+       * `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}`.
+       * 
+ * + * repeated string recent_mig_vms = 2; + * + * @param index The index of the element to return. + * @return The recentMigVms at the given index. + */ + public java.lang.String getRecentMigVms(int index) { + return recentMigVms_.get(index); + } + /** + * + * + *
+       * If type=GCP_REGIONAL_MIG, contains most recent VM instances, like
+       * `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}`.
+       * 
+ * + * repeated string recent_mig_vms = 2; + * + * @param index The index of the value to return. + * @return The bytes of the recentMigVms at the given index. + */ + public com.google.protobuf.ByteString getRecentMigVmsBytes(int index) { + return recentMigVms_.getByteString(index); + } + /** + * + * + *
+       * If type=GCP_REGIONAL_MIG, contains most recent VM instances, like
+       * `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}`.
+       * 
+ * + * repeated string recent_mig_vms = 2; + * + * @param index The index to set the value at. + * @param value The recentMigVms to set. + * @return This builder for chaining. + */ + public Builder setRecentMigVms(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRecentMigVmsIsMutable(); + recentMigVms_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * If type=GCP_REGIONAL_MIG, contains most recent VM instances, like
+       * `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}`.
+       * 
+ * + * repeated string recent_mig_vms = 2; + * + * @param value The recentMigVms to add. + * @return This builder for chaining. + */ + public Builder addRecentMigVms(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRecentMigVmsIsMutable(); + recentMigVms_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * If type=GCP_REGIONAL_MIG, contains most recent VM instances, like
+       * `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}`.
+       * 
+ * + * repeated string recent_mig_vms = 2; + * + * @param values The recentMigVms to add. + * @return This builder for chaining. + */ + public Builder addAllRecentMigVms(java.lang.Iterable values) { + ensureRecentMigVmsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, recentMigVms_); + onChanged(); + return this; + } + /** + * + * + *
+       * If type=GCP_REGIONAL_MIG, contains most recent VM instances, like
+       * `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}`.
+       * 
+ * + * repeated string recent_mig_vms = 2; + * + * @return This builder for chaining. + */ + public Builder clearRecentMigVms() { + recentMigVms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * If type=GCP_REGIONAL_MIG, contains most recent VM instances, like
+       * `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}`.
+       * 
+ * + * repeated string recent_mig_vms = 2; + * + * @param value The bytes of the recentMigVms to add. + * @return This builder for chaining. + */ + public Builder addRecentMigVmsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRecentMigVmsIsMutable(); + recentMigVms_.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.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails) + private static final com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails(); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AppConnectionDetails parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AppConnectionDetails(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.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int APP_CONNECTION_DETAILS_FIELD_NUMBER = 1; + private java.util.List< + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails> + appConnectionDetails_; + /** + * + * + *
+   * A list of BeyondCorp AppConnections with details in the project.
+   * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + @java.lang.Override + public java.util.List< + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails> + getAppConnectionDetailsList() { + return appConnectionDetails_; + } + /** + * + * + *
+   * A list of BeyondCorp AppConnections with details in the project.
+   * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetailsOrBuilder> + getAppConnectionDetailsOrBuilderList() { + return appConnectionDetails_; + } + /** + * + * + *
+   * A list of BeyondCorp AppConnections with details in the project.
+   * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + @java.lang.Override + public int getAppConnectionDetailsCount() { + return appConnectionDetails_.size(); + } + /** + * + * + *
+   * A list of BeyondCorp AppConnections with details in the project.
+   * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + getAppConnectionDetails(int index) { + return appConnectionDetails_.get(index); + } + /** + * + * + *
+   * A list of BeyondCorp AppConnections with details in the project.
+   * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetailsOrBuilder + getAppConnectionDetailsOrBuilder(int index) { + return appConnectionDetails_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * A list of locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * A list of locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * A list of 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); + } + /** + * + * + *
+   * A list of 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 < appConnectionDetails_.size(); i++) { + output.writeMessage(1, appConnectionDetails_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + 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 < appConnectionDetails_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, appConnectionDetails_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + 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.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse other = + (com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse) obj; + + if (!getAppConnectionDetailsList().equals(other.getAppConnectionDetailsList())) 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 (getAppConnectionDetailsCount() > 0) { + hash = (37 * hash) + APP_CONNECTION_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getAppConnectionDetailsList().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.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + 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.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + 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.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + 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.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + 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.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + 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.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for BeyondCorp.ResolveAppConnections.
+   * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse) + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.class, + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.Builder + .class); + } + + // Construct using + // com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAppConnectionDetailsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (appConnectionDetailsBuilder_ == null) { + appConnectionDetails_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + appConnectionDetailsBuilder_.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.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_ResolveAppConnectionsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse build() { + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + buildPartial() { + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse result = + new com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse(this); + int from_bitField0_ = bitField0_; + if (appConnectionDetailsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + appConnectionDetails_ = java.util.Collections.unmodifiableList(appConnectionDetails_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.appConnectionDetails_ = appConnectionDetails_; + } else { + result.appConnectionDetails_ = appConnectionDetailsBuilder_.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.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse) { + return mergeFrom( + (com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse other) { + if (other + == com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .getDefaultInstance()) return this; + if (appConnectionDetailsBuilder_ == null) { + if (!other.appConnectionDetails_.isEmpty()) { + if (appConnectionDetails_.isEmpty()) { + appConnectionDetails_ = other.appConnectionDetails_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAppConnectionDetailsIsMutable(); + appConnectionDetails_.addAll(other.appConnectionDetails_); + } + onChanged(); + } + } else { + if (!other.appConnectionDetails_.isEmpty()) { + if (appConnectionDetailsBuilder_.isEmpty()) { + appConnectionDetailsBuilder_.dispose(); + appConnectionDetailsBuilder_ = null; + appConnectionDetails_ = other.appConnectionDetails_; + bitField0_ = (bitField0_ & ~0x00000001); + appConnectionDetailsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAppConnectionDetailsFieldBuilder() + : null; + } else { + appConnectionDetailsBuilder_.addAllMessages(other.appConnectionDetails_); + } + } + } + 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.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List< + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails> + appConnectionDetails_ = java.util.Collections.emptyList(); + + private void ensureAppConnectionDetailsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + appConnectionDetails_ = + new java.util.ArrayList< + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails>(appConnectionDetails_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails, + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails.Builder, + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetailsOrBuilder> + appConnectionDetailsBuilder_; + + /** + * + * + *
+     * A list of BeyondCorp AppConnections with details in the project.
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + public java.util.List< + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails> + getAppConnectionDetailsList() { + if (appConnectionDetailsBuilder_ == null) { + return java.util.Collections.unmodifiableList(appConnectionDetails_); + } else { + return appConnectionDetailsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections with details in the project.
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + public int getAppConnectionDetailsCount() { + if (appConnectionDetailsBuilder_ == null) { + return appConnectionDetails_.size(); + } else { + return appConnectionDetailsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections with details in the project.
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + public com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + getAppConnectionDetails(int index) { + if (appConnectionDetailsBuilder_ == null) { + return appConnectionDetails_.get(index); + } else { + return appConnectionDetailsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections with details in the project.
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + public Builder setAppConnectionDetails( + int index, + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + value) { + if (appConnectionDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAppConnectionDetailsIsMutable(); + appConnectionDetails_.set(index, value); + onChanged(); + } else { + appConnectionDetailsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections with details in the project.
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + public Builder setAppConnectionDetails( + int index, + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails.Builder + builderForValue) { + if (appConnectionDetailsBuilder_ == null) { + ensureAppConnectionDetailsIsMutable(); + appConnectionDetails_.set(index, builderForValue.build()); + onChanged(); + } else { + appConnectionDetailsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections with details in the project.
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + public Builder addAppConnectionDetails( + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + value) { + if (appConnectionDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAppConnectionDetailsIsMutable(); + appConnectionDetails_.add(value); + onChanged(); + } else { + appConnectionDetailsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections with details in the project.
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + public Builder addAppConnectionDetails( + int index, + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails + value) { + if (appConnectionDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAppConnectionDetailsIsMutable(); + appConnectionDetails_.add(index, value); + onChanged(); + } else { + appConnectionDetailsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections with details in the project.
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + public Builder addAppConnectionDetails( + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails.Builder + builderForValue) { + if (appConnectionDetailsBuilder_ == null) { + ensureAppConnectionDetailsIsMutable(); + appConnectionDetails_.add(builderForValue.build()); + onChanged(); + } else { + appConnectionDetailsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections with details in the project.
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + public Builder addAppConnectionDetails( + int index, + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails.Builder + builderForValue) { + if (appConnectionDetailsBuilder_ == null) { + ensureAppConnectionDetailsIsMutable(); + appConnectionDetails_.add(index, builderForValue.build()); + onChanged(); + } else { + appConnectionDetailsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections with details in the project.
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + public Builder addAllAppConnectionDetails( + java.lang.Iterable< + ? extends + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails> + values) { + if (appConnectionDetailsBuilder_ == null) { + ensureAppConnectionDetailsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, appConnectionDetails_); + onChanged(); + } else { + appConnectionDetailsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections with details in the project.
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + public Builder clearAppConnectionDetails() { + if (appConnectionDetailsBuilder_ == null) { + appConnectionDetails_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + appConnectionDetailsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections with details in the project.
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + public Builder removeAppConnectionDetails(int index) { + if (appConnectionDetailsBuilder_ == null) { + ensureAppConnectionDetailsIsMutable(); + appConnectionDetails_.remove(index); + onChanged(); + } else { + appConnectionDetailsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections with details in the project.
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + public com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails.Builder + getAppConnectionDetailsBuilder(int index) { + return getAppConnectionDetailsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections with details in the project.
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + public com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetailsOrBuilder + getAppConnectionDetailsOrBuilder(int index) { + if (appConnectionDetailsBuilder_ == null) { + return appConnectionDetails_.get(index); + } else { + return appConnectionDetailsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections with details in the project.
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetailsOrBuilder> + getAppConnectionDetailsOrBuilderList() { + if (appConnectionDetailsBuilder_ != null) { + return appConnectionDetailsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(appConnectionDetails_); + } + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections with details in the project.
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + public com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails.Builder + addAppConnectionDetailsBuilder() { + return getAppConnectionDetailsFieldBuilder() + .addBuilder( + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails.getDefaultInstance()); + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections with details in the project.
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + public com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails.Builder + addAppConnectionDetailsBuilder(int index) { + return getAppConnectionDetailsFieldBuilder() + .addBuilder( + index, + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails.getDefaultInstance()); + } + /** + * + * + *
+     * A list of BeyondCorp AppConnections with details in the project.
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + public java.util.List< + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails.Builder> + getAppConnectionDetailsBuilderList() { + return getAppConnectionDetailsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails, + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails.Builder, + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetailsOrBuilder> + getAppConnectionDetailsFieldBuilder() { + if (appConnectionDetailsBuilder_ == null) { + appConnectionDetailsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails, + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails.Builder, + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetailsOrBuilder>( + appConnectionDetails_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + appConnectionDetails_ = null; + } + return appConnectionDetailsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + 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; + } + } + /** + * + * + *
+     * A list of 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(); + } + /** + * + * + *
+     * A list of locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * A list of 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); + } + /** + * + * + *
+     * A list of 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); + } + /** + * + * + *
+     * A list of 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; + } + /** + * + * + *
+     * A list of 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; + } + /** + * + * + *
+     * A list of 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; + } + /** + * + * + *
+     * A list of 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; + } + /** + * + * + *
+     * A list of 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.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse) + private static final com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse(); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResolveAppConnectionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ResolveAppConnectionsResponse(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.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ResolveAppConnectionsResponseOrBuilder.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ResolveAppConnectionsResponseOrBuilder.java new file mode 100644 index 000000000000..80964045f642 --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/ResolveAppConnectionsResponseOrBuilder.java @@ -0,0 +1,174 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto + +package com.google.cloud.beyondcorp.appconnections.v1; + +public interface ResolveAppConnectionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of BeyondCorp AppConnections with details in the project.
+   * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + java.util.List< + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetails> + getAppConnectionDetailsList(); + /** + * + * + *
+   * A list of BeyondCorp AppConnections with details in the project.
+   * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails + getAppConnectionDetails(int index); + /** + * + * + *
+   * A list of BeyondCorp AppConnections with details in the project.
+   * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + int getAppConnectionDetailsCount(); + /** + * + * + *
+   * A list of BeyondCorp AppConnections with details in the project.
+   * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + java.util.List< + ? extends + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetailsOrBuilder> + getAppConnectionDetailsOrBuilderList(); + /** + * + * + *
+   * A list of BeyondCorp AppConnections with details in the project.
+   * 
+ * + * + * repeated .google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails app_connection_details = 1; + * + */ + com.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse + .AppConnectionDetailsOrBuilder + getAppConnectionDetailsOrBuilder(int index); + + /** + * + * + *
+   * A token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * A list of locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * A list of locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * A list of 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); + /** + * + * + *
+   * A list of 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/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/UpdateAppConnectionRequest.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/UpdateAppConnectionRequest.java new file mode 100644 index 000000000000..8ff38c4b7501 --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/UpdateAppConnectionRequest.java @@ -0,0 +1,1585 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto + +package com.google.cloud.beyondcorp.appconnections.v1; + +/** + * + * + *
+ * Request message for BeyondCorp.UpdateAppConnection.
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest} + */ +public final class UpdateAppConnectionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest) + UpdateAppConnectionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateAppConnectionRequest.newBuilder() to construct. + private UpdateAppConnectionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateAppConnectionRequest() { + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateAppConnectionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateAppConnectionRequest( + 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.beyondcorp.appconnections.v1.AppConnection.Builder subBuilder = null; + if (appConnection_ != null) { + subBuilder = appConnection_.toBuilder(); + } + appConnection_ = + input.readMessage( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(appConnection_); + appConnection_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + case 32: + { + validateOnly_ = input.readBool(); + break; + } + case 40: + { + allowMissing_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_UpdateAppConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_UpdateAppConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest.class, + com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [BeyondCorp.AppConnection]:
+   * * `labels`
+   * * `display_name`
+   * * `application_endpoint`
+   * * `connectors`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [BeyondCorp.AppConnection]:
+   * * `labels`
+   * * `display_name`
+   * * `application_endpoint`
+   * * `connectors`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [BeyondCorp.AppConnection]:
+   * * `labels`
+   * * `display_name`
+   * * `application_endpoint`
+   * * `connectors`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int APP_CONNECTION_FIELD_NUMBER = 2; + private com.google.cloud.beyondcorp.appconnections.v1.AppConnection appConnection_; + /** + * + * + *
+   * Required. AppConnection message with updated fields. Only supported fields
+   * specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the appConnection field is set. + */ + @java.lang.Override + public boolean hasAppConnection() { + return appConnection_ != null; + } + /** + * + * + *
+   * Required. AppConnection message with updated fields. Only supported fields
+   * specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The appConnection. + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection getAppConnection() { + return appConnection_ == null + ? com.google.cloud.beyondcorp.appconnections.v1.AppConnection.getDefaultInstance() + : appConnection_; + } + /** + * + * + *
+   * Required. AppConnection message with updated fields. Only supported fields
+   * specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder + getAppConnectionOrBuilder() { + return getAppConnection(); + } + + 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; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_; + /** + * + * + *
+   * Optional. If set, validates request by executing a dry-run which would not
+   * alter the resource in any way.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 5; + private boolean allowMissing_; + /** + * + * + *
+   * Optional. If set as true, will create the resource if it is not found.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + 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 (appConnection_ != null) { + output.writeMessage(2, getAppConnection()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + if (allowMissing_ != false) { + output.writeBool(5, allowMissing_); + } + 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 (appConnection_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAppConnection()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, allowMissing_); + } + 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.beyondcorp.appconnections.v1.UpdateAppConnectionRequest)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest other = + (com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasAppConnection() != other.hasAppConnection()) return false; + if (hasAppConnection()) { + if (!getAppConnection().equals(other.getAppConnection())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (getAllowMissing() != other.getAllowMissing()) 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 (hasAppConnection()) { + hash = (37 * hash) + APP_CONNECTION_FIELD_NUMBER; + hash = (53 * hash) + getAppConnection().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest 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.beyondcorp.appconnections.v1.UpdateAppConnectionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest 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.beyondcorp.appconnections.v1.UpdateAppConnectionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest 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.beyondcorp.appconnections.v1.UpdateAppConnectionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest + 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.beyondcorp.appconnections.v1.UpdateAppConnectionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest 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.beyondcorp.appconnections.v1.UpdateAppConnectionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for BeyondCorp.UpdateAppConnection.
+   * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest) + com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_UpdateAppConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_UpdateAppConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest.class, + com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest.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 (appConnectionBuilder_ == null) { + appConnection_ = null; + } else { + appConnection_ = null; + appConnectionBuilder_ = null; + } + requestId_ = ""; + + validateOnly_ = false; + + allowMissing_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.beyondcorp.appconnections.v1.AppConnectionsServiceProto + .internal_static_google_cloud_beyondcorp_appconnections_v1_UpdateAppConnectionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest build() { + com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest buildPartial() { + com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest result = + new com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest(this); + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + if (appConnectionBuilder_ == null) { + result.appConnection_ = appConnection_; + } else { + result.appConnection_ = appConnectionBuilder_.build(); + } + result.requestId_ = requestId_; + result.validateOnly_ = validateOnly_; + result.allowMissing_ = allowMissing_; + 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.beyondcorp.appconnections.v1.UpdateAppConnectionRequest) { + return mergeFrom( + (com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest other) { + if (other + == com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest + .getDefaultInstance()) return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasAppConnection()) { + mergeAppConnection(other.getAppConnection()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + 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.beyondcorp.appconnections.v1.UpdateAppConnectionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest) + 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_; + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [BeyondCorp.AppConnection]:
+     * * `labels`
+     * * `display_name`
+     * * `application_endpoint`
+     * * `connectors`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [BeyondCorp.AppConnection]:
+     * * `labels`
+     * * `display_name`
+     * * `application_endpoint`
+     * * `connectors`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [BeyondCorp.AppConnection]:
+     * * `labels`
+     * * `display_name`
+     * * `application_endpoint`
+     * * `connectors`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [BeyondCorp.AppConnection]:
+     * * `labels`
+     * * `display_name`
+     * * `application_endpoint`
+     * * `connectors`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [BeyondCorp.AppConnection]:
+     * * `labels`
+     * * `display_name`
+     * * `application_endpoint`
+     * * `connectors`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [BeyondCorp.AppConnection]:
+     * * `labels`
+     * * `display_name`
+     * * `application_endpoint`
+     * * `connectors`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [BeyondCorp.AppConnection]:
+     * * `labels`
+     * * `display_name`
+     * * `application_endpoint`
+     * * `connectors`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [BeyondCorp.AppConnection]:
+     * * `labels`
+     * * `display_name`
+     * * `application_endpoint`
+     * * `connectors`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [BeyondCorp.AppConnection]:
+     * * `labels`
+     * * `display_name`
+     * * `application_endpoint`
+     * * `connectors`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.cloud.beyondcorp.appconnections.v1.AppConnection appConnection_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.beyondcorp.appconnections.v1.AppConnection, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder, + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder> + appConnectionBuilder_; + /** + * + * + *
+     * Required. AppConnection message with updated fields. Only supported fields
+     * specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the appConnection field is set. + */ + public boolean hasAppConnection() { + return appConnectionBuilder_ != null || appConnection_ != null; + } + /** + * + * + *
+     * Required. AppConnection message with updated fields. Only supported fields
+     * specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The appConnection. + */ + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection getAppConnection() { + if (appConnectionBuilder_ == null) { + return appConnection_ == null + ? com.google.cloud.beyondcorp.appconnections.v1.AppConnection.getDefaultInstance() + : appConnection_; + } else { + return appConnectionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. AppConnection message with updated fields. Only supported fields
+     * specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection value) { + if (appConnectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + appConnection_ = value; + onChanged(); + } else { + appConnectionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. AppConnection message with updated fields. Only supported fields
+     * specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder builderForValue) { + if (appConnectionBuilder_ == null) { + appConnection_ = builderForValue.build(); + onChanged(); + } else { + appConnectionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. AppConnection message with updated fields. Only supported fields
+     * specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeAppConnection( + com.google.cloud.beyondcorp.appconnections.v1.AppConnection value) { + if (appConnectionBuilder_ == null) { + if (appConnection_ != null) { + appConnection_ = + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.newBuilder(appConnection_) + .mergeFrom(value) + .buildPartial(); + } else { + appConnection_ = value; + } + onChanged(); + } else { + appConnectionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. AppConnection message with updated fields. Only supported fields
+     * specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearAppConnection() { + if (appConnectionBuilder_ == null) { + appConnection_ = null; + onChanged(); + } else { + appConnection_ = null; + appConnectionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. AppConnection message with updated fields. Only supported fields
+     * specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder + getAppConnectionBuilder() { + + onChanged(); + return getAppConnectionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. AppConnection message with updated fields. Only supported fields
+     * specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder + getAppConnectionOrBuilder() { + if (appConnectionBuilder_ != null) { + return appConnectionBuilder_.getMessageOrBuilder(); + } else { + return appConnection_ == null + ? com.google.cloud.beyondcorp.appconnections.v1.AppConnection.getDefaultInstance() + : appConnection_; + } + } + /** + * + * + *
+     * Required. AppConnection message with updated fields. Only supported fields
+     * specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.beyondcorp.appconnections.v1.AppConnection, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder, + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder> + getAppConnectionFieldBuilder() { + if (appConnectionBuilder_ == null) { + appConnectionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.beyondcorp.appconnections.v1.AppConnection, + com.google.cloud.beyondcorp.appconnections.v1.AppConnection.Builder, + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder>( + getAppConnection(), getParentForChildren(), isClean()); + appConnection_ = null; + } + return appConnectionBuilder_; + } + + 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; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, validates request by executing a dry-run which would not
+     * alter the resource in any way.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, validates request by executing a dry-run which would not
+     * alter the resource in any way.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, validates request by executing a dry-run which would not
+     * alter the resource in any way.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + + validateOnly_ = false; + onChanged(); + return this; + } + + private boolean allowMissing_; + /** + * + * + *
+     * Optional. If set as true, will create the resource if it is not found.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * Optional. If set as true, will create the resource if it is not found.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set as true, will create the resource if it is not found.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + + allowMissing_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest) + private static final com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest(); + } + + public static com.google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateAppConnectionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateAppConnectionRequest(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.beyondcorp.appconnections.v1.UpdateAppConnectionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/UpdateAppConnectionRequestOrBuilder.java b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/UpdateAppConnectionRequestOrBuilder.java new file mode 100644 index 000000000000..94aae1f1dc95 --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/java/com/google/cloud/beyondcorp/appconnections/v1/UpdateAppConnectionRequestOrBuilder.java @@ -0,0 +1,197 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto + +package com.google.cloud.beyondcorp.appconnections.v1; + +public interface UpdateAppConnectionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [BeyondCorp.AppConnection]:
+   * * `labels`
+   * * `display_name`
+   * * `application_endpoint`
+   * * `connectors`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [BeyondCorp.AppConnection]:
+   * * `labels`
+   * * `display_name`
+   * * `application_endpoint`
+   * * `connectors`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [BeyondCorp.AppConnection]:
+   * * `labels`
+   * * `display_name`
+   * * `application_endpoint`
+   * * `connectors`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. AppConnection message with updated fields. Only supported fields
+   * specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the appConnection field is set. + */ + boolean hasAppConnection(); + /** + * + * + *
+   * Required. AppConnection message with updated fields. Only supported fields
+   * specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The appConnection. + */ + com.google.cloud.beyondcorp.appconnections.v1.AppConnection getAppConnection(); + /** + * + * + *
+   * Required. AppConnection message with updated fields. Only supported fields
+   * specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.beyondcorp.appconnections.v1.AppConnection app_connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.beyondcorp.appconnections.v1.AppConnectionOrBuilder getAppConnectionOrBuilder(); + + /** + * + * + *
+   * 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(); + + /** + * + * + *
+   * Optional. If set, validates request by executing a dry-run which would not
+   * alter the resource in any way.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Optional. If set as true, will create the resource if it is not found.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/proto/google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/proto/google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto new file mode 100644 index 000000000000..73f19ff7b53b --- /dev/null +++ b/java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/src/main/proto/google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto @@ -0,0 +1,512 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.beyondcorp.appconnections.v1; + +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 csharp_namespace = "Google.Cloud.BeyondCorp.AppConnections.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/beyondcorp/appconnections/v1;appconnections"; +option java_multiple_files = true; +option java_outer_classname = "AppConnectionsServiceProto"; +option java_package = "com.google.cloud.beyondcorp.appconnections.v1"; +option php_namespace = "Google\\Cloud\\BeyondCorp\\AppConnections\\V1"; +option ruby_package = "Google::Cloud::BeyondCorp::AppConnections::V1"; +option (google.api.resource_definition) = { + type: "beyondcorp.googleapis.com/AppConnector" + pattern: "projects/{project}/locations/{location}/appConnectors/{app_connector}" +}; +option (google.api.resource_definition) = { + type: "beyondcorp.googleapis.com/AppGateway" + pattern: "projects/{project}/locations/{location}/appGateways/{app_gateway}" +}; + +// ## API Overview +// +// The `beyondcorp.googleapis.com` service implements the Google Cloud +// BeyondCorp API. +// +// ## Data Model +// +// The AppConnectionsService exposes the following resources: +// +// * AppConnections, named as follows: +// `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`. +// +// The AppConnectionsService service provides methods to manage +// (create/read/update/delete) BeyondCorp AppConnections. +service AppConnectionsService { + option (google.api.default_host) = "beyondcorp.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists AppConnections in a given project and location. + rpc ListAppConnections(ListAppConnectionsRequest) + returns (ListAppConnectionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/appConnections" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single AppConnection. + rpc GetAppConnection(GetAppConnectionRequest) returns (AppConnection) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/appConnections/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new AppConnection in a given project and location. + rpc CreateAppConnection(CreateAppConnectionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/appConnections" + body: "app_connection" + }; + option (google.api.method_signature) = + "parent,app_connection,app_connection_id"; + option (google.longrunning.operation_info) = { + response_type: "AppConnection" + metadata_type: "AppConnectionOperationMetadata" + }; + } + + // Updates the parameters of a single AppConnection. + rpc UpdateAppConnection(UpdateAppConnectionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{app_connection.name=projects/*/locations/*/appConnections/*}" + body: "app_connection" + }; + option (google.api.method_signature) = "app_connection,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "AppConnection" + metadata_type: "AppConnectionOperationMetadata" + }; + } + + // Deletes a single AppConnection. + rpc DeleteAppConnection(DeleteAppConnectionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/appConnections/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "AppConnectionOperationMetadata" + }; + } + + // Resolves AppConnections details for a given AppConnector. + // An internal method called by a connector to find AppConnections to connect + // to. + rpc ResolveAppConnections(ResolveAppConnectionsRequest) + returns (ResolveAppConnectionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/appConnections:resolve" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request message for BeyondCorp.ListAppConnections. +message ListAppConnectionsRequest { + // Required. The resource name of the AppConnection location using the form: + // `projects/{project_id}/locations/{location_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "beyondcorp.googleapis.com/AppConnection" + } + ]; + + // Optional. The maximum number of items to return. + // If not specified, a default value of 50 will be used by the service. + // Regardless of the page_size value, the response may include a partial list + // and a caller should only rely on response's + // [next_page_token][BeyondCorp.ListAppConnectionsResponse.next_page_token] to + // determine if there are more instances left to be queried. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous + // ListAppConnectionsRequest, if any. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A filter specifying constraints of a list operation. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the ordering of results. See + // [Sorting + // order](https://cloud.google.com/apis/design/design_patterns#sorting_order) + // for more information. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for BeyondCorp.ListAppConnections. +message ListAppConnectionsResponse { + // A list of BeyondCorp AppConnections in the project. + repeated AppConnection app_connections = 1; + + // A token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // A list of locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for BeyondCorp.GetAppConnection. +message GetAppConnectionRequest { + // Required. BeyondCorp AppConnection name using the form: + // `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "beyondcorp.googleapis.com/AppConnection" + } + ]; +} + +// Request message for BeyondCorp.CreateAppConnection. +message CreateAppConnectionRequest { + // Required. The resource project name of the AppConnection location using the + // form: `projects/{project_id}/locations/{location_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "beyondcorp.googleapis.com/AppConnection" + } + ]; + + // Optional. User-settable AppConnection resource ID. + // * Must start with a letter. + // * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + // * Must end with a number or a letter. + string app_connection_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. A BeyondCorp AppConnection resource. + AppConnection app_connection = 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]; + + // Optional. If set, validates request by executing a dry-run which would not + // alter the resource in any way. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for BeyondCorp.UpdateAppConnection. +message UpdateAppConnectionRequest { + // Required. Mask of fields to update. At least one path must be supplied in + // this field. The elements of the repeated paths field may only include these + // fields from [BeyondCorp.AppConnection]: + // * `labels` + // * `display_name` + // * `application_endpoint` + // * `connectors` + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. AppConnection message with updated fields. Only supported fields + // specified in update_mask are updated. + AppConnection app_connection = 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]; + + // Optional. If set, validates request by executing a dry-run which would not + // alter the resource in any way. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set as true, will create the resource if it is not found. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for BeyondCorp.DeleteAppConnection. +message DeleteAppConnectionRequest { + // Required. BeyondCorp Connector name using the form: + // `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "beyondcorp.googleapis.com/AppConnection" + } + ]; + + // 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]; + + // Optional. If set, validates request by executing a dry-run which would not + // alter the resource in any way. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for BeyondCorp.ResolveAppConnections. +message ResolveAppConnectionsRequest { + // Required. The resource name of the AppConnection location using the form: + // `projects/{project_id}/locations/{location_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "beyondcorp.googleapis.com/AppConnection" + } + ]; + + // Required. BeyondCorp Connector name of the connector associated with those + // AppConnections using the form: + // `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}` + string app_connector_id = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "beyondcorp.googleapis.com/AppConnector" + } + ]; + + // Optional. The maximum number of items to return. + // If not specified, a default value of 50 will be used by the service. + // Regardless of the page_size value, the response may include a partial list + // and a caller should only rely on response's + // [next_page_token][BeyondCorp.ResolveAppConnectionsResponse.next_page_token] + // to determine if there are more instances left to be queried. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous + // ResolveAppConnectionsResponse, if any. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for BeyondCorp.ResolveAppConnections. +message ResolveAppConnectionsResponse { + // Details of the AppConnection. + message AppConnectionDetails { + // A BeyondCorp AppConnection in the project. + AppConnection app_connection = 1; + + // If type=GCP_REGIONAL_MIG, contains most recent VM instances, like + // `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}`. + repeated string recent_mig_vms = 2; + } + + // A list of BeyondCorp AppConnections with details in the project. + repeated AppConnectionDetails app_connection_details = 1; + + // A token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // A list of locations that could not be reached. + repeated string unreachable = 3; +} + +// A BeyondCorp AppConnection resource represents a BeyondCorp protected +// AppConnection to a remote application. It creates all the necessary GCP +// components needed for creating a BeyondCorp protected AppConnection. Multiple +// connectors can be authorised for a single AppConnection. +message AppConnection { + option (google.api.resource) = { + type: "beyondcorp.googleapis.com/AppConnection" + pattern: "projects/{project}/locations/{location}/appConnections/{app_connection}" + }; + + // ApplicationEndpoint represents a remote application endpoint. + message ApplicationEndpoint { + // Required. Hostname or IP address of the remote application endpoint. + string host = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Port of the remote application endpoint. + int32 port = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Gateway represents a user facing component that serves as an entrance to + // enable connectivity. + message Gateway { + // Enum listing possible gateway hosting options. + enum Type { + // Default value. This value is unused. + TYPE_UNSPECIFIED = 0; + + // Gateway hosted in a GCP regional managed instance group. + GCP_REGIONAL_MIG = 1; + } + + // Required. The type of hosting used by the gateway. + Type type = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Server-defined URI for this resource. + string uri = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Ingress port reserved on the gateways for this + // AppConnection, if not specified or zero, the default port is 19443. + int32 ingress_port = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. AppGateway name in following format: + // `projects/{project_id}/locations/{location_id}/appgateways/{gateway_id}` + string app_gateway = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "beyondcorp.googleapis.com/AppGateway" + } + ]; + } + + // Enum containing list of all possible network connectivity options + // supported by BeyondCorp AppConnection. + enum Type { + // Default value. This value is unused. + TYPE_UNSPECIFIED = 0; + + // TCP Proxy based BeyondCorp AppConnection. API will default to this if + // unset. + TCP_PROXY = 1; + } + + // Represents the different states of a AppConnection. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // AppConnection is being created. + CREATING = 1; + + // AppConnection has been created. + CREATED = 2; + + // AppConnection's configuration is being updated. + UPDATING = 3; + + // AppConnection is being deleted. + DELETING = 4; + + // AppConnection is down and may be restored in the future. + // This happens when CCFE sends ProjectState = OFF. + DOWN = 5; + } + + // Required. Unique resource name of the AppConnection. + // The name is ignored when creating a AppConnection. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Timestamp when the resource was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the resource was last modified. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Resource labels to represent user provided metadata. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An arbitrary user-provided name for the AppConnection. Cannot + // exceed 64 characters. + string display_name = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. A unique identifier for the instance generated by the + // system. + string uid = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The type of network connectivity used by the AppConnection. + Type type = 7 [(google.api.field_behavior) = REQUIRED]; + + // Required. Address of the remote application endpoint for the BeyondCorp + // AppConnection. + ApplicationEndpoint application_endpoint = 8 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. List of [google.cloud.beyondcorp.v1main.Connector.name] that are + // authorised to be associated with this AppConnection. + repeated string connectors = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The current state of the AppConnection. + State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Gateway used by the AppConnection. + Gateway gateway = 11 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the metadata of the long-running operation. +message AppConnectionOperationMetadata { + // 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/java-beyondcorp-appconnections/renovate.json b/java-beyondcorp-appconnections/renovate.json new file mode 100644 index 000000000000..0bc807d9d456 --- /dev/null +++ b/java-beyondcorp-appconnections/renovate.json @@ -0,0 +1,74 @@ +{ + "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-beyondcorp-appconnections", + "^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", + "^com.google.cloud:google-cloud-conformance-tests" + ], + "semanticCommitType": "test", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-" + ], + "ignoreUnstable": false + }, + { + "packagePatterns": [ + "^com.fasterxml.jackson.core" + ], + "groupName": "jackson dependencies" + } + ], + "semanticCommits": true, + "dependencyDashboard": true +} diff --git a/java-beyondcorp-appconnections/samples/install-without-bom/pom.xml b/java-beyondcorp-appconnections/samples/install-without-bom/pom.xml new file mode 100644 index 000000000000..849987a1d6f0 --- /dev/null +++ b/java-beyondcorp-appconnections/samples/install-without-bom/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + com.google.cloud + -install-without-bom + jar + Google BeyondCorp AppConnections Install Without Bom + https://github.com/googleapis/java-beyondcorp-appconnections + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + google-cloud-beyondcorp-appconnections + 0.0.0 + + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.1.3 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/java-beyondcorp-appconnections/samples/pom.xml b/java-beyondcorp-appconnections/samples/pom.xml new file mode 100644 index 000000000000..bd3a2070d4ab --- /dev/null +++ b/java-beyondcorp-appconnections/samples/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud--samples + 0.0.1-SNAPSHOT + pom + Google BeyondCorp AppConnections Samples Parent + https://github.com/googleapis/java-beyondcorp-appconnections + + Java idiomatic client for Google Cloud Platform services. + + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 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.13 + + true + + + + + diff --git a/java-beyondcorp-appconnections/samples/snapshot/pom.xml b/java-beyondcorp-appconnections/samples/snapshot/pom.xml new file mode 100644 index 000000000000..11d7f54cf4b7 --- /dev/null +++ b/java-beyondcorp-appconnections/samples/snapshot/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + com.google.cloud + -snapshot + jar + Google BeyondCorp AppConnections Snapshot Samples + https://github.com/googleapis/java-beyondcorp-appconnections + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-beyondcorp-appconnections + 0.0.0 + + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.1.3 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/java-beyondcorp-appconnections/samples/snippets/pom.xml b/java-beyondcorp-appconnections/samples/snippets/pom.xml new file mode 100644 index 000000000000..8ae5abe8feb7 --- /dev/null +++ b/java-beyondcorp-appconnections/samples/snippets/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + com.google.cloud + -snippets + jar + Google BeyondCorp AppConnections Snippets + https://github.com/googleapis/java-beyondcorp-appconnections + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-beyondcorp-appconnections + 0.0.0 + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.1.3 + test + + + diff --git a/java-beyondcorp-appconnections/versions.txt b/java-beyondcorp-appconnections/versions.txt new file mode 100644 index 000000000000..5cfe7a3b9db0 --- /dev/null +++ b/java-beyondcorp-appconnections/versions.txt @@ -0,0 +1,6 @@ +# Format: +# module:released-version:current-version + +google-cloud-beyondcorp-appconnections:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-beyondcorp-appconnections-v1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-beyondcorp-appconnections-v1:0.0.0:0.0.1-SNAPSHOT