diff --git a/java-beyondcorp-clientgateways/.github/.OwlBot.lock.yaml b/java-beyondcorp-clientgateways/.github/.OwlBot.lock.yaml new file mode 100644 index 000000000000..835375deb3de --- /dev/null +++ b/java-beyondcorp-clientgateways/.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:b47e411068ffc6e6990cb4e0802fbac9a4488dec7f5f424553518ba21abea208 + image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest \ No newline at end of file diff --git a/java-beyondcorp-clientgateways/.github/.OwlBot.yaml b/java-beyondcorp-clientgateways/.github/.OwlBot.yaml new file mode 100644 index 000000000000..0bc5c595772b --- /dev/null +++ b/java-beyondcorp-clientgateways/.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/clientgateways/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/$1/proto-google-cloud-beyondcorp-clientgateways-$1/src" +- source: "/google/cloud/beyondcorp/clientgateways/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/$1/grpc-google-cloud-beyondcorp-clientgateways-$1/src" +- source: "/google/cloud/beyondcorp/clientgateways/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/$1/google-cloud-beyondcorp-clientgateways/src" diff --git a/java-beyondcorp-clientgateways/.github/CODEOWNERS b/java-beyondcorp-clientgateways/.github/CODEOWNERS new file mode 100644 index 000000000000..30fdb7b9c8f7 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.github/ISSUE_TEMPLATE/bug_report.md b/java-beyondcorp-clientgateways/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000000..1c6fc7e1c318 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/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-clientgateways/.github/ISSUE_TEMPLATE/feature_request.md b/java-beyondcorp-clientgateways/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000000..754e30c68a00 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.github/ISSUE_TEMPLATE/support_request.md b/java-beyondcorp-clientgateways/.github/ISSUE_TEMPLATE/support_request.md new file mode 100644 index 000000000000..995869032125 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.github/PULL_REQUEST_TEMPLATE.md b/java-beyondcorp-clientgateways/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000000..cb5f04e88622 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/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-clientgateways/.github/auto-label.yaml b/java-beyondcorp-clientgateways/.github/auto-label.yaml new file mode 100644 index 000000000000..4caef688b745 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.github/blunderbuss.yml b/java-beyondcorp-clientgateways/.github/blunderbuss.yml new file mode 100644 index 000000000000..2176b0543214 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.github/generated-files-bot.yml b/java-beyondcorp-clientgateways/.github/generated-files-bot.yml new file mode 100644 index 000000000000..c644a24e1129 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.github/release-please.yml b/java-beyondcorp-clientgateways/.github/release-please.yml new file mode 100644 index 000000000000..8ca7f9cabc29 --- /dev/null +++ b/java-beyondcorp-clientgateways/.github/release-please.yml @@ -0,0 +1,3 @@ +bumpMinorPreMajor: true +handleGHRelease: true +releaseType: java-yoshi diff --git a/java-beyondcorp-clientgateways/.github/release-trigger.yml b/java-beyondcorp-clientgateways/.github/release-trigger.yml new file mode 100644 index 000000000000..d4ca94189e16 --- /dev/null +++ b/java-beyondcorp-clientgateways/.github/release-trigger.yml @@ -0,0 +1 @@ +enabled: true diff --git a/java-beyondcorp-clientgateways/.github/snippet-bot.yml b/java-beyondcorp-clientgateways/.github/snippet-bot.yml new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/java-beyondcorp-clientgateways/.github/sync-repo-settings.yaml b/java-beyondcorp-clientgateways/.github/sync-repo-settings.yaml new file mode 100644 index 000000000000..72acb9d8fa25 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.github/trusted-contribution.yml b/java-beyondcorp-clientgateways/.github/trusted-contribution.yml new file mode 100644 index 000000000000..a0ba1f7d9078 --- /dev/null +++ b/java-beyondcorp-clientgateways/.github/trusted-contribution.yml @@ -0,0 +1,3 @@ +trustedContributors: +- renovate-bot +- gcf-owl-bot[bot] diff --git a/java-beyondcorp-clientgateways/.github/workflows/approve-readme.yaml b/java-beyondcorp-clientgateways/.github/workflows/approve-readme.yaml new file mode 100644 index 000000000000..f5fc7d5169eb --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.github/workflows/auto-release.yaml b/java-beyondcorp-clientgateways/.github/workflows/auto-release.yaml new file mode 100644 index 000000000000..7a106d007edf --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.github/workflows/ci.yaml b/java-beyondcorp-clientgateways/.github/workflows/ci.yaml new file mode 100644 index 000000000000..e3bb26e37719 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.github/workflows/samples.yaml b/java-beyondcorp-clientgateways/.github/workflows/samples.yaml new file mode 100644 index 000000000000..912ed8b2b027 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.gitignore b/java-beyondcorp-clientgateways/.gitignore new file mode 100644 index 000000000000..069d08fc73e8 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/build.bat b/java-beyondcorp-clientgateways/.kokoro/build.bat new file mode 100644 index 000000000000..067cf4a4c489 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/build.sh b/java-beyondcorp-clientgateways/.kokoro/build.sh new file mode 100755 index 000000000000..5ac3d66c005a --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways +fi + +echo "exiting with ${RETURN_CODE}" +exit ${RETURN_CODE} diff --git a/java-beyondcorp-clientgateways/.kokoro/coerce_logs.sh b/java-beyondcorp-clientgateways/.kokoro/coerce_logs.sh new file mode 100755 index 000000000000..46edbf7f2fcd --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/common.cfg b/java-beyondcorp-clientgateways/.kokoro/common.cfg new file mode 100644 index 000000000000..ef4d96bb0f95 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/trampoline.sh" + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-clientgateways/.kokoro/build.sh" +} diff --git a/java-beyondcorp-clientgateways/.kokoro/common.sh b/java-beyondcorp-clientgateways/.kokoro/common.sh new file mode 100644 index 000000000000..f8f957af1112 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/continuous/common.cfg b/java-beyondcorp-clientgateways/.kokoro/continuous/common.cfg new file mode 100644 index 000000000000..2ee62427cee0 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-clientgateways/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/java-beyondcorp-clientgateways/.kokoro/continuous/java8.cfg b/java-beyondcorp-clientgateways/.kokoro/continuous/java8.cfg new file mode 100644 index 000000000000..495cc7bacd63 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/dependencies.sh b/java-beyondcorp-clientgateways/.kokoro/dependencies.sh new file mode 100755 index 000000000000..d7476cfe9727 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/nightly/common.cfg b/java-beyondcorp-clientgateways/.kokoro/nightly/common.cfg new file mode 100644 index 000000000000..2ee62427cee0 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-clientgateways/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/java-beyondcorp-clientgateways/.kokoro/nightly/integration.cfg b/java-beyondcorp-clientgateways/.kokoro/nightly/integration.cfg new file mode 100644 index 000000000000..a2907a257b2b --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/nightly/java11-integration.cfg b/java-beyondcorp-clientgateways/.kokoro/nightly/java11-integration.cfg new file mode 100644 index 000000000000..58049cc38f11 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/nightly/java11.cfg b/java-beyondcorp-clientgateways/.kokoro/nightly/java11.cfg new file mode 100644 index 000000000000..709f2b4c73db --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/nightly/java7.cfg b/java-beyondcorp-clientgateways/.kokoro/nightly/java7.cfg new file mode 100644 index 000000000000..cb24f44eea3b --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/nightly/java8-osx.cfg b/java-beyondcorp-clientgateways/.kokoro/nightly/java8-osx.cfg new file mode 100644 index 000000000000..39c7167afb11 --- /dev/null +++ b/java-beyondcorp-clientgateways/.kokoro/nightly/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-beyondcorp-clientgateways/.kokoro/build.sh" diff --git a/java-beyondcorp-clientgateways/.kokoro/nightly/java8-win.cfg b/java-beyondcorp-clientgateways/.kokoro/nightly/java8-win.cfg new file mode 100644 index 000000000000..950bad29054d --- /dev/null +++ b/java-beyondcorp-clientgateways/.kokoro/nightly/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-beyondcorp-clientgateways/.kokoro/build.bat" diff --git a/java-beyondcorp-clientgateways/.kokoro/nightly/java8.cfg b/java-beyondcorp-clientgateways/.kokoro/nightly/java8.cfg new file mode 100644 index 000000000000..495cc7bacd63 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/nightly/samples.cfg b/java-beyondcorp-clientgateways/.kokoro/nightly/samples.cfg new file mode 100644 index 000000000000..9761fd8648cb --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/populate-secrets.sh b/java-beyondcorp-clientgateways/.kokoro/populate-secrets.sh new file mode 100755 index 000000000000..f52514257ef0 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/presubmit/clirr.cfg b/java-beyondcorp-clientgateways/.kokoro/presubmit/clirr.cfg new file mode 100644 index 000000000000..ec572442e2e7 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/presubmit/common.cfg b/java-beyondcorp-clientgateways/.kokoro/presubmit/common.cfg new file mode 100644 index 000000000000..479e34e5ab52 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/presubmit/dependencies.cfg b/java-beyondcorp-clientgateways/.kokoro/presubmit/dependencies.cfg new file mode 100644 index 000000000000..84621e8887bc --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/dependencies.sh" +} diff --git a/java-beyondcorp-clientgateways/.kokoro/presubmit/graalvm-native-17.cfg b/java-beyondcorp-clientgateways/.kokoro/presubmit/graalvm-native-17.cfg new file mode 100644 index 000000000000..a3f7fb9d4943 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/presubmit/graalvm-native.cfg b/java-beyondcorp-clientgateways/.kokoro/presubmit/graalvm-native.cfg new file mode 100644 index 000000000000..4c7225ec924e --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/presubmit/integration.cfg b/java-beyondcorp-clientgateways/.kokoro/presubmit/integration.cfg new file mode 100644 index 000000000000..dded67a9d54a --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/presubmit/java11.cfg b/java-beyondcorp-clientgateways/.kokoro/presubmit/java11.cfg new file mode 100644 index 000000000000..709f2b4c73db --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/presubmit/java7.cfg b/java-beyondcorp-clientgateways/.kokoro/presubmit/java7.cfg new file mode 100644 index 000000000000..cb24f44eea3b --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/presubmit/java8-osx.cfg b/java-beyondcorp-clientgateways/.kokoro/presubmit/java8-osx.cfg new file mode 100644 index 000000000000..39c7167afb11 --- /dev/null +++ b/java-beyondcorp-clientgateways/.kokoro/presubmit/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-beyondcorp-clientgateways/.kokoro/build.sh" diff --git a/java-beyondcorp-clientgateways/.kokoro/presubmit/java8-win.cfg b/java-beyondcorp-clientgateways/.kokoro/presubmit/java8-win.cfg new file mode 100644 index 000000000000..950bad29054d --- /dev/null +++ b/java-beyondcorp-clientgateways/.kokoro/presubmit/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-beyondcorp-clientgateways/.kokoro/build.bat" diff --git a/java-beyondcorp-clientgateways/.kokoro/presubmit/java8.cfg b/java-beyondcorp-clientgateways/.kokoro/presubmit/java8.cfg new file mode 100644 index 000000000000..495cc7bacd63 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/presubmit/linkage-monitor.cfg b/java-beyondcorp-clientgateways/.kokoro/presubmit/linkage-monitor.cfg new file mode 100644 index 000000000000..5fe39d8ca0c2 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/linkage-monitor.sh" +} \ No newline at end of file diff --git a/java-beyondcorp-clientgateways/.kokoro/presubmit/lint.cfg b/java-beyondcorp-clientgateways/.kokoro/presubmit/lint.cfg new file mode 100644 index 000000000000..6d323c8ae768 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/presubmit/samples.cfg b/java-beyondcorp-clientgateways/.kokoro/presubmit/samples.cfg new file mode 100644 index 000000000000..01e0960047b8 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/readme.sh b/java-beyondcorp-clientgateways/.kokoro/readme.sh new file mode 100755 index 000000000000..a72bc41d3628 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways + +# 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-clientgateways \ + --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-clientgateways/.kokoro/release/bump_snapshot.cfg b/java-beyondcorp-clientgateways/.kokoro/release/bump_snapshot.cfg new file mode 100644 index 000000000000..e093a133d6f3 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.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-clientgateways/.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-clientgateways/.kokoro/release/common.cfg b/java-beyondcorp-clientgateways/.kokoro/release/common.cfg new file mode 100644 index 000000000000..cc69ecaf91b3 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.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-clientgateways/.kokoro/release/common.sh b/java-beyondcorp-clientgateways/.kokoro/release/common.sh new file mode 100755 index 000000000000..7f78ee414faf --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/release/drop.cfg b/java-beyondcorp-clientgateways/.kokoro/release/drop.cfg new file mode 100644 index 000000000000..7477a6e9eb15 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/release/drop.sh" +} diff --git a/java-beyondcorp-clientgateways/.kokoro/release/drop.sh b/java-beyondcorp-clientgateways/.kokoro/release/drop.sh new file mode 100755 index 000000000000..742ec1a88600 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/release/promote.cfg b/java-beyondcorp-clientgateways/.kokoro/release/promote.cfg new file mode 100644 index 000000000000..efd2ef7efed6 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/release/promote.sh" +} diff --git a/java-beyondcorp-clientgateways/.kokoro/release/promote.sh b/java-beyondcorp-clientgateways/.kokoro/release/promote.sh new file mode 100755 index 000000000000..3cac3d8a97d7 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/release/publish_javadoc.cfg b/java-beyondcorp-clientgateways/.kokoro/release/publish_javadoc.cfg new file mode 100644 index 000000000000..5743778362fe --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/release/publish_javadoc.sh" +} + + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} diff --git a/java-beyondcorp-clientgateways/.kokoro/release/publish_javadoc.sh b/java-beyondcorp-clientgateways/.kokoro/release/publish_javadoc.sh new file mode 100755 index 000000000000..250cf030ea0b --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways +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-clientgateways/.kokoro/release/publish_javadoc11.cfg b/java-beyondcorp-clientgateways/.kokoro/release/publish_javadoc11.cfg new file mode 100644 index 000000000000..91f81bb33244 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.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-clientgateways/.kokoro/release/publish_javadoc11.sh b/java-beyondcorp-clientgateways/.kokoro/release/publish_javadoc11.sh new file mode 100755 index 000000000000..fdd49343b0db --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways +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-clientgateways/.kokoro/release/snapshot.cfg b/java-beyondcorp-clientgateways/.kokoro/release/snapshot.cfg new file mode 100644 index 000000000000..5e7f4d20c20e --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/release/snapshot.sh" +} \ No newline at end of file diff --git a/java-beyondcorp-clientgateways/.kokoro/release/snapshot.sh b/java-beyondcorp-clientgateways/.kokoro/release/snapshot.sh new file mode 100755 index 000000000000..1f55b77024d8 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/release/stage.cfg b/java-beyondcorp-clientgateways/.kokoro/release/stage.cfg new file mode 100644 index 000000000000..a1bee87cc841 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/release/stage.sh" +} + +# Need to save the properties file +action { + define_artifacts { + regex: "github/java-beyondcorp-clientgateways/target/nexus-staging/staging/*.properties" + strip_prefix: "github/java-beyondcorp-clientgateways" + } +} + +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-clientgateways/.kokoro/release/stage.sh b/java-beyondcorp-clientgateways/.kokoro/release/stage.sh new file mode 100755 index 000000000000..1dba8de10857 --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.kokoro/trampoline.sh b/java-beyondcorp-clientgateways/.kokoro/trampoline.sh new file mode 100644 index 000000000000..8b69b793c9ec --- /dev/null +++ b/java-beyondcorp-clientgateways/.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-clientgateways/.repo-metadata.json b/java-beyondcorp-clientgateways/.repo-metadata.json new file mode 100644 index 000000000000..de41daa4251c --- /dev/null +++ b/java-beyondcorp-clientgateways/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "beyondcorp-clientgateways", + "name_pretty": "BeyondCorp ClientGateways", + "product_documentation": "https://cloud.google.com/beyondcorp-enterprise/", + "api_description": "A zero trust solution that enables secure access to applications and resources, and offers integrated threat and data protection.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-beyondcorp-clientgateways/latest/overview", + "release_level": "preview", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-beyondcorp-clientgateways", + "repo_short": "java-beyondcorp-clientgateways", + "distribution_name": "com.google.cloud:google-cloud-beyondcorp-clientgateways", + "api_id": "beyondcorp-clientgateways.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/java-beyondcorp-clientgateways/CODE_OF_CONDUCT.md b/java-beyondcorp-clientgateways/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/java-beyondcorp-clientgateways/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-clientgateways/CONTRIBUTING.md b/java-beyondcorp-clientgateways/CONTRIBUTING.md new file mode 100644 index 000000000000..b65dd279c946 --- /dev/null +++ b/java-beyondcorp-clientgateways/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-clientgateways/LICENSE b/java-beyondcorp-clientgateways/LICENSE new file mode 100644 index 000000000000..261eeb9e9f8b --- /dev/null +++ b/java-beyondcorp-clientgateways/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-clientgateways/README.md b/java-beyondcorp-clientgateways/README.md new file mode 100644 index 000000000000..74182eb1ae2e --- /dev/null +++ b/java-beyondcorp-clientgateways/README.md @@ -0,0 +1,201 @@ +# Google BeyondCorp ClientGateways Client for Java + +Java idiomatic client for [BeyondCorp ClientGateways][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-clientgateways + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-beyondcorp-clientgateways:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-beyondcorp-clientgateways" % "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 ClientGateways APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the BeyondCorp ClientGateways API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the BeyondCorp ClientGateways [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google BeyondCorp ClientGateways. +[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-clientgateways` library. See the [Quickstart](#quickstart) section +to add `google-cloud-beyondcorp-clientgateways` as a dependency in your code. + +## About BeyondCorp ClientGateways + + +[BeyondCorp ClientGateways][product-docs] A zero trust solution that enables secure access to applications and resources, and offers integrated threat and data protection. + +See the [BeyondCorp ClientGateways client library docs][javadocs] to learn how to +use this BeyondCorp ClientGateways Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +BeyondCorp ClientGateways 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-clientgateways/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-clientgateways/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-clientgateways/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-clientgateways/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-clientgateways/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-clientgateways/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-clientgateways/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-clientgateways/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-clientgateways/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-clientgateways/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-clientgateways/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-clientgateways.svg +[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-beyondcorp-clientgateways&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-clientgateways/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-beyondcorp-clientgateways/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-beyondcorp-clientgateways/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-clientgateways.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-clientgateways/SECURITY.md b/java-beyondcorp-clientgateways/SECURITY.md new file mode 100644 index 000000000000..8b58ae9c01ae --- /dev/null +++ b/java-beyondcorp-clientgateways/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-clientgateways/google-cloud-beyondcorp-clientgateways-bom/pom.xml b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways-bom/pom.xml new file mode 100644 index 000000000000..5d318fcb012a --- /dev/null +++ b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways-bom/pom.xml @@ -0,0 +1,94 @@ + + + 4.0.0 + com.google.cloud + google-cloud-beyondcorp-clientgateways-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-shared-config + 1.2.7 + + + Google BeyondCorp ClientGateways BOM + https://github.com/googleapis/java-beyondcorp-clientgateways + + BOM for BeyondCorp ClientGateways + + + + 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-clientgateways.git + scm:git:git@github.com:googleapis/java-beyondcorp-clientgateways.git + https://github.com/googleapis/java-beyondcorp-clientgateways + + + + true + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + + com.google.cloud + google-cloud-beyondcorp-clientgateways + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-beyondcorp-clientgateways-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-beyondcorp-clientgateways-v1 + 0.0.1-SNAPSHOT + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + diff --git a/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/pom.xml b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/pom.xml new file mode 100644 index 000000000000..20cf49b399c8 --- /dev/null +++ b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/pom.xml @@ -0,0 +1,139 @@ + + + 4.0.0 + com.google.cloud + google-cloud-beyondcorp-clientgateways + 0.0.1-SNAPSHOT + jar + Google BeyondCorp ClientGateways + https://github.com/googleapis/java-beyondcorp-clientgateways + BeyondCorp ClientGateways A zero trust solution that enables secure access to applications and resources, and offers integrated threat and data protection. + + com.google.cloud + google-cloud-beyondcorp-clientgateways-parent + 0.0.1-SNAPSHOT + + + google-cloud-beyondcorp-clientgateways + + + + 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-clientgateways-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-clientgateways-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-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewaysServiceClient.java b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewaysServiceClient.java new file mode 100644 index 000000000000..b24c595c44c2 --- /dev/null +++ b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewaysServiceClient.java @@ -0,0 +1,1293 @@ +/* + * 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.clientgateways.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.clientgateways.v1.stub.ClientGatewaysServiceStub; +import com.google.cloud.beyondcorp.clientgateways.v1.stub.ClientGatewaysServiceStubSettings; +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 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 ClientGatewaysService exposes the following resources: + * + *

    + *
  • Client Gateways, named as follows: + * `projects/{project_id}/locations/{location_id}/clientGateways/{client_gateway_id}`. + *
+ * + *

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 (ClientGatewaysServiceClient clientGatewaysServiceClient =
+ *     ClientGatewaysServiceClient.create()) {
+ *   ClientGatewayName name = ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]");
+ *   ClientGateway response = clientGatewaysServiceClient.getClientGateway(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the ClientGatewaysServiceClient 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 ClientGatewaysServiceSettings + * 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.
+ * ClientGatewaysServiceSettings clientGatewaysServiceSettings =
+ *     ClientGatewaysServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ClientGatewaysServiceClient clientGatewaysServiceClient =
+ *     ClientGatewaysServiceClient.create(clientGatewaysServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class ClientGatewaysServiceClient implements BackgroundResource { + private final ClientGatewaysServiceSettings settings; + private final ClientGatewaysServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of ClientGatewaysServiceClient with default settings. */ + public static final ClientGatewaysServiceClient create() throws IOException { + return create(ClientGatewaysServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ClientGatewaysServiceClient, 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 ClientGatewaysServiceClient create(ClientGatewaysServiceSettings settings) + throws IOException { + return new ClientGatewaysServiceClient(settings); + } + + /** + * Constructs an instance of ClientGatewaysServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(ClientGatewaysServiceSettings). + */ + public static final ClientGatewaysServiceClient create(ClientGatewaysServiceStub stub) { + return new ClientGatewaysServiceClient(stub); + } + + /** + * Constructs an instance of ClientGatewaysServiceClient, 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 ClientGatewaysServiceClient(ClientGatewaysServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ClientGatewaysServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + protected ClientGatewaysServiceClient(ClientGatewaysServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final ClientGatewaysServiceSettings getSettings() { + return settings; + } + + public ClientGatewaysServiceStub 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 ClientGateways 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 (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (ClientGateway element :
+   *       clientGatewaysServiceClient.listClientGateways(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListClientGatewaysRequest. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListClientGatewaysPagedResponse listClientGateways(LocationName parent) { + ListClientGatewaysRequest request = + ListClientGatewaysRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listClientGateways(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ClientGateways 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 (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (ClientGateway element :
+   *       clientGatewaysServiceClient.listClientGateways(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListClientGatewaysRequest. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListClientGatewaysPagedResponse listClientGateways(String parent) { + ListClientGatewaysRequest request = + ListClientGatewaysRequest.newBuilder().setParent(parent).build(); + return listClientGateways(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ClientGateways 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 (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   ListClientGatewaysRequest request =
+   *       ListClientGatewaysRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (ClientGateway element :
+   *       clientGatewaysServiceClient.listClientGateways(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 ListClientGatewaysPagedResponse listClientGateways( + ListClientGatewaysRequest request) { + return listClientGatewaysPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ClientGateways 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 (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   ListClientGatewaysRequest request =
+   *       ListClientGatewaysRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       clientGatewaysServiceClient.listClientGatewaysPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (ClientGateway element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listClientGatewaysPagedCallable() { + return stub.listClientGatewaysPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ClientGateways 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 (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   ListClientGatewaysRequest request =
+   *       ListClientGatewaysRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListClientGatewaysResponse response =
+   *         clientGatewaysServiceClient.listClientGatewaysCallable().call(request);
+   *     for (ClientGateway element : response.getClientGatewaysList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listClientGatewaysCallable() { + return stub.listClientGatewaysCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single ClientGateway. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   ClientGatewayName name = ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]");
+   *   ClientGateway response = clientGatewaysServiceClient.getClientGateway(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ClientGateway getClientGateway(ClientGatewayName name) { + GetClientGatewayRequest request = + GetClientGatewayRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getClientGateway(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single ClientGateway. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   String name = ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]").toString();
+   *   ClientGateway response = clientGatewaysServiceClient.getClientGateway(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ClientGateway getClientGateway(String name) { + GetClientGatewayRequest request = GetClientGatewayRequest.newBuilder().setName(name).build(); + return getClientGateway(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single ClientGateway. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   GetClientGatewayRequest request =
+   *       GetClientGatewayRequest.newBuilder()
+   *           .setName(
+   *               ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]").toString())
+   *           .build();
+   *   ClientGateway response = clientGatewaysServiceClient.getClientGateway(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 ClientGateway getClientGateway(GetClientGatewayRequest request) { + return getClientGatewayCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single ClientGateway. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   GetClientGatewayRequest request =
+   *       GetClientGatewayRequest.newBuilder()
+   *           .setName(
+   *               ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       clientGatewaysServiceClient.getClientGatewayCallable().futureCall(request);
+   *   // Do something.
+   *   ClientGateway response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getClientGatewayCallable() { + return stub.getClientGatewayCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new ClientGateway 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 (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ClientGateway clientGateway = ClientGateway.newBuilder().build();
+   *   String clientGatewayId = "clientGatewayId-1199632652";
+   *   ClientGateway response =
+   *       clientGatewaysServiceClient
+   *           .createClientGatewayAsync(parent, clientGateway, clientGatewayId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + * @param clientGateway Required. The resource being created. + * @param clientGatewayId Optional. User-settable client gateway 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 + createClientGatewayAsync( + LocationName parent, ClientGateway clientGateway, String clientGatewayId) { + CreateClientGatewayRequest request = + CreateClientGatewayRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setClientGateway(clientGateway) + .setClientGatewayId(clientGatewayId) + .build(); + return createClientGatewayAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new ClientGateway 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 (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   ClientGateway clientGateway = ClientGateway.newBuilder().build();
+   *   String clientGatewayId = "clientGatewayId-1199632652";
+   *   ClientGateway response =
+   *       clientGatewaysServiceClient
+   *           .createClientGatewayAsync(parent, clientGateway, clientGatewayId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + * @param clientGateway Required. The resource being created. + * @param clientGatewayId Optional. User-settable client gateway 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 + createClientGatewayAsync(String parent, ClientGateway clientGateway, String clientGatewayId) { + CreateClientGatewayRequest request = + CreateClientGatewayRequest.newBuilder() + .setParent(parent) + .setClientGateway(clientGateway) + .setClientGatewayId(clientGatewayId) + .build(); + return createClientGatewayAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new ClientGateway 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 (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   CreateClientGatewayRequest request =
+   *       CreateClientGatewayRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClientGatewayId("clientGatewayId-1199632652")
+   *           .setClientGateway(ClientGateway.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ClientGateway response = clientGatewaysServiceClient.createClientGatewayAsync(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 + createClientGatewayAsync(CreateClientGatewayRequest request) { + return createClientGatewayOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new ClientGateway 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 (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   CreateClientGatewayRequest request =
+   *       CreateClientGatewayRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClientGatewayId("clientGatewayId-1199632652")
+   *           .setClientGateway(ClientGateway.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       clientGatewaysServiceClient.createClientGatewayOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ClientGateway response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + CreateClientGatewayRequest, ClientGateway, ClientGatewayOperationMetadata> + createClientGatewayOperationCallable() { + return stub.createClientGatewayOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new ClientGateway 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 (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   CreateClientGatewayRequest request =
+   *       CreateClientGatewayRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClientGatewayId("clientGatewayId-1199632652")
+   *           .setClientGateway(ClientGateway.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       clientGatewaysServiceClient.createClientGatewayCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createClientGatewayCallable() { + return stub.createClientGatewayCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single ClientGateway. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   ClientGatewayName name = ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]");
+   *   clientGatewaysServiceClient.deleteClientGatewayAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the resource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteClientGatewayAsync( + ClientGatewayName name) { + DeleteClientGatewayRequest request = + DeleteClientGatewayRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return deleteClientGatewayAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single ClientGateway. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   String name = ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]").toString();
+   *   clientGatewaysServiceClient.deleteClientGatewayAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the resource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteClientGatewayAsync( + String name) { + DeleteClientGatewayRequest request = + DeleteClientGatewayRequest.newBuilder().setName(name).build(); + return deleteClientGatewayAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single ClientGateway. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   DeleteClientGatewayRequest request =
+   *       DeleteClientGatewayRequest.newBuilder()
+   *           .setName(
+   *               ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   clientGatewaysServiceClient.deleteClientGatewayAsync(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 deleteClientGatewayAsync( + DeleteClientGatewayRequest request) { + return deleteClientGatewayOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single ClientGateway. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   DeleteClientGatewayRequest request =
+   *       DeleteClientGatewayRequest.newBuilder()
+   *           .setName(
+   *               ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       clientGatewaysServiceClient.deleteClientGatewayCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteClientGatewayCallable() { + return stub.deleteClientGatewayCallable(); + } + + // 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 (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : clientGatewaysServiceClient.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 (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       clientGatewaysServiceClient.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 (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response =
+   *         clientGatewaysServiceClient.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 (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = clientGatewaysServiceClient.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 (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future =
+   *       clientGatewaysServiceClient.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 (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = clientGatewaysServiceClient.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 (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       clientGatewaysServiceClient.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 (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = clientGatewaysServiceClient.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 (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       clientGatewaysServiceClient.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 (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(
+   *               ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = clientGatewaysServiceClient.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 (ClientGatewaysServiceClient clientGatewaysServiceClient =
+   *     ClientGatewaysServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(
+   *               ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       clientGatewaysServiceClient.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 ListClientGatewaysPagedResponse + extends AbstractPagedListResponse< + ListClientGatewaysRequest, + ListClientGatewaysResponse, + ClientGateway, + ListClientGatewaysPage, + ListClientGatewaysFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListClientGatewaysPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListClientGatewaysPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListClientGatewaysPagedResponse(ListClientGatewaysPage page) { + super(page, ListClientGatewaysFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListClientGatewaysPage + extends AbstractPage< + ListClientGatewaysRequest, + ListClientGatewaysResponse, + ClientGateway, + ListClientGatewaysPage> { + + private ListClientGatewaysPage( + PageContext context, + ListClientGatewaysResponse response) { + super(context, response); + } + + private static ListClientGatewaysPage createEmptyPage() { + return new ListClientGatewaysPage(null, null); + } + + @Override + protected ListClientGatewaysPage createPage( + PageContext context, + ListClientGatewaysResponse response) { + return new ListClientGatewaysPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListClientGatewaysFixedSizeCollection + extends AbstractFixedSizeCollection< + ListClientGatewaysRequest, + ListClientGatewaysResponse, + ClientGateway, + ListClientGatewaysPage, + ListClientGatewaysFixedSizeCollection> { + + private ListClientGatewaysFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListClientGatewaysFixedSizeCollection createEmptyCollection() { + return new ListClientGatewaysFixedSizeCollection(null, 0); + } + + @Override + protected ListClientGatewaysFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListClientGatewaysFixedSizeCollection(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-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewaysServiceSettings.java b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewaysServiceSettings.java new file mode 100644 index 000000000000..bbe7519c3199 --- /dev/null +++ b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewaysServiceSettings.java @@ -0,0 +1,322 @@ +/* + * 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.clientgateways.v1; + +import static com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceClient.ListClientGatewaysPagedResponse; +import static com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceClient.ListLocationsPagedResponse; + +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.clientgateways.v1.stub.ClientGatewaysServiceStubSettings; +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 ClientGatewaysServiceClient}. + * + *

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 getClientGateway to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ClientGatewaysServiceSettings.Builder clientGatewaysServiceSettingsBuilder =
+ *     ClientGatewaysServiceSettings.newBuilder();
+ * clientGatewaysServiceSettingsBuilder
+ *     .getClientGatewaySettings()
+ *     .setRetrySettings(
+ *         clientGatewaysServiceSettingsBuilder
+ *             .getClientGatewaySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ClientGatewaysServiceSettings clientGatewaysServiceSettings =
+ *     clientGatewaysServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ClientGatewaysServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listClientGateways. */ + public PagedCallSettings< + ListClientGatewaysRequest, ListClientGatewaysResponse, ListClientGatewaysPagedResponse> + listClientGatewaysSettings() { + return ((ClientGatewaysServiceStubSettings) getStubSettings()).listClientGatewaysSettings(); + } + + /** Returns the object with the settings used for calls to getClientGateway. */ + public UnaryCallSettings getClientGatewaySettings() { + return ((ClientGatewaysServiceStubSettings) getStubSettings()).getClientGatewaySettings(); + } + + /** Returns the object with the settings used for calls to createClientGateway. */ + public UnaryCallSettings createClientGatewaySettings() { + return ((ClientGatewaysServiceStubSettings) getStubSettings()).createClientGatewaySettings(); + } + + /** Returns the object with the settings used for calls to createClientGateway. */ + public OperationCallSettings< + CreateClientGatewayRequest, ClientGateway, ClientGatewayOperationMetadata> + createClientGatewayOperationSettings() { + return ((ClientGatewaysServiceStubSettings) getStubSettings()) + .createClientGatewayOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteClientGateway. */ + public UnaryCallSettings deleteClientGatewaySettings() { + return ((ClientGatewaysServiceStubSettings) getStubSettings()).deleteClientGatewaySettings(); + } + + /** Returns the object with the settings used for calls to deleteClientGateway. */ + public OperationCallSettings + deleteClientGatewayOperationSettings() { + return ((ClientGatewaysServiceStubSettings) getStubSettings()) + .deleteClientGatewayOperationSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((ClientGatewaysServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((ClientGatewaysServiceStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((ClientGatewaysServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((ClientGatewaysServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((ClientGatewaysServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final ClientGatewaysServiceSettings create(ClientGatewaysServiceStubSettings stub) + throws IOException { + return new ClientGatewaysServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ClientGatewaysServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ClientGatewaysServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ClientGatewaysServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ClientGatewaysServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ClientGatewaysServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ClientGatewaysServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ClientGatewaysServiceStubSettings.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 ClientGatewaysServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ClientGatewaysServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ClientGatewaysServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(ClientGatewaysServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ClientGatewaysServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ClientGatewaysServiceStubSettings.newBuilder()); + } + + public ClientGatewaysServiceStubSettings.Builder getStubSettingsBuilder() { + return ((ClientGatewaysServiceStubSettings.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 listClientGateways. */ + public PagedCallSettings.Builder< + ListClientGatewaysRequest, ListClientGatewaysResponse, ListClientGatewaysPagedResponse> + listClientGatewaysSettings() { + return getStubSettingsBuilder().listClientGatewaysSettings(); + } + + /** Returns the builder for the settings used for calls to getClientGateway. */ + public UnaryCallSettings.Builder + getClientGatewaySettings() { + return getStubSettingsBuilder().getClientGatewaySettings(); + } + + /** Returns the builder for the settings used for calls to createClientGateway. */ + public UnaryCallSettings.Builder + createClientGatewaySettings() { + return getStubSettingsBuilder().createClientGatewaySettings(); + } + + /** Returns the builder for the settings used for calls to createClientGateway. */ + public OperationCallSettings.Builder< + CreateClientGatewayRequest, ClientGateway, ClientGatewayOperationMetadata> + createClientGatewayOperationSettings() { + return getStubSettingsBuilder().createClientGatewayOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteClientGateway. */ + public UnaryCallSettings.Builder + deleteClientGatewaySettings() { + return getStubSettingsBuilder().deleteClientGatewaySettings(); + } + + /** Returns the builder for the settings used for calls to deleteClientGateway. */ + public OperationCallSettings.Builder< + DeleteClientGatewayRequest, Empty, ClientGatewayOperationMetadata> + deleteClientGatewayOperationSettings() { + return getStubSettingsBuilder().deleteClientGatewayOperationSettings(); + } + + /** 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 ClientGatewaysServiceSettings build() throws IOException { + return new ClientGatewaysServiceSettings(this); + } + } +} diff --git a/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/gapic_metadata.json b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/gapic_metadata.json new file mode 100644 index 000000000000..0f03ce2f6951 --- /dev/null +++ b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/gapic_metadata.json @@ -0,0 +1,45 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.beyondcorp.clientgateways.v1", + "libraryPackage": "com.google.cloud.beyondcorp.clientgateways.v1", + "services": { + "ClientGatewaysService": { + "clients": { + "grpc": { + "libraryClient": "ClientGatewaysServiceClient", + "rpcs": { + "CreateClientGateway": { + "methods": ["createClientGatewayAsync", "createClientGatewayAsync", "createClientGatewayAsync", "createClientGatewayOperationCallable", "createClientGatewayCallable"] + }, + "DeleteClientGateway": { + "methods": ["deleteClientGatewayAsync", "deleteClientGatewayAsync", "deleteClientGatewayAsync", "deleteClientGatewayOperationCallable", "deleteClientGatewayCallable"] + }, + "GetClientGateway": { + "methods": ["getClientGateway", "getClientGateway", "getClientGateway", "getClientGatewayCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListClientGateways": { + "methods": ["listClientGateways", "listClientGateways", "listClientGateways", "listClientGatewaysPagedCallable", "listClientGatewaysCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/package-info.java b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/package-info.java new file mode 100644 index 000000000000..50dde3b251a4 --- /dev/null +++ b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/package-info.java @@ -0,0 +1,52 @@ +/* + * 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. + * + *

======================= ClientGatewaysServiceClient ======================= + * + *

Service Description: ## API Overview + * + *

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

## Data Model + * + *

The ClientGatewaysService exposes the following resources: + * + *

    + *
  • Client Gateways, named as follows: + * `projects/{project_id}/locations/{location_id}/clientGateways/{client_gateway_id}`. + *
+ * + *

Sample for ClientGatewaysServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ClientGatewaysServiceClient clientGatewaysServiceClient =
+ *     ClientGatewaysServiceClient.create()) {
+ *   ClientGatewayName name = ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]");
+ *   ClientGateway response = clientGatewaysServiceClient.getClientGateway(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.beyondcorp.clientgateways.v1; + +import javax.annotation.Generated; diff --git a/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/stub/ClientGatewaysServiceStub.java b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/stub/ClientGatewaysServiceStub.java new file mode 100644 index 000000000000..2a3c725f362d --- /dev/null +++ b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/stub/ClientGatewaysServiceStub.java @@ -0,0 +1,122 @@ +/* + * 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.clientgateways.v1.stub; + +import static com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceClient.ListClientGatewaysPagedResponse; +import static com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceClient.ListLocationsPagedResponse; + +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.clientgateways.v1.ClientGateway; +import com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata; +import com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest; +import com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest; +import com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest; +import com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest; +import com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse; +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 ClientGatewaysService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class ClientGatewaysServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable + listClientGatewaysPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listClientGatewaysPagedCallable()"); + } + + public UnaryCallable + listClientGatewaysCallable() { + throw new UnsupportedOperationException("Not implemented: listClientGatewaysCallable()"); + } + + public UnaryCallable getClientGatewayCallable() { + throw new UnsupportedOperationException("Not implemented: getClientGatewayCallable()"); + } + + public OperationCallable< + CreateClientGatewayRequest, ClientGateway, ClientGatewayOperationMetadata> + createClientGatewayOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createClientGatewayOperationCallable()"); + } + + public UnaryCallable createClientGatewayCallable() { + throw new UnsupportedOperationException("Not implemented: createClientGatewayCallable()"); + } + + public OperationCallable + deleteClientGatewayOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteClientGatewayOperationCallable()"); + } + + public UnaryCallable deleteClientGatewayCallable() { + throw new UnsupportedOperationException("Not implemented: deleteClientGatewayCallable()"); + } + + 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-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/stub/ClientGatewaysServiceStubSettings.java b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/stub/ClientGatewaysServiceStubSettings.java new file mode 100644 index 000000000000..40704ab6d7ab --- /dev/null +++ b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/stub/ClientGatewaysServiceStubSettings.java @@ -0,0 +1,719 @@ +/* + * 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.clientgateways.v1.stub; + +import static com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceClient.ListClientGatewaysPagedResponse; +import static com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceClient.ListLocationsPagedResponse; + +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.clientgateways.v1.ClientGateway; +import com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata; +import com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest; +import com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest; +import com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest; +import com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest; +import com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse; +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 ClientGatewaysServiceStub}. + * + *

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 getClientGateway to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ClientGatewaysServiceStubSettings.Builder clientGatewaysServiceSettingsBuilder =
+ *     ClientGatewaysServiceStubSettings.newBuilder();
+ * clientGatewaysServiceSettingsBuilder
+ *     .getClientGatewaySettings()
+ *     .setRetrySettings(
+ *         clientGatewaysServiceSettingsBuilder
+ *             .getClientGatewaySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ClientGatewaysServiceStubSettings clientGatewaysServiceSettings =
+ *     clientGatewaysServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ClientGatewaysServiceStubSettings + 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< + ListClientGatewaysRequest, ListClientGatewaysResponse, ListClientGatewaysPagedResponse> + listClientGatewaysSettings; + private final UnaryCallSettings getClientGatewaySettings; + private final UnaryCallSettings + createClientGatewaySettings; + private final OperationCallSettings< + CreateClientGatewayRequest, ClientGateway, ClientGatewayOperationMetadata> + createClientGatewayOperationSettings; + private final UnaryCallSettings + deleteClientGatewaySettings; + private final OperationCallSettings< + DeleteClientGatewayRequest, Empty, ClientGatewayOperationMetadata> + deleteClientGatewayOperationSettings; + 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< + ListClientGatewaysRequest, ListClientGatewaysResponse, ClientGateway> + LIST_CLIENT_GATEWAYS_PAGE_STR_DESC = + new PagedListDescriptor< + ListClientGatewaysRequest, ListClientGatewaysResponse, ClientGateway>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListClientGatewaysRequest injectToken( + ListClientGatewaysRequest payload, String token) { + return ListClientGatewaysRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListClientGatewaysRequest injectPageSize( + ListClientGatewaysRequest payload, int pageSize) { + return ListClientGatewaysRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListClientGatewaysRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListClientGatewaysResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListClientGatewaysResponse payload) { + return payload.getClientGatewaysList() == null + ? ImmutableList.of() + : payload.getClientGatewaysList(); + } + }; + + 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< + ListClientGatewaysRequest, ListClientGatewaysResponse, ListClientGatewaysPagedResponse> + LIST_CLIENT_GATEWAYS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListClientGatewaysRequest, + ListClientGatewaysResponse, + ListClientGatewaysPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListClientGatewaysRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_CLIENT_GATEWAYS_PAGE_STR_DESC, request, context); + return ListClientGatewaysPagedResponse.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 listClientGateways. */ + public PagedCallSettings< + ListClientGatewaysRequest, ListClientGatewaysResponse, ListClientGatewaysPagedResponse> + listClientGatewaysSettings() { + return listClientGatewaysSettings; + } + + /** Returns the object with the settings used for calls to getClientGateway. */ + public UnaryCallSettings getClientGatewaySettings() { + return getClientGatewaySettings; + } + + /** Returns the object with the settings used for calls to createClientGateway. */ + public UnaryCallSettings createClientGatewaySettings() { + return createClientGatewaySettings; + } + + /** Returns the object with the settings used for calls to createClientGateway. */ + public OperationCallSettings< + CreateClientGatewayRequest, ClientGateway, ClientGatewayOperationMetadata> + createClientGatewayOperationSettings() { + return createClientGatewayOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteClientGateway. */ + public UnaryCallSettings deleteClientGatewaySettings() { + return deleteClientGatewaySettings; + } + + /** Returns the object with the settings used for calls to deleteClientGateway. */ + public OperationCallSettings + deleteClientGatewayOperationSettings() { + return deleteClientGatewayOperationSettings; + } + + /** 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 ClientGatewaysServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcClientGatewaysServiceStub.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(ClientGatewaysServiceStubSettings.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 ClientGatewaysServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listClientGatewaysSettings = settingsBuilder.listClientGatewaysSettings().build(); + getClientGatewaySettings = settingsBuilder.getClientGatewaySettings().build(); + createClientGatewaySettings = settingsBuilder.createClientGatewaySettings().build(); + createClientGatewayOperationSettings = + settingsBuilder.createClientGatewayOperationSettings().build(); + deleteClientGatewaySettings = settingsBuilder.deleteClientGatewaySettings().build(); + deleteClientGatewayOperationSettings = + settingsBuilder.deleteClientGatewayOperationSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for ClientGatewaysServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListClientGatewaysRequest, ListClientGatewaysResponse, ListClientGatewaysPagedResponse> + listClientGatewaysSettings; + private final UnaryCallSettings.Builder + getClientGatewaySettings; + private final UnaryCallSettings.Builder + createClientGatewaySettings; + private final OperationCallSettings.Builder< + CreateClientGatewayRequest, ClientGateway, ClientGatewayOperationMetadata> + createClientGatewayOperationSettings; + private final UnaryCallSettings.Builder + deleteClientGatewaySettings; + private final OperationCallSettings.Builder< + DeleteClientGatewayRequest, Empty, ClientGatewayOperationMetadata> + deleteClientGatewayOperationSettings; + 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); + + listClientGatewaysSettings = PagedCallSettings.newBuilder(LIST_CLIENT_GATEWAYS_PAGE_STR_FACT); + getClientGatewaySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createClientGatewaySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createClientGatewayOperationSettings = OperationCallSettings.newBuilder(); + deleteClientGatewaySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteClientGatewayOperationSettings = OperationCallSettings.newBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listClientGatewaysSettings, + getClientGatewaySettings, + createClientGatewaySettings, + deleteClientGatewaySettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(ClientGatewaysServiceStubSettings settings) { + super(settings); + + listClientGatewaysSettings = settings.listClientGatewaysSettings.toBuilder(); + getClientGatewaySettings = settings.getClientGatewaySettings.toBuilder(); + createClientGatewaySettings = settings.createClientGatewaySettings.toBuilder(); + createClientGatewayOperationSettings = + settings.createClientGatewayOperationSettings.toBuilder(); + deleteClientGatewaySettings = settings.deleteClientGatewaySettings.toBuilder(); + deleteClientGatewayOperationSettings = + settings.deleteClientGatewayOperationSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listClientGatewaysSettings, + getClientGatewaySettings, + createClientGatewaySettings, + deleteClientGatewaySettings, + 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 + .listClientGatewaysSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getClientGatewaySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createClientGatewaySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteClientGatewaySettings() + .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 + .createClientGatewayOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(ClientGateway.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + ClientGatewayOperationMetadata.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 + .deleteClientGatewayOperationSettings() + .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( + ClientGatewayOperationMetadata.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 listClientGateways. */ + public PagedCallSettings.Builder< + ListClientGatewaysRequest, ListClientGatewaysResponse, ListClientGatewaysPagedResponse> + listClientGatewaysSettings() { + return listClientGatewaysSettings; + } + + /** Returns the builder for the settings used for calls to getClientGateway. */ + public UnaryCallSettings.Builder + getClientGatewaySettings() { + return getClientGatewaySettings; + } + + /** Returns the builder for the settings used for calls to createClientGateway. */ + public UnaryCallSettings.Builder + createClientGatewaySettings() { + return createClientGatewaySettings; + } + + /** Returns the builder for the settings used for calls to createClientGateway. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + CreateClientGatewayRequest, ClientGateway, ClientGatewayOperationMetadata> + createClientGatewayOperationSettings() { + return createClientGatewayOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteClientGateway. */ + public UnaryCallSettings.Builder + deleteClientGatewaySettings() { + return deleteClientGatewaySettings; + } + + /** Returns the builder for the settings used for calls to deleteClientGateway. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + DeleteClientGatewayRequest, Empty, ClientGatewayOperationMetadata> + deleteClientGatewayOperationSettings() { + return deleteClientGatewayOperationSettings; + } + + /** 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 ClientGatewaysServiceStubSettings build() throws IOException { + return new ClientGatewaysServiceStubSettings(this); + } + } +} diff --git a/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/stub/GrpcClientGatewaysServiceCallableFactory.java b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/stub/GrpcClientGatewaysServiceCallableFactory.java new file mode 100644 index 000000000000..6d0cf553b979 --- /dev/null +++ b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/stub/GrpcClientGatewaysServiceCallableFactory.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.clientgateways.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 ClientGatewaysService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcClientGatewaysServiceCallableFactory 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-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/stub/GrpcClientGatewaysServiceStub.java b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/stub/GrpcClientGatewaysServiceStub.java new file mode 100644 index 000000000000..76ff6a4895e7 --- /dev/null +++ b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/stub/GrpcClientGatewaysServiceStub.java @@ -0,0 +1,483 @@ +/* + * 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.clientgateways.v1.stub; + +import static com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceClient.ListClientGatewaysPagedResponse; +import static com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceClient.ListLocationsPagedResponse; + +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.clientgateways.v1.ClientGateway; +import com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata; +import com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest; +import com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest; +import com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest; +import com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest; +import com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse; +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 ClientGatewaysService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcClientGatewaysServiceStub extends ClientGatewaysServiceStub { + private static final MethodDescriptor + listClientGatewaysMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysService/ListClientGateways") + .setRequestMarshaller( + ProtoUtils.marshaller(ListClientGatewaysRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListClientGatewaysResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getClientGatewayMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysService/GetClientGateway") + .setRequestMarshaller( + ProtoUtils.marshaller(GetClientGatewayRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ClientGateway.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createClientGatewayMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysService/CreateClientGateway") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateClientGatewayRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteClientGatewayMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysService/DeleteClientGateway") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteClientGatewayRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.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 + listClientGatewaysCallable; + private final UnaryCallable + listClientGatewaysPagedCallable; + private final UnaryCallable getClientGatewayCallable; + private final UnaryCallable createClientGatewayCallable; + private final OperationCallable< + CreateClientGatewayRequest, ClientGateway, ClientGatewayOperationMetadata> + createClientGatewayOperationCallable; + private final UnaryCallable deleteClientGatewayCallable; + private final OperationCallable + deleteClientGatewayOperationCallable; + 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 GrpcClientGatewaysServiceStub create( + ClientGatewaysServiceStubSettings settings) throws IOException { + return new GrpcClientGatewaysServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcClientGatewaysServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcClientGatewaysServiceStub( + ClientGatewaysServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcClientGatewaysServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcClientGatewaysServiceStub( + ClientGatewaysServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcClientGatewaysServiceStub, 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 GrpcClientGatewaysServiceStub( + ClientGatewaysServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcClientGatewaysServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcClientGatewaysServiceStub, 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 GrpcClientGatewaysServiceStub( + ClientGatewaysServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listClientGatewaysTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listClientGatewaysMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getClientGatewayTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getClientGatewayMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createClientGatewayTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createClientGatewayMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteClientGatewayTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteClientGatewayMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + 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.listClientGatewaysCallable = + callableFactory.createUnaryCallable( + listClientGatewaysTransportSettings, + settings.listClientGatewaysSettings(), + clientContext); + this.listClientGatewaysPagedCallable = + callableFactory.createPagedCallable( + listClientGatewaysTransportSettings, + settings.listClientGatewaysSettings(), + clientContext); + this.getClientGatewayCallable = + callableFactory.createUnaryCallable( + getClientGatewayTransportSettings, settings.getClientGatewaySettings(), clientContext); + this.createClientGatewayCallable = + callableFactory.createUnaryCallable( + createClientGatewayTransportSettings, + settings.createClientGatewaySettings(), + clientContext); + this.createClientGatewayOperationCallable = + callableFactory.createOperationCallable( + createClientGatewayTransportSettings, + settings.createClientGatewayOperationSettings(), + clientContext, + operationsStub); + this.deleteClientGatewayCallable = + callableFactory.createUnaryCallable( + deleteClientGatewayTransportSettings, + settings.deleteClientGatewaySettings(), + clientContext); + this.deleteClientGatewayOperationCallable = + callableFactory.createOperationCallable( + deleteClientGatewayTransportSettings, + settings.deleteClientGatewayOperationSettings(), + clientContext, + operationsStub); + 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 + listClientGatewaysCallable() { + return listClientGatewaysCallable; + } + + @Override + public UnaryCallable + listClientGatewaysPagedCallable() { + return listClientGatewaysPagedCallable; + } + + @Override + public UnaryCallable getClientGatewayCallable() { + return getClientGatewayCallable; + } + + @Override + public UnaryCallable createClientGatewayCallable() { + return createClientGatewayCallable; + } + + @Override + public OperationCallable< + CreateClientGatewayRequest, ClientGateway, ClientGatewayOperationMetadata> + createClientGatewayOperationCallable() { + return createClientGatewayOperationCallable; + } + + @Override + public UnaryCallable deleteClientGatewayCallable() { + return deleteClientGatewayCallable; + } + + @Override + public OperationCallable + deleteClientGatewayOperationCallable() { + return deleteClientGatewayOperationCallable; + } + + @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-clientgateways/google-cloud-beyondcorp-clientgateways/src/test/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewaysServiceClientTest.java b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/test/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewaysServiceClientTest.java new file mode 100644 index 000000000000..0aa1023157dc --- /dev/null +++ b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/test/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewaysServiceClientTest.java @@ -0,0 +1,734 @@ +/* + * 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.clientgateways.v1; + +import static com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceClient.ListClientGatewaysPagedResponse; +import static com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceClient.ListLocationsPagedResponse; + +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 ClientGatewaysServiceClientTest { + private static MockClientGatewaysService mockClientGatewaysService; + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ClientGatewaysServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockClientGatewaysService = new MockClientGatewaysService(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList( + mockClientGatewaysService, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ClientGatewaysServiceSettings settings = + ClientGatewaysServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ClientGatewaysServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listClientGatewaysTest() throws Exception { + ClientGateway responsesElement = ClientGateway.newBuilder().build(); + ListClientGatewaysResponse expectedResponse = + ListClientGatewaysResponse.newBuilder() + .setNextPageToken("") + .addAllClientGateways(Arrays.asList(responsesElement)) + .build(); + mockClientGatewaysService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListClientGatewaysPagedResponse pagedListResponse = client.listClientGateways(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getClientGatewaysList().get(0), resources.get(0)); + + List actualRequests = mockClientGatewaysService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListClientGatewaysRequest actualRequest = ((ListClientGatewaysRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listClientGatewaysExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockClientGatewaysService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listClientGateways(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listClientGatewaysTest2() throws Exception { + ClientGateway responsesElement = ClientGateway.newBuilder().build(); + ListClientGatewaysResponse expectedResponse = + ListClientGatewaysResponse.newBuilder() + .setNextPageToken("") + .addAllClientGateways(Arrays.asList(responsesElement)) + .build(); + mockClientGatewaysService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListClientGatewaysPagedResponse pagedListResponse = client.listClientGateways(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getClientGatewaysList().get(0), resources.get(0)); + + List actualRequests = mockClientGatewaysService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListClientGatewaysRequest actualRequest = ((ListClientGatewaysRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listClientGatewaysExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockClientGatewaysService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listClientGateways(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getClientGatewayTest() throws Exception { + ClientGateway expectedResponse = + ClientGateway.newBuilder() + .setName(ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setId("id3355") + .setClientConnectorService("clientConnectorService-1129927789") + .build(); + mockClientGatewaysService.addResponse(expectedResponse); + + ClientGatewayName name = ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]"); + + ClientGateway actualResponse = client.getClientGateway(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockClientGatewaysService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetClientGatewayRequest actualRequest = ((GetClientGatewayRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getClientGatewayExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockClientGatewaysService.addException(exception); + + try { + ClientGatewayName name = ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]"); + client.getClientGateway(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getClientGatewayTest2() throws Exception { + ClientGateway expectedResponse = + ClientGateway.newBuilder() + .setName(ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setId("id3355") + .setClientConnectorService("clientConnectorService-1129927789") + .build(); + mockClientGatewaysService.addResponse(expectedResponse); + + String name = "name3373707"; + + ClientGateway actualResponse = client.getClientGateway(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockClientGatewaysService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetClientGatewayRequest actualRequest = ((GetClientGatewayRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getClientGatewayExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockClientGatewaysService.addException(exception); + + try { + String name = "name3373707"; + client.getClientGateway(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createClientGatewayTest() throws Exception { + ClientGateway expectedResponse = + ClientGateway.newBuilder() + .setName(ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setId("id3355") + .setClientConnectorService("clientConnectorService-1129927789") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClientGatewayTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockClientGatewaysService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ClientGateway clientGateway = ClientGateway.newBuilder().build(); + String clientGatewayId = "clientGatewayId-1199632652"; + + ClientGateway actualResponse = + client.createClientGatewayAsync(parent, clientGateway, clientGatewayId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockClientGatewaysService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateClientGatewayRequest actualRequest = ((CreateClientGatewayRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(clientGateway, actualRequest.getClientGateway()); + Assert.assertEquals(clientGatewayId, actualRequest.getClientGatewayId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createClientGatewayExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockClientGatewaysService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ClientGateway clientGateway = ClientGateway.newBuilder().build(); + String clientGatewayId = "clientGatewayId-1199632652"; + client.createClientGatewayAsync(parent, clientGateway, clientGatewayId).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 createClientGatewayTest2() throws Exception { + ClientGateway expectedResponse = + ClientGateway.newBuilder() + .setName(ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setId("id3355") + .setClientConnectorService("clientConnectorService-1129927789") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClientGatewayTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockClientGatewaysService.addResponse(resultOperation); + + String parent = "parent-995424086"; + ClientGateway clientGateway = ClientGateway.newBuilder().build(); + String clientGatewayId = "clientGatewayId-1199632652"; + + ClientGateway actualResponse = + client.createClientGatewayAsync(parent, clientGateway, clientGatewayId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockClientGatewaysService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateClientGatewayRequest actualRequest = ((CreateClientGatewayRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(clientGateway, actualRequest.getClientGateway()); + Assert.assertEquals(clientGatewayId, actualRequest.getClientGatewayId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createClientGatewayExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockClientGatewaysService.addException(exception); + + try { + String parent = "parent-995424086"; + ClientGateway clientGateway = ClientGateway.newBuilder().build(); + String clientGatewayId = "clientGatewayId-1199632652"; + client.createClientGatewayAsync(parent, clientGateway, clientGatewayId).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 deleteClientGatewayTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteClientGatewayTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockClientGatewaysService.addResponse(resultOperation); + + ClientGatewayName name = ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]"); + + client.deleteClientGatewayAsync(name).get(); + + List actualRequests = mockClientGatewaysService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteClientGatewayRequest actualRequest = ((DeleteClientGatewayRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteClientGatewayExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockClientGatewaysService.addException(exception); + + try { + ClientGatewayName name = ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]"); + client.deleteClientGatewayAsync(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 deleteClientGatewayTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteClientGatewayTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockClientGatewaysService.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteClientGatewayAsync(name).get(); + + List actualRequests = mockClientGatewaysService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteClientGatewayRequest actualRequest = ((DeleteClientGatewayRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteClientGatewayExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockClientGatewaysService.addException(exception); + + try { + String name = "name3373707"; + client.deleteClientGatewayAsync(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 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( + ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]").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( + ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]").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( + ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]").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( + ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]").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( + ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]").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( + ClientGatewayName.of("[PROJECT]", "[LOCATION]", "[CLIENT_GATEWAY]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/test/java/com/google/cloud/beyondcorp/clientgateways/v1/MockClientGatewaysService.java b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/test/java/com/google/cloud/beyondcorp/clientgateways/v1/MockClientGatewaysService.java new file mode 100644 index 000000000000..a880a7e20f66 --- /dev/null +++ b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/test/java/com/google/cloud/beyondcorp/clientgateways/v1/MockClientGatewaysService.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.clientgateways.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 MockClientGatewaysService implements MockGrpcService { + private final MockClientGatewaysServiceImpl serviceImpl; + + public MockClientGatewaysService() { + serviceImpl = new MockClientGatewaysServiceImpl(); + } + + @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-clientgateways/google-cloud-beyondcorp-clientgateways/src/test/java/com/google/cloud/beyondcorp/clientgateways/v1/MockClientGatewaysServiceImpl.java b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/test/java/com/google/cloud/beyondcorp/clientgateways/v1/MockClientGatewaysServiceImpl.java new file mode 100644 index 000000000000..d71c524c6eed --- /dev/null +++ b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/test/java/com/google/cloud/beyondcorp/clientgateways/v1/MockClientGatewaysServiceImpl.java @@ -0,0 +1,146 @@ +/* + * 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.clientgateways.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceGrpc.ClientGatewaysServiceImplBase; +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 MockClientGatewaysServiceImpl extends ClientGatewaysServiceImplBase { + private List requests; + private Queue responses; + + public MockClientGatewaysServiceImpl() { + 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 listClientGateways( + ListClientGatewaysRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListClientGatewaysResponse) { + requests.add(request); + responseObserver.onNext(((ListClientGatewaysResponse) 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 ListClientGateways, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListClientGatewaysResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getClientGateway( + GetClientGatewayRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ClientGateway) { + requests.add(request); + responseObserver.onNext(((ClientGateway) 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 GetClientGateway, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ClientGateway.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createClientGateway( + CreateClientGatewayRequest 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 CreateClientGateway, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteClientGateway( + DeleteClientGatewayRequest 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 DeleteClientGateway, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/test/java/com/google/cloud/beyondcorp/clientgateways/v1/MockIAMPolicy.java b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/test/java/com/google/cloud/beyondcorp/clientgateways/v1/MockIAMPolicy.java new file mode 100644 index 000000000000..bbbcf5f0b824 --- /dev/null +++ b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/test/java/com/google/cloud/beyondcorp/clientgateways/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.clientgateways.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-clientgateways/google-cloud-beyondcorp-clientgateways/src/test/java/com/google/cloud/beyondcorp/clientgateways/v1/MockIAMPolicyImpl.java b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/test/java/com/google/cloud/beyondcorp/clientgateways/v1/MockIAMPolicyImpl.java new file mode 100644 index 000000000000..40cbff4c1eb5 --- /dev/null +++ b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/test/java/com/google/cloud/beyondcorp/clientgateways/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.clientgateways.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-clientgateways/google-cloud-beyondcorp-clientgateways/src/test/java/com/google/cloud/beyondcorp/clientgateways/v1/MockLocations.java b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/test/java/com/google/cloud/beyondcorp/clientgateways/v1/MockLocations.java new file mode 100644 index 000000000000..a1d702892660 --- /dev/null +++ b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/test/java/com/google/cloud/beyondcorp/clientgateways/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.clientgateways.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-clientgateways/google-cloud-beyondcorp-clientgateways/src/test/java/com/google/cloud/beyondcorp/clientgateways/v1/MockLocationsImpl.java b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/test/java/com/google/cloud/beyondcorp/clientgateways/v1/MockLocationsImpl.java new file mode 100644 index 000000000000..60f38ea8e54c --- /dev/null +++ b/java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/src/test/java/com/google/cloud/beyondcorp/clientgateways/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.clientgateways.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-clientgateways/grpc-google-cloud-beyondcorp-clientgateways-v1/pom.xml b/java-beyondcorp-clientgateways/grpc-google-cloud-beyondcorp-clientgateways-v1/pom.xml new file mode 100644 index 000000000000..c2391936a223 --- /dev/null +++ b/java-beyondcorp-clientgateways/grpc-google-cloud-beyondcorp-clientgateways-v1/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-beyondcorp-clientgateways-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-beyondcorp-clientgateways-v1 + GRPC library for google-cloud-beyondcorp-clientgateways + + com.google.cloud + google-cloud-beyondcorp-clientgateways-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-clientgateways-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-clientgateways/grpc-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewaysServiceGrpc.java b/java-beyondcorp-clientgateways/grpc-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewaysServiceGrpc.java new file mode 100644 index 000000000000..86144191f7df --- /dev/null +++ b/java-beyondcorp-clientgateways/grpc-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewaysServiceGrpc.java @@ -0,0 +1,767 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.clientgateways.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * ## API Overview
+ * The `beyondcorp.googleapis.com` service implements the Google Cloud
+ * BeyondCorp API.
+ * ## Data Model
+ * The ClientGatewaysService exposes the following resources:
+ * * Client Gateways, named as follows:
+ *   `projects/{project_id}/locations/{location_id}/clientGateways/{client_gateway_id}`.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/beyondcorp/clientgateways/v1/client_gateways_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class ClientGatewaysServiceGrpc { + + private ClientGatewaysServiceGrpc() {} + + public static final String SERVICE_NAME = + "google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest, + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse> + getListClientGatewaysMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListClientGateways", + requestType = com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest.class, + responseType = com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest, + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse> + getListClientGatewaysMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest, + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse> + getListClientGatewaysMethod; + if ((getListClientGatewaysMethod = ClientGatewaysServiceGrpc.getListClientGatewaysMethod) + == null) { + synchronized (ClientGatewaysServiceGrpc.class) { + if ((getListClientGatewaysMethod = ClientGatewaysServiceGrpc.getListClientGatewaysMethod) + == null) { + ClientGatewaysServiceGrpc.getListClientGatewaysMethod = + getListClientGatewaysMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListClientGateways")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.beyondcorp.clientgateways.v1 + .ListClientGatewaysRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.beyondcorp.clientgateways.v1 + .ListClientGatewaysResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ClientGatewaysServiceMethodDescriptorSupplier("ListClientGateways")) + .build(); + } + } + } + return getListClientGatewaysMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest, + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway> + getGetClientGatewayMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetClientGateway", + requestType = com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest.class, + responseType = com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest, + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway> + getGetClientGatewayMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest, + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway> + getGetClientGatewayMethod; + if ((getGetClientGatewayMethod = ClientGatewaysServiceGrpc.getGetClientGatewayMethod) == null) { + synchronized (ClientGatewaysServiceGrpc.class) { + if ((getGetClientGatewayMethod = ClientGatewaysServiceGrpc.getGetClientGatewayMethod) + == null) { + ClientGatewaysServiceGrpc.getGetClientGatewayMethod = + getGetClientGatewayMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetClientGateway")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway + .getDefaultInstance())) + .setSchemaDescriptor( + new ClientGatewaysServiceMethodDescriptorSupplier("GetClientGateway")) + .build(); + } + } + } + return getGetClientGatewayMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest, + com.google.longrunning.Operation> + getCreateClientGatewayMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateClientGateway", + requestType = com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest, + com.google.longrunning.Operation> + getCreateClientGatewayMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest, + com.google.longrunning.Operation> + getCreateClientGatewayMethod; + if ((getCreateClientGatewayMethod = ClientGatewaysServiceGrpc.getCreateClientGatewayMethod) + == null) { + synchronized (ClientGatewaysServiceGrpc.class) { + if ((getCreateClientGatewayMethod = ClientGatewaysServiceGrpc.getCreateClientGatewayMethod) + == null) { + ClientGatewaysServiceGrpc.getCreateClientGatewayMethod = + getCreateClientGatewayMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateClientGateway")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.beyondcorp.clientgateways.v1 + .CreateClientGatewayRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ClientGatewaysServiceMethodDescriptorSupplier("CreateClientGateway")) + .build(); + } + } + } + return getCreateClientGatewayMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest, + com.google.longrunning.Operation> + getDeleteClientGatewayMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteClientGateway", + requestType = com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest, + com.google.longrunning.Operation> + getDeleteClientGatewayMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest, + com.google.longrunning.Operation> + getDeleteClientGatewayMethod; + if ((getDeleteClientGatewayMethod = ClientGatewaysServiceGrpc.getDeleteClientGatewayMethod) + == null) { + synchronized (ClientGatewaysServiceGrpc.class) { + if ((getDeleteClientGatewayMethod = ClientGatewaysServiceGrpc.getDeleteClientGatewayMethod) + == null) { + ClientGatewaysServiceGrpc.getDeleteClientGatewayMethod = + getDeleteClientGatewayMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteClientGateway")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.beyondcorp.clientgateways.v1 + .DeleteClientGatewayRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ClientGatewaysServiceMethodDescriptorSupplier("DeleteClientGateway")) + .build(); + } + } + } + return getDeleteClientGatewayMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ClientGatewaysServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ClientGatewaysServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ClientGatewaysServiceStub(channel, callOptions); + } + }; + return ClientGatewaysServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ClientGatewaysServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ClientGatewaysServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ClientGatewaysServiceBlockingStub(channel, callOptions); + } + }; + return ClientGatewaysServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ClientGatewaysServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ClientGatewaysServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ClientGatewaysServiceFutureStub(channel, callOptions); + } + }; + return ClientGatewaysServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * ## API Overview
+   * The `beyondcorp.googleapis.com` service implements the Google Cloud
+   * BeyondCorp API.
+   * ## Data Model
+   * The ClientGatewaysService exposes the following resources:
+   * * Client Gateways, named as follows:
+   *   `projects/{project_id}/locations/{location_id}/clientGateways/{client_gateway_id}`.
+   * 
+ */ + public abstract static class ClientGatewaysServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists ClientGateways in a given project and location.
+     * 
+ */ + public void listClientGateways( + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListClientGatewaysMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single ClientGateway.
+     * 
+ */ + public void getClientGateway( + com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetClientGatewayMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new ClientGateway in a given project and location.
+     * 
+ */ + public void createClientGateway( + com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateClientGatewayMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single ClientGateway.
+     * 
+ */ + public void deleteClientGateway( + com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteClientGatewayMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListClientGatewaysMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest, + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse>( + this, METHODID_LIST_CLIENT_GATEWAYS))) + .addMethod( + getGetClientGatewayMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest, + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway>( + this, METHODID_GET_CLIENT_GATEWAY))) + .addMethod( + getCreateClientGatewayMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_CLIENT_GATEWAY))) + .addMethod( + getDeleteClientGatewayMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_CLIENT_GATEWAY))) + .build(); + } + } + + /** + * + * + *
+   * ## API Overview
+   * The `beyondcorp.googleapis.com` service implements the Google Cloud
+   * BeyondCorp API.
+   * ## Data Model
+   * The ClientGatewaysService exposes the following resources:
+   * * Client Gateways, named as follows:
+   *   `projects/{project_id}/locations/{location_id}/clientGateways/{client_gateway_id}`.
+   * 
+ */ + public static final class ClientGatewaysServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private ClientGatewaysServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ClientGatewaysServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ClientGatewaysServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists ClientGateways in a given project and location.
+     * 
+ */ + public void listClientGateways( + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListClientGatewaysMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single ClientGateway.
+     * 
+ */ + public void getClientGateway( + com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetClientGatewayMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new ClientGateway in a given project and location.
+     * 
+ */ + public void createClientGateway( + com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateClientGatewayMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single ClientGateway.
+     * 
+ */ + public void deleteClientGateway( + com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteClientGatewayMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * ## API Overview
+   * The `beyondcorp.googleapis.com` service implements the Google Cloud
+   * BeyondCorp API.
+   * ## Data Model
+   * The ClientGatewaysService exposes the following resources:
+   * * Client Gateways, named as follows:
+   *   `projects/{project_id}/locations/{location_id}/clientGateways/{client_gateway_id}`.
+   * 
+ */ + public static final class ClientGatewaysServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ClientGatewaysServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ClientGatewaysServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ClientGatewaysServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists ClientGateways in a given project and location.
+     * 
+ */ + public com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse + listClientGateways( + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListClientGatewaysMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single ClientGateway.
+     * 
+ */ + public com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway getClientGateway( + com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetClientGatewayMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new ClientGateway in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createClientGateway( + com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateClientGatewayMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single ClientGateway.
+     * 
+ */ + public com.google.longrunning.Operation deleteClientGateway( + com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteClientGatewayMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * ## API Overview
+   * The `beyondcorp.googleapis.com` service implements the Google Cloud
+   * BeyondCorp API.
+   * ## Data Model
+   * The ClientGatewaysService exposes the following resources:
+   * * Client Gateways, named as follows:
+   *   `projects/{project_id}/locations/{location_id}/clientGateways/{client_gateway_id}`.
+   * 
+ */ + public static final class ClientGatewaysServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ClientGatewaysServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ClientGatewaysServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ClientGatewaysServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists ClientGateways in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse> + listClientGateways( + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListClientGatewaysMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single ClientGateway.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway> + getClientGateway( + com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetClientGatewayMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new ClientGateway in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createClientGateway( + com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateClientGatewayMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single ClientGateway.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteClientGateway( + com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteClientGatewayMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_CLIENT_GATEWAYS = 0; + private static final int METHODID_GET_CLIENT_GATEWAY = 1; + private static final int METHODID_CREATE_CLIENT_GATEWAY = 2; + private static final int METHODID_DELETE_CLIENT_GATEWAY = 3; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final ClientGatewaysServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ClientGatewaysServiceImplBase 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_CLIENT_GATEWAYS: + serviceImpl.listClientGateways( + (com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse>) + responseObserver); + break; + case METHODID_GET_CLIENT_GATEWAY: + serviceImpl.getClientGateway( + (com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway>) + responseObserver); + break; + case METHODID_CREATE_CLIENT_GATEWAY: + serviceImpl.createClientGateway( + (com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_CLIENT_GATEWAY: + serviceImpl.deleteClientGateway( + (com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class ClientGatewaysServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ClientGatewaysServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ClientGatewaysService"); + } + } + + private static final class ClientGatewaysServiceFileDescriptorSupplier + extends ClientGatewaysServiceBaseDescriptorSupplier { + ClientGatewaysServiceFileDescriptorSupplier() {} + } + + private static final class ClientGatewaysServiceMethodDescriptorSupplier + extends ClientGatewaysServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ClientGatewaysServiceMethodDescriptorSupplier(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 (ClientGatewaysServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ClientGatewaysServiceFileDescriptorSupplier()) + .addMethod(getListClientGatewaysMethod()) + .addMethod(getGetClientGatewayMethod()) + .addMethod(getCreateClientGatewayMethod()) + .addMethod(getDeleteClientGatewayMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-beyondcorp-clientgateways/java.header b/java-beyondcorp-clientgateways/java.header new file mode 100644 index 000000000000..d0970ba7d375 --- /dev/null +++ b/java-beyondcorp-clientgateways/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-clientgateways/license-checks.xml b/java-beyondcorp-clientgateways/license-checks.xml new file mode 100644 index 000000000000..6597fced808e --- /dev/null +++ b/java-beyondcorp-clientgateways/license-checks.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/java-beyondcorp-clientgateways/owlbot.py b/java-beyondcorp-clientgateways/owlbot.py new file mode 100644 index 000000000000..77243461d730 --- /dev/null +++ b/java-beyondcorp-clientgateways/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-clientgateways/pom.xml b/java-beyondcorp-clientgateways/pom.xml new file mode 100644 index 000000000000..7b8f030b8ae0 --- /dev/null +++ b/java-beyondcorp-clientgateways/pom.xml @@ -0,0 +1,188 @@ + + + 4.0.0 + com.google.cloud + google-cloud-beyondcorp-clientgateways-parent + pom + 0.0.1-SNAPSHOT + Google BeyondCorp ClientGateways Parent + https://github.com/googleapis/java-beyondcorp-clientgateways + + 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-clientgateways.git + scm:git:git@github.com:googleapis/java-beyondcorp-clientgateways.git + https://github.com/googleapis/java-beyondcorp-clientgateways + HEAD + + + https://github.com/googleapis/java-beyondcorp-clientgateways/issues + GitHub Issues + + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + UTF-8 + UTF-8 + github + google-cloud-beyondcorp-clientgateways-parent + + + + + + com.google.cloud + google-cloud-beyondcorp-clientgateways + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-beyondcorp-clientgateways-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-beyondcorp-clientgateways-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-clientgateways + grpc-google-cloud-beyondcorp-clientgateways-v1 + proto-google-cloud-beyondcorp-clientgateways-v1 + google-cloud-beyondcorp-clientgateways-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-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/clirr-ignored-differences.xml b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..7888e93e53a0 --- /dev/null +++ b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/beyondcorp/clientgateways/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/beyondcorp/clientgateways/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/beyondcorp/clientgateways/v1/*OrBuilder + boolean has*(*) + + diff --git a/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/pom.xml b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/pom.xml new file mode 100644 index 000000000000..2f856164af2e --- /dev/null +++ b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-beyondcorp-clientgateways-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-beyondcorp-clientgateways-v1 + Proto library for google-cloud-beyondcorp-clientgateways + + com.google.cloud + google-cloud-beyondcorp-clientgateways-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-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGateway.java b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGateway.java new file mode 100644 index 000000000000..af2eb32e98de --- /dev/null +++ b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGateway.java @@ -0,0 +1,2024 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the 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/clientgateways/v1/client_gateways_service.proto + +package com.google.cloud.beyondcorp.clientgateways.v1; + +/** + * + * + *
+ * Message describing ClientGateway object.
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.clientgateways.v1.ClientGateway} + */ +public final class ClientGateway extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.clientgateways.v1.ClientGateway) + ClientGatewayOrBuilder { + private static final long serialVersionUID = 0L; + // Use ClientGateway.newBuilder() to construct. + private ClientGateway(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ClientGateway() { + name_ = ""; + state_ = 0; + id_ = ""; + clientConnectorService_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ClientGateway(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ClientGateway( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.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 32: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + id_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + clientConnectorService_ = 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.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_ClientGateway_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_ClientGateway_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.class, + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.Builder.class); + } + + /** + * + * + *
+   * Represents the different states of a gateway.
+   * 
+ * + * Protobuf enum {@code google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Gateway is being created.
+     * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + * + * + *
+     * Gateway is being updated.
+     * 
+ * + * UPDATING = 2; + */ + UPDATING(2), + /** + * + * + *
+     * Gateway is being deleted.
+     * 
+ * + * DELETING = 3; + */ + DELETING(3), + /** + * + * + *
+     * Gateway is running.
+     * 
+ * + * RUNNING = 4; + */ + RUNNING(4), + /** + * + * + *
+     * Gateway is down and may be restored in the future.
+     * This happens when CCFE sends ProjectState = OFF.
+     * 
+ * + * DOWN = 5; + */ + DOWN(5), + /** + * + * + *
+     * ClientGateway encountered an error and is in indeterministic state.
+     * 
+ * + * ERROR = 6; + */ + ERROR(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Gateway is being created.
+     * 
+ * + * CREATING = 1; + */ + public static final int CREATING_VALUE = 1; + /** + * + * + *
+     * Gateway is being updated.
+     * 
+ * + * UPDATING = 2; + */ + public static final int UPDATING_VALUE = 2; + /** + * + * + *
+     * Gateway is being deleted.
+     * 
+ * + * DELETING = 3; + */ + public static final int DELETING_VALUE = 3; + /** + * + * + *
+     * Gateway is running.
+     * 
+ * + * RUNNING = 4; + */ + public static final int RUNNING_VALUE = 4; + /** + * + * + *
+     * Gateway 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; + /** + * + * + *
+     * ClientGateway encountered an error and is in indeterministic state.
+     * 
+ * + * ERROR = 6; + */ + public static final int ERROR_VALUE = 6; + + 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 UPDATING; + case 3: + return DELETING; + case 4: + return RUNNING; + case 5: + return DOWN; + case 6: + return ERROR; + 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.clientgateways.v1.ClientGateway.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. name of resource. The name is ignored during creation.
+   * 
+ * + * 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. name of resource. The name is ignored during creation.
+   * 
+ * + * 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. [Output only] Create time stamp.
+   * 
+ * + * .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. [Output only] Create time stamp.
+   * 
+ * + * .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. [Output only] Create time stamp.
+   * 
+ * + * .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. [Output only] Update time stamp.
+   * 
+ * + * .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. [Output only] Update time stamp.
+   * 
+ * + * .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. [Output only] Update time stamp.
+   * 
+ * + * .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 STATE_FIELD_NUMBER = 4; + private int state_; + /** + * + * + *
+   * Output only. The operational state of the gateway.
+   * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State state = 4 [(.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 operational state of the gateway.
+   * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State result = + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State.valueOf(state_); + return result == null + ? com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State.UNRECOGNIZED + : result; + } + + public static final int ID_FIELD_NUMBER = 5; + private volatile java.lang.Object id_; + /** + * + * + *
+   * Output only. A unique identifier for the instance generated by the system.
+   * 
+ * + * string id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. A unique identifier for the instance generated by the system.
+   * 
+ * + * string id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_CONNECTOR_SERVICE_FIELD_NUMBER = 6; + private volatile java.lang.Object clientConnectorService_; + /** + * + * + *
+   * Output only. The client connector service name that the client gateway is
+   * associated to. Client Connector Services, named as follows:
+   *   `projects/{project_id}/locations/{location_id}/client_connector_services/{client_connector_service_id}`.
+   * 
+ * + * string client_connector_service = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The clientConnectorService. + */ + @java.lang.Override + public java.lang.String getClientConnectorService() { + java.lang.Object ref = clientConnectorService_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientConnectorService_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The client connector service name that the client gateway is
+   * associated to. Client Connector Services, named as follows:
+   *   `projects/{project_id}/locations/{location_id}/client_connector_services/{client_connector_service_id}`.
+   * 
+ * + * string client_connector_service = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for clientConnectorService. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClientConnectorServiceBytes() { + java.lang.Object ref = clientConnectorService_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientConnectorService_ = 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_); + } + if (createTime_ != null) { + output.writeMessage(2, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(3, getUpdateTime()); + } + if (state_ + != com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clientConnectorService_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, clientConnectorService_); + } + 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()); + } + if (state_ + != com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clientConnectorService_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, clientConnectorService_); + } + 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.clientgateways.v1.ClientGateway)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway other = + (com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway) 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 (state_ != other.state_) return false; + if (!getId().equals(other.getId())) return false; + if (!getClientConnectorService().equals(other.getClientConnectorService())) 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(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + CLIENT_CONNECTOR_SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getClientConnectorService().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway 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.clientgateways.v1.ClientGateway parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway 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.clientgateways.v1.ClientGateway parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway 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.clientgateways.v1.ClientGateway parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway 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.clientgateways.v1.ClientGateway parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway 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.clientgateways.v1.ClientGateway prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message describing ClientGateway object.
+   * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.clientgateways.v1.ClientGateway} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.clientgateways.v1.ClientGateway) + com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_ClientGateway_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_ClientGateway_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.class, + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.Builder.class); + } + + // Construct using com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.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; + } + state_ = 0; + + id_ = ""; + + clientConnectorService_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_ClientGateway_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway build() { + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway buildPartial() { + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway result = + new com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway(this); + 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.state_ = state_; + result.id_ = id_; + result.clientConnectorService_ = clientConnectorService_; + 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.clientgateways.v1.ClientGateway) { + return mergeFrom((com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway other) { + if (other == com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (!other.getClientConnectorService().isEmpty()) { + clientConnectorService_ = other.clientConnectorService_; + 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.clientgateways.v1.ClientGateway parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. name of resource. The name is ignored during creation.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. name of resource. The name is ignored during creation.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. name of resource. The name is ignored during creation.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. name of resource. The name is ignored during creation.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. name of resource. The name is ignored during creation.
+     * 
+ * + * 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. [Output only] Create time stamp.
+     * 
+ * + * + * .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. [Output only] Create time stamp.
+     * 
+ * + * + * .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. [Output only] Create time stamp.
+     * 
+ * + * + * .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. [Output only] Create time stamp.
+     * 
+ * + * + * .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. [Output only] Create time stamp.
+     * 
+ * + * + * .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. [Output only] Create time stamp.
+     * 
+ * + * + * .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. [Output only] Create time stamp.
+     * 
+ * + * + * .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. [Output only] Create time stamp.
+     * 
+ * + * + * .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. [Output only] Create time stamp.
+     * 
+ * + * + * .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. [Output only] Update time stamp.
+     * 
+ * + * + * .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. [Output only] Update time stamp.
+     * 
+ * + * + * .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. [Output only] Update time stamp.
+     * 
+ * + * + * .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. [Output only] Update time stamp.
+     * 
+ * + * + * .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. [Output only] Update time stamp.
+     * 
+ * + * + * .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. [Output only] Update time stamp.
+     * 
+ * + * + * .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. [Output only] Update time stamp.
+     * 
+ * + * + * .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. [Output only] Update time stamp.
+     * 
+ * + * + * .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. [Output only] Update time stamp.
+     * 
+ * + * + * .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 int state_ = 0; + /** + * + * + *
+     * Output only. The operational state of the gateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State state = 4 [(.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 operational state of the gateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State state = 4 [(.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 operational state of the gateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State result = + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State.valueOf(state_); + return result == null + ? com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The operational state of the gateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState( + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The operational state of the gateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object id_ = ""; + /** + * + * + *
+     * Output only. A unique identifier for the instance generated by the system.
+     * 
+ * + * string id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. A unique identifier for the instance generated by the system.
+     * 
+ * + * string id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. A unique identifier for the instance generated by the system.
+     * 
+ * + * string id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A unique identifier for the instance generated by the system.
+     * 
+ * + * string id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A unique identifier for the instance generated by the system.
+     * 
+ * + * string id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private java.lang.Object clientConnectorService_ = ""; + /** + * + * + *
+     * Output only. The client connector service name that the client gateway is
+     * associated to. Client Connector Services, named as follows:
+     *   `projects/{project_id}/locations/{location_id}/client_connector_services/{client_connector_service_id}`.
+     * 
+ * + * string client_connector_service = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The clientConnectorService. + */ + public java.lang.String getClientConnectorService() { + java.lang.Object ref = clientConnectorService_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientConnectorService_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The client connector service name that the client gateway is
+     * associated to. Client Connector Services, named as follows:
+     *   `projects/{project_id}/locations/{location_id}/client_connector_services/{client_connector_service_id}`.
+     * 
+ * + * string client_connector_service = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for clientConnectorService. + */ + public com.google.protobuf.ByteString getClientConnectorServiceBytes() { + java.lang.Object ref = clientConnectorService_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientConnectorService_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The client connector service name that the client gateway is
+     * associated to. Client Connector Services, named as follows:
+     *   `projects/{project_id}/locations/{location_id}/client_connector_services/{client_connector_service_id}`.
+     * 
+ * + * string client_connector_service = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The clientConnectorService to set. + * @return This builder for chaining. + */ + public Builder setClientConnectorService(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + clientConnectorService_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The client connector service name that the client gateway is
+     * associated to. Client Connector Services, named as follows:
+     *   `projects/{project_id}/locations/{location_id}/client_connector_services/{client_connector_service_id}`.
+     * 
+ * + * string client_connector_service = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearClientConnectorService() { + + clientConnectorService_ = getDefaultInstance().getClientConnectorService(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The client connector service name that the client gateway is
+     * associated to. Client Connector Services, named as follows:
+     *   `projects/{project_id}/locations/{location_id}/client_connector_services/{client_connector_service_id}`.
+     * 
+ * + * string client_connector_service = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for clientConnectorService to set. + * @return This builder for chaining. + */ + public Builder setClientConnectorServiceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + clientConnectorService_ = 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.clientgateways.v1.ClientGateway) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.clientgateways.v1.ClientGateway) + private static final com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway(); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClientGateway parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClientGateway(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.clientgateways.v1.ClientGateway getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewayName.java b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewayName.java new file mode 100644 index 000000000000..64ec94f08cf4 --- /dev/null +++ b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewayName.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.clientgateways.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 ClientGatewayName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CLIENT_GATEWAY = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/clientGateways/{client_gateway}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String clientGateway; + + @Deprecated + protected ClientGatewayName() { + project = null; + location = null; + clientGateway = null; + } + + private ClientGatewayName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + clientGateway = Preconditions.checkNotNull(builder.getClientGateway()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getClientGateway() { + return clientGateway; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ClientGatewayName of(String project, String location, String clientGateway) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setClientGateway(clientGateway) + .build(); + } + + public static String format(String project, String location, String clientGateway) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setClientGateway(clientGateway) + .build() + .toString(); + } + + public static ClientGatewayName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CLIENT_GATEWAY.validatedMatch( + formattedString, "ClientGatewayName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("client_gateway")); + } + + 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 (ClientGatewayName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CLIENT_GATEWAY.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 (clientGateway != null) { + fieldMapBuilder.put("client_gateway", clientGateway); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CLIENT_GATEWAY.instantiate( + "project", project, "location", location, "client_gateway", clientGateway); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ClientGatewayName that = ((ClientGatewayName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.clientGateway, that.clientGateway); + } + 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(clientGateway); + return h; + } + + /** Builder for projects/{project}/locations/{location}/clientGateways/{client_gateway}. */ + public static class Builder { + private String project; + private String location; + private String clientGateway; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getClientGateway() { + return clientGateway; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setClientGateway(String clientGateway) { + this.clientGateway = clientGateway; + return this; + } + + private Builder(ClientGatewayName clientGatewayName) { + this.project = clientGatewayName.project; + this.location = clientGatewayName.location; + this.clientGateway = clientGatewayName.clientGateway; + } + + public ClientGatewayName build() { + return new ClientGatewayName(this); + } + } +} diff --git a/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewayOperationMetadata.java b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewayOperationMetadata.java new file mode 100644 index 000000000000..f709baf733ab --- /dev/null +++ b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewayOperationMetadata.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/clientgateways/v1/client_gateways_service.proto + +package com.google.cloud.beyondcorp.clientgateways.v1; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata} + */ +public final class ClientGatewayOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata) + ClientGatewayOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ClientGatewayOperationMetadata.newBuilder() to construct. + private ClientGatewayOperationMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ClientGatewayOperationMetadata() { + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ClientGatewayOperationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ClientGatewayOperationMetadata( + 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.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_ClientGatewayOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_ClientGatewayOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata.class, + com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata.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 been cancelled successfully
+   * 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.clientgateways.v1.ClientGatewayOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata other = + (com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata) 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.clientgateways.v1.ClientGatewayOperationMetadata + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata + 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.clientgateways.v1.ClientGatewayOperationMetadata + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata + 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.clientgateways.v1.ClientGatewayOperationMetadata + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata + 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.clientgateways.v1.ClientGatewayOperationMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata + 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.clientgateways.v1.ClientGatewayOperationMetadata + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata + 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.clientgateways.v1.ClientGatewayOperationMetadata 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.clientgateways.v1.ClientGatewayOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata) + com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_ClientGatewayOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_ClientGatewayOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata.class, + com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata.Builder + .class); + } + + // Construct using + // com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata.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.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_ClientGatewayOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata build() { + com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata + buildPartial() { + com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata result = + new com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata(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.clientgateways.v1.ClientGatewayOperationMetadata) { + return mergeFrom( + (com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata other) { + if (other + == com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata + .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.clientgateways.v1.ClientGatewayOperationMetadata parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata) + 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 been cancelled successfully
+     * 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 been cancelled successfully
+     * 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 been cancelled successfully
+     * 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.clientgateways.v1.ClientGatewayOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata) + private static final com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata(); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClientGatewayOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClientGatewayOperationMetadata(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.clientgateways.v1.ClientGatewayOperationMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewayOperationMetadataOrBuilder.java b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewayOperationMetadataOrBuilder.java new file mode 100644 index 000000000000..418db9765541 --- /dev/null +++ b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewayOperationMetadataOrBuilder.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/clientgateways/v1/client_gateways_service.proto + +package com.google.cloud.beyondcorp.clientgateways.v1; + +public interface ClientGatewayOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata) + 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 been cancelled successfully
+   * 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-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewayOrBuilder.java b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewayOrBuilder.java new file mode 100644 index 000000000000..61311981cf17 --- /dev/null +++ b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewayOrBuilder.java @@ -0,0 +1,209 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/clientgateways/v1/client_gateways_service.proto + +package com.google.cloud.beyondcorp.clientgateways.v1; + +public interface ClientGatewayOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.clientgateways.v1.ClientGateway) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. name of resource. The name is ignored during creation.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. name of resource. The name is ignored during creation.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. [Output only] Create time stamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. [Output only] Create time stamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. [Output only] Create time stamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. [Output only] Update time stamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. [Output only] Update time stamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. [Output only] Update time stamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The operational state of the gateway.
+   * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The operational state of the gateway.
+   * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State getState(); + + /** + * + * + *
+   * Output only. A unique identifier for the instance generated by the system.
+   * 
+ * + * string id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+   * Output only. A unique identifier for the instance generated by the system.
+   * 
+ * + * string id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+   * Output only. The client connector service name that the client gateway is
+   * associated to. Client Connector Services, named as follows:
+   *   `projects/{project_id}/locations/{location_id}/client_connector_services/{client_connector_service_id}`.
+   * 
+ * + * string client_connector_service = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The clientConnectorService. + */ + java.lang.String getClientConnectorService(); + /** + * + * + *
+   * Output only. The client connector service name that the client gateway is
+   * associated to. Client Connector Services, named as follows:
+   *   `projects/{project_id}/locations/{location_id}/client_connector_services/{client_connector_service_id}`.
+   * 
+ * + * string client_connector_service = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for clientConnectorService. + */ + com.google.protobuf.ByteString getClientConnectorServiceBytes(); +} diff --git a/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewaysServiceProto.java b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewaysServiceProto.java new file mode 100644 index 000000000000..20b0d4fb93a8 --- /dev/null +++ b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ClientGatewaysServiceProto.java @@ -0,0 +1,246 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the 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/clientgateways/v1/client_gateways_service.proto + +package com.google.cloud.beyondcorp.clientgateways.v1; + +public final class ClientGatewaysServiceProto { + private ClientGatewaysServiceProto() {} + + 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_clientgateways_v1_ClientGateway_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_clientgateways_v1_ClientGateway_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_clientgateways_v1_ListClientGatewaysRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_clientgateways_v1_ListClientGatewaysRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_clientgateways_v1_ListClientGatewaysResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_clientgateways_v1_ListClientGatewaysResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_clientgateways_v1_GetClientGatewayRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_clientgateways_v1_GetClientGatewayRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_clientgateways_v1_CreateClientGatewayRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_clientgateways_v1_CreateClientGatewayRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_clientgateways_v1_DeleteClientGatewayRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_clientgateways_v1_DeleteClientGatewayRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_clientgateways_v1_ClientGatewayOperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_clientgateways_v1_ClientGatewayOperationMetadata_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/clientgateways" + + "/v1/client_gateways_service.proto\022)googl" + + "e.cloud.beyondcorp.clientgateways.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\037google/pro" + + "tobuf/timestamp.proto\"\375\003\n\rClientGateway\022" + + "\021\n\004name\030\001 \001(\tB\003\340A\002\0224\n\013create_time\030\002 \001(\0132" + + "\032.google.protobuf.TimestampB\003\340A\003\0224\n\013upda" + + "te_time\030\003 \001(\0132\032.google.protobuf.Timestam" + + "pB\003\340A\003\022R\n\005state\030\004 \001(\0162>.google.cloud.bey" + + "ondcorp.clientgateways.v1.ClientGateway." + + "StateB\003\340A\003\022\017\n\002id\030\005 \001(\tB\003\340A\003\022%\n\030client_co" + + "nnector_service\030\006 \001(\tB\003\340A\003\"j\n\005State\022\025\n\021S" + + "TATE_UNSPECIFIED\020\000\022\014\n\010CREATING\020\001\022\014\n\010UPDA" + + "TING\020\002\022\014\n\010DELETING\020\003\022\013\n\007RUNNING\020\004\022\010\n\004DOW" + + "N\020\005\022\t\n\005ERROR\020\006:u\352Ar\n\'beyondcorp.googleap" + + "is.com/ClientGateway\022Gprojects/{project}" + + "/locations/{location}/clientGateways/{cl" + + "ient_gateway}\"\271\001\n\031ListClientGatewaysRequ" + + "est\022?\n\006parent\030\001 \001(\tB/\340A\002\372A)\022\'beyondcorp." + + "googleapis.com/ClientGateway\022\026\n\tpage_siz" + + "e\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\032ListClientGatewaysResponse\022Q\n\017clie" + + "nt_gateways\030\001 \003(\01328.google.cloud.beyondc" + + "orp.clientgateways.v1.ClientGateway\022\027\n\017n" + + "ext_page_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(" + + "\t\"X\n\027GetClientGatewayRequest\022=\n\004name\030\001 \001" + + "(\tB/\340A\002\372A)\n\'beyondcorp.googleapis.com/Cl" + + "ientGateway\"\211\002\n\032CreateClientGatewayReque" + + "st\022?\n\006parent\030\001 \001(\tB/\340A\002\372A)\022\'beyondcorp.g" + + "oogleapis.com/ClientGateway\022\036\n\021client_ga" + + "teway_id\030\002 \001(\tB\003\340A\001\022U\n\016client_gateway\030\003 " + + "\001(\01328.google.cloud.beyondcorp.clientgate" + + "ways.v1.ClientGatewayB\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\"" + + "\220\001\n\032DeleteClientGatewayRequest\022=\n\004name\030\001" + + " \001(\tB/\340A\002\372A)\n\'beyondcorp.googleapis.com/" + + "ClientGateway\022\027\n\nrequest_id\030\002 \001(\tB\003\340A\001\022\032" + + "\n\rvalidate_only\030\003 \001(\010B\003\340A\001\"\215\002\n\036ClientGat" + + "ewayOperationMetadata\0224\n\013create_time\030\001 \001" + + "(\0132\032.google.protobuf.TimestampB\003\340A\003\0221\n\010e" + + "nd_time\030\002 \001(\0132\032.google.protobuf.Timestam" + + "pB\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\026r" + + "equested_cancellation\030\006 \001(\010B\003\340A\003\022\030\n\013api_" + + "version\030\007 \001(\tB\003\340A\0032\307\010\n\025ClientGatewaysSer" + + "vice\022\346\001\n\022ListClientGateways\022D.google.clo" + + "ud.beyondcorp.clientgateways.v1.ListClie" + + "ntGatewaysRequest\032E.google.cloud.beyondc" + + "orp.clientgateways.v1.ListClientGateways" + + "Response\"C\202\323\344\223\0024\0222/v1/{parent=projects/*" + + "/locations/*}/clientGateways\332A\006parent\022\323\001" + + "\n\020GetClientGateway\022B.google.cloud.beyond" + + "corp.clientgateways.v1.GetClientGatewayR" + + "equest\0328.google.cloud.beyondcorp.clientg" + + "ateways.v1.ClientGateway\"A\202\323\344\223\0024\0222/v1/{n" + + "ame=projects/*/locations/*/clientGateway" + + "s/*}\332A\004name\022\244\002\n\023CreateClientGateway\022E.go" + + "ogle.cloud.beyondcorp.clientgateways.v1." + + "CreateClientGatewayRequest\032\035.google.long" + + "running.Operation\"\246\001\202\323\344\223\002D\"2/v1/{parent=" + + "projects/*/locations/*}/clientGateways:\016" + + "client_gateway\332A\'parent,client_gateway,c" + + "lient_gateway_id\312A/\n\rClientGateway\022\036Clie" + + "ntGatewayOperationMetadata\022\370\001\n\023DeleteCli" + + "entGateway\022E.google.cloud.beyondcorp.cli" + + "entgateways.v1.DeleteClientGatewayReques" + + "t\032\035.google.longrunning.Operation\"{\202\323\344\223\0024" + + "*2/v1/{name=projects/*/locations/*/clien" + + "tGateways/*}\332A\004name\312A7\n\025google.protobuf." + + "Empty\022\036ClientGatewayOperationMetadata\032M\312" + + "A\031beyondcorp.googleapis.com\322A.https://ww" + + "w.googleapis.com/auth/cloud-platformB\256\002\n" + + "-com.google.cloud.beyondcorp.clientgatew" + + "ays.v1B\032ClientGatewaysServiceProtoP\001ZWgo" + + "ogle.golang.org/genproto/googleapis/clou" + + "d/beyondcorp/clientgateways/v1;clientgat" + + "eways\252\002)Google.Cloud.BeyondCorp.ClientGa" + + "teways.V1\312\002)Google\\Cloud\\BeyondCorp\\Clie" + + "ntGateways\\V1\352\002-Google::Cloud::BeyondCor" + + "p::ClientGateways::V1b\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.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_beyondcorp_clientgateways_v1_ClientGateway_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_beyondcorp_clientgateways_v1_ClientGateway_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_clientgateways_v1_ClientGateway_descriptor, + new java.lang.String[] { + "Name", "CreateTime", "UpdateTime", "State", "Id", "ClientConnectorService", + }); + internal_static_google_cloud_beyondcorp_clientgateways_v1_ListClientGatewaysRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_beyondcorp_clientgateways_v1_ListClientGatewaysRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_clientgateways_v1_ListClientGatewaysRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_beyondcorp_clientgateways_v1_ListClientGatewaysResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_beyondcorp_clientgateways_v1_ListClientGatewaysResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_clientgateways_v1_ListClientGatewaysResponse_descriptor, + new java.lang.String[] { + "ClientGateways", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_beyondcorp_clientgateways_v1_GetClientGatewayRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_beyondcorp_clientgateways_v1_GetClientGatewayRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_clientgateways_v1_GetClientGatewayRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_beyondcorp_clientgateways_v1_CreateClientGatewayRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_beyondcorp_clientgateways_v1_CreateClientGatewayRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_clientgateways_v1_CreateClientGatewayRequest_descriptor, + new java.lang.String[] { + "Parent", "ClientGatewayId", "ClientGateway", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_beyondcorp_clientgateways_v1_DeleteClientGatewayRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_beyondcorp_clientgateways_v1_DeleteClientGatewayRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_clientgateways_v1_DeleteClientGatewayRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_beyondcorp_clientgateways_v1_ClientGatewayOperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_beyondcorp_clientgateways_v1_ClientGatewayOperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_clientgateways_v1_ClientGatewayOperationMetadata_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.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.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/CreateClientGatewayRequest.java b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/CreateClientGatewayRequest.java new file mode 100644 index 000000000000..b54edf9a6a3e --- /dev/null +++ b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/CreateClientGatewayRequest.java @@ -0,0 +1,1520 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the 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/clientgateways/v1/client_gateways_service.proto + +package com.google.cloud.beyondcorp.clientgateways.v1; + +/** + * + * + *
+ * Message for creating a ClientGateway.
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest} + */ +public final class CreateClientGatewayRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest) + CreateClientGatewayRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateClientGatewayRequest.newBuilder() to construct. + private CreateClientGatewayRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateClientGatewayRequest() { + parent_ = ""; + clientGatewayId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateClientGatewayRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateClientGatewayRequest( + 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(); + + clientGatewayId_ = s; + break; + } + case 26: + { + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.Builder subBuilder = null; + if (clientGateway_ != null) { + subBuilder = clientGateway_.toBuilder(); + } + clientGateway_ = + input.readMessage( + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(clientGateway_); + clientGateway_ = 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.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_CreateClientGatewayRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_CreateClientGatewayRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest.class, + com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * 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. Value for parent.
+   * 
+ * + * + * 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 CLIENT_GATEWAY_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object clientGatewayId_; + /** + * + * + *
+   * Optional. User-settable client gateway 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 client_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The clientGatewayId. + */ + @java.lang.Override + public java.lang.String getClientGatewayId() { + java.lang.Object ref = clientGatewayId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientGatewayId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. User-settable client gateway 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 client_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for clientGatewayId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClientGatewayIdBytes() { + java.lang.Object ref = clientGatewayId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientGatewayId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_GATEWAY_FIELD_NUMBER = 3; + private com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway clientGateway_; + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the clientGateway field is set. + */ + @java.lang.Override + public boolean hasClientGateway() { + return clientGateway_ != null; + } + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The clientGateway. + */ + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway getClientGateway() { + return clientGateway_ == null + ? com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.getDefaultInstance() + : clientGateway_; + } + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOrBuilder + getClientGatewayOrBuilder() { + return getClientGateway(); + } + + 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(clientGatewayId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clientGatewayId_); + } + if (clientGateway_ != null) { + output.writeMessage(3, getClientGateway()); + } + 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(clientGatewayId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clientGatewayId_); + } + if (clientGateway_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getClientGateway()); + } + 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.clientgateways.v1.CreateClientGatewayRequest)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest other = + (com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getClientGatewayId().equals(other.getClientGatewayId())) return false; + if (hasClientGateway() != other.hasClientGateway()) return false; + if (hasClientGateway()) { + if (!getClientGateway().equals(other.getClientGateway())) 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) + CLIENT_GATEWAY_ID_FIELD_NUMBER; + hash = (53 * hash) + getClientGatewayId().hashCode(); + if (hasClientGateway()) { + hash = (37 * hash) + CLIENT_GATEWAY_FIELD_NUMBER; + hash = (53 * hash) + getClientGateway().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.clientgateways.v1.CreateClientGatewayRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest 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.clientgateways.v1.CreateClientGatewayRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest 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.clientgateways.v1.CreateClientGatewayRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest 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.clientgateways.v1.CreateClientGatewayRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest + 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.clientgateways.v1.CreateClientGatewayRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest 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.clientgateways.v1.CreateClientGatewayRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for creating a ClientGateway.
+   * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest) + com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_CreateClientGatewayRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_CreateClientGatewayRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest.class, + com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest.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_ = ""; + + clientGatewayId_ = ""; + + if (clientGatewayBuilder_ == null) { + clientGateway_ = null; + } else { + clientGateway_ = null; + clientGatewayBuilder_ = null; + } + requestId_ = ""; + + validateOnly_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_CreateClientGatewayRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest build() { + com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest buildPartial() { + com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest result = + new com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest(this); + result.parent_ = parent_; + result.clientGatewayId_ = clientGatewayId_; + if (clientGatewayBuilder_ == null) { + result.clientGateway_ = clientGateway_; + } else { + result.clientGateway_ = clientGatewayBuilder_.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.clientgateways.v1.CreateClientGatewayRequest) { + return mergeFrom( + (com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest other) { + if (other + == com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getClientGatewayId().isEmpty()) { + clientGatewayId_ = other.clientGatewayId_; + onChanged(); + } + if (other.hasClientGateway()) { + mergeClientGateway(other.getClientGateway()); + } + 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.clientgateways.v1.CreateClientGatewayRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * 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. Value for parent.
+     * 
+ * + * + * 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. Value for parent.
+     * 
+ * + * + * 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. Value for parent.
+     * 
+ * + * + * 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. Value for parent.
+     * 
+ * + * + * 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 clientGatewayId_ = ""; + /** + * + * + *
+     * Optional. User-settable client gateway 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 client_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The clientGatewayId. + */ + public java.lang.String getClientGatewayId() { + java.lang.Object ref = clientGatewayId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientGatewayId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. User-settable client gateway 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 client_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for clientGatewayId. + */ + public com.google.protobuf.ByteString getClientGatewayIdBytes() { + java.lang.Object ref = clientGatewayId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientGatewayId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. User-settable client gateway 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 client_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The clientGatewayId to set. + * @return This builder for chaining. + */ + public Builder setClientGatewayId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + clientGatewayId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. User-settable client gateway 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 client_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearClientGatewayId() { + + clientGatewayId_ = getDefaultInstance().getClientGatewayId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. User-settable client gateway 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 client_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for clientGatewayId to set. + * @return This builder for chaining. + */ + public Builder setClientGatewayIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + clientGatewayId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway clientGateway_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway, + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.Builder, + com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOrBuilder> + clientGatewayBuilder_; + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the clientGateway field is set. + */ + public boolean hasClientGateway() { + return clientGatewayBuilder_ != null || clientGateway_ != null; + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The clientGateway. + */ + public com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway getClientGateway() { + if (clientGatewayBuilder_ == null) { + return clientGateway_ == null + ? com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.getDefaultInstance() + : clientGateway_; + } else { + return clientGatewayBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setClientGateway( + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway value) { + if (clientGatewayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + clientGateway_ = value; + onChanged(); + } else { + clientGatewayBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setClientGateway( + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.Builder builderForValue) { + if (clientGatewayBuilder_ == null) { + clientGateway_ = builderForValue.build(); + onChanged(); + } else { + clientGatewayBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeClientGateway( + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway value) { + if (clientGatewayBuilder_ == null) { + if (clientGateway_ != null) { + clientGateway_ = + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.newBuilder(clientGateway_) + .mergeFrom(value) + .buildPartial(); + } else { + clientGateway_ = value; + } + onChanged(); + } else { + clientGatewayBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearClientGateway() { + if (clientGatewayBuilder_ == null) { + clientGateway_ = null; + onChanged(); + } else { + clientGateway_ = null; + clientGatewayBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.Builder + getClientGatewayBuilder() { + + onChanged(); + return getClientGatewayFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOrBuilder + getClientGatewayOrBuilder() { + if (clientGatewayBuilder_ != null) { + return clientGatewayBuilder_.getMessageOrBuilder(); + } else { + return clientGateway_ == null + ? com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.getDefaultInstance() + : clientGateway_; + } + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway, + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.Builder, + com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOrBuilder> + getClientGatewayFieldBuilder() { + if (clientGatewayBuilder_ == null) { + clientGatewayBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway, + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.Builder, + com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOrBuilder>( + getClientGateway(), getParentForChildren(), isClean()); + clientGateway_ = null; + } + return clientGatewayBuilder_; + } + + 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.clientgateways.v1.CreateClientGatewayRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest) + private static final com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest(); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateClientGatewayRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateClientGatewayRequest(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.clientgateways.v1.CreateClientGatewayRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/CreateClientGatewayRequestOrBuilder.java b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/CreateClientGatewayRequestOrBuilder.java new file mode 100644 index 000000000000..d835408d0f53 --- /dev/null +++ b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/CreateClientGatewayRequestOrBuilder.java @@ -0,0 +1,185 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/clientgateways/v1/client_gateways_service.proto + +package com.google.cloud.beyondcorp.clientgateways.v1; + +public interface CreateClientGatewayRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * 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 client gateway 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 client_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The clientGatewayId. + */ + java.lang.String getClientGatewayId(); + /** + * + * + *
+   * Optional. User-settable client gateway 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 client_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for clientGatewayId. + */ + com.google.protobuf.ByteString getClientGatewayIdBytes(); + + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the clientGateway field is set. + */ + boolean hasClientGateway(); + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The clientGateway. + */ + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway getClientGateway(); + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOrBuilder getClientGatewayOrBuilder(); + + /** + * + * + *
+   * 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-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/DeleteClientGatewayRequest.java b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/DeleteClientGatewayRequest.java new file mode 100644 index 000000000000..1071db850e62 --- /dev/null +++ b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/DeleteClientGatewayRequest.java @@ -0,0 +1,1012 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the 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/clientgateways/v1/client_gateways_service.proto + +package com.google.cloud.beyondcorp.clientgateways.v1; + +/** + * + * + *
+ * Message for deleting a ClientGateway
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest} + */ +public final class DeleteClientGatewayRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest) + DeleteClientGatewayRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteClientGatewayRequest.newBuilder() to construct. + private DeleteClientGatewayRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteClientGatewayRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteClientGatewayRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteClientGatewayRequest( + 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.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_DeleteClientGatewayRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_DeleteClientGatewayRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest.class, + com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.clientgateways.v1.DeleteClientGatewayRequest)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest other = + (com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest) 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.clientgateways.v1.DeleteClientGatewayRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest 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.clientgateways.v1.DeleteClientGatewayRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest 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.clientgateways.v1.DeleteClientGatewayRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest 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.clientgateways.v1.DeleteClientGatewayRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest + 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.clientgateways.v1.DeleteClientGatewayRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest 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.clientgateways.v1.DeleteClientGatewayRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for deleting a ClientGateway
+   * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest) + com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_DeleteClientGatewayRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_DeleteClientGatewayRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest.class, + com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest.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.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_DeleteClientGatewayRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest build() { + com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest buildPartial() { + com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest result = + new com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest(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.clientgateways.v1.DeleteClientGatewayRequest) { + return mergeFrom( + (com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest other) { + if (other + == com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest + .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.clientgateways.v1.DeleteClientGatewayRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + 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.clientgateways.v1.DeleteClientGatewayRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest) + private static final com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest(); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteClientGatewayRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteClientGatewayRequest(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.clientgateways.v1.DeleteClientGatewayRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/DeleteClientGatewayRequestOrBuilder.java b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/DeleteClientGatewayRequestOrBuilder.java new file mode 100644 index 000000000000..d109c96d232e --- /dev/null +++ b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/DeleteClientGatewayRequestOrBuilder.java @@ -0,0 +1,113 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the 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/clientgateways/v1/client_gateways_service.proto + +package com.google.cloud.beyondcorp.clientgateways.v1; + +public interface DeleteClientGatewayRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * 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-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/GetClientGatewayRequest.java b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/GetClientGatewayRequest.java new file mode 100644 index 000000000000..4e132fb657e5 --- /dev/null +++ b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/GetClientGatewayRequest.java @@ -0,0 +1,664 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the 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/clientgateways/v1/client_gateways_service.proto + +package com.google.cloud.beyondcorp.clientgateways.v1; + +/** + * + * + *
+ * Message for getting a ClientGateway.
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest} + */ +public final class GetClientGatewayRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest) + GetClientGatewayRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetClientGatewayRequest.newBuilder() to construct. + private GetClientGatewayRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetClientGatewayRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetClientGatewayRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetClientGatewayRequest( + 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.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_GetClientGatewayRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_GetClientGatewayRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest.class, + com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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.clientgateways.v1.GetClientGatewayRequest)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest other = + (com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest) 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.clientgateways.v1.GetClientGatewayRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest 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.clientgateways.v1.GetClientGatewayRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest 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.clientgateways.v1.GetClientGatewayRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest 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.clientgateways.v1.GetClientGatewayRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest + 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.clientgateways.v1.GetClientGatewayRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest 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.clientgateways.v1.GetClientGatewayRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for getting a ClientGateway.
+   * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest) + com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_GetClientGatewayRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_GetClientGatewayRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest.class, + com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest.Builder.class); + } + + // Construct using + // com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest.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.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_GetClientGatewayRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest build() { + com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest buildPartial() { + com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest result = + new com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest(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.clientgateways.v1.GetClientGatewayRequest) { + return mergeFrom( + (com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest other) { + if (other + == com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest + .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.clientgateways.v1.GetClientGatewayRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest) + private static final com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest(); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetClientGatewayRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetClientGatewayRequest(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.clientgateways.v1.GetClientGatewayRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/GetClientGatewayRequestOrBuilder.java b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/GetClientGatewayRequestOrBuilder.java new file mode 100644 index 000000000000..bfac164945b6 --- /dev/null +++ b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/GetClientGatewayRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/clientgateways/v1/client_gateways_service.proto + +package com.google.cloud.beyondcorp.clientgateways.v1; + +public interface GetClientGatewayRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ListClientGatewaysRequest.java b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ListClientGatewaysRequest.java new file mode 100644 index 000000000000..50703901da85 --- /dev/null +++ b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ListClientGatewaysRequest.java @@ -0,0 +1,1299 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the 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/clientgateways/v1/client_gateways_service.proto + +package com.google.cloud.beyondcorp.clientgateways.v1; + +/** + * + * + *
+ * Message for requesting list of ClientGateways.
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest} + */ +public final class ListClientGatewaysRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest) + ListClientGatewaysRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListClientGatewaysRequest.newBuilder() to construct. + private ListClientGatewaysRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListClientGatewaysRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListClientGatewaysRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListClientGatewaysRequest( + 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.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_ListClientGatewaysRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_ListClientGatewaysRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest.class, + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Parent value for ListClientGatewaysRequest.
+   * 
+ * + * + * 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. Parent value for ListClientGatewaysRequest.
+   * 
+ * + * + * 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. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * 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. A token identifying a page of results the server should return.
+   * 
+ * + * 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. A token identifying a page of results the server should return.
+   * 
+ * + * 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. Filtering results.
+   * 
+ * + * 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. Filtering results.
+   * 
+ * + * 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. Hint for how to order the results.
+   * 
+ * + * 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. Hint for how to order the results.
+   * 
+ * + * 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.clientgateways.v1.ListClientGatewaysRequest)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest other = + (com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest) 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.clientgateways.v1.ListClientGatewaysRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest 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.clientgateways.v1.ListClientGatewaysRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest 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.clientgateways.v1.ListClientGatewaysRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest 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.clientgateways.v1.ListClientGatewaysRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest + 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.clientgateways.v1.ListClientGatewaysRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest 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.clientgateways.v1.ListClientGatewaysRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for requesting list of ClientGateways.
+   * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest) + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_ListClientGatewaysRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_ListClientGatewaysRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest.class, + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest.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.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_ListClientGatewaysRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest build() { + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest buildPartial() { + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest result = + new com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest(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.clientgateways.v1.ListClientGatewaysRequest) { + return mergeFrom( + (com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest other) { + if (other + == com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest + .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.clientgateways.v1.ListClientGatewaysRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Parent value for ListClientGatewaysRequest.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Parent value for ListClientGatewaysRequest.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Parent value for ListClientGatewaysRequest.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value for ListClientGatewaysRequest.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value for ListClientGatewaysRequest.
+     * 
+ * + * + * 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. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * 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. A token identifying a page of results the server should return.
+     * 
+ * + * 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. A token identifying a page of results the server should return.
+     * 
+ * + * 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. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. Filtering results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Filtering results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Filtering results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. Hint for how to order the results.
+     * 
+ * + * 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. Hint for how to order the results.
+     * 
+ * + * 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. Hint for how to order the results.
+     * 
+ * + * 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. Hint for how to order the results.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Hint for how to order the results.
+     * 
+ * + * 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.clientgateways.v1.ListClientGatewaysRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest) + private static final com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest(); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListClientGatewaysRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListClientGatewaysRequest(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.clientgateways.v1.ListClientGatewaysRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ListClientGatewaysRequestOrBuilder.java b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ListClientGatewaysRequestOrBuilder.java new file mode 100644 index 000000000000..32aebbb76e21 --- /dev/null +++ b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ListClientGatewaysRequestOrBuilder.java @@ -0,0 +1,143 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/clientgateways/v1/client_gateways_service.proto + +package com.google.cloud.beyondcorp.clientgateways.v1; + +public interface ListClientGatewaysRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent value for ListClientGatewaysRequest.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent value for ListClientGatewaysRequest.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filtering results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filtering results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Hint for how to order the results.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Hint for how to order the results.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ListClientGatewaysResponse.java b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ListClientGatewaysResponse.java new file mode 100644 index 000000000000..0bd8d60983b6 --- /dev/null +++ b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ListClientGatewaysResponse.java @@ -0,0 +1,1475 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the 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/clientgateways/v1/client_gateways_service.proto + +package com.google.cloud.beyondcorp.clientgateways.v1; + +/** + * + * + *
+ * Message for response to listing ClientGateways.
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse} + */ +public final class ListClientGatewaysResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse) + ListClientGatewaysResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListClientGatewaysResponse.newBuilder() to construct. + private ListClientGatewaysResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListClientGatewaysResponse() { + clientGateways_ = 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 ListClientGatewaysResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListClientGatewaysResponse( + 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)) { + clientGateways_ = + new java.util.ArrayList< + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway>(); + mutable_bitField0_ |= 0x00000001; + } + clientGateways_.add( + input.readMessage( + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.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)) { + clientGateways_ = java.util.Collections.unmodifiableList(clientGateways_); + } + 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.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_ListClientGatewaysResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_ListClientGatewaysResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse.class, + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse.Builder.class); + } + + public static final int CLIENT_GATEWAYS_FIELD_NUMBER = 1; + private java.util.List + clientGateways_; + /** + * + * + *
+   * The list of ClientGateway.
+   * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + @java.lang.Override + public java.util.List + getClientGatewaysList() { + return clientGateways_; + } + /** + * + * + *
+   * The list of ClientGateway.
+   * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOrBuilder> + getClientGatewaysOrBuilderList() { + return clientGateways_; + } + /** + * + * + *
+   * The list of ClientGateway.
+   * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + @java.lang.Override + public int getClientGatewaysCount() { + return clientGateways_.size(); + } + /** + * + * + *
+   * The list of ClientGateway.
+   * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway getClientGateways(int index) { + return clientGateways_.get(index); + } + /** + * + * + *
+   * The list of ClientGateway.
+   * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOrBuilder + getClientGatewaysOrBuilder(int index) { + return clientGateways_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < clientGateways_.size(); i++) { + output.writeMessage(1, clientGateways_.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 < clientGateways_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, clientGateways_.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.clientgateways.v1.ListClientGatewaysResponse)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse other = + (com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse) obj; + + if (!getClientGatewaysList().equals(other.getClientGatewaysList())) 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 (getClientGatewaysCount() > 0) { + hash = (37 * hash) + CLIENT_GATEWAYS_FIELD_NUMBER; + hash = (53 * hash) + getClientGatewaysList().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.clientgateways.v1.ListClientGatewaysResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse 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.clientgateways.v1.ListClientGatewaysResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse 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.clientgateways.v1.ListClientGatewaysResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse 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.clientgateways.v1.ListClientGatewaysResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse + 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.clientgateways.v1.ListClientGatewaysResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse 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.clientgateways.v1.ListClientGatewaysResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for response to listing ClientGateways.
+   * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse) + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_ListClientGatewaysResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_ListClientGatewaysResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse.class, + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse.Builder + .class); + } + + // Construct using + // com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getClientGatewaysFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (clientGatewaysBuilder_ == null) { + clientGateways_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + clientGatewaysBuilder_.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.clientgateways.v1.ClientGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_clientgateways_v1_ListClientGatewaysResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse build() { + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse buildPartial() { + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse result = + new com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse(this); + int from_bitField0_ = bitField0_; + if (clientGatewaysBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + clientGateways_ = java.util.Collections.unmodifiableList(clientGateways_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.clientGateways_ = clientGateways_; + } else { + result.clientGateways_ = clientGatewaysBuilder_.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.clientgateways.v1.ListClientGatewaysResponse) { + return mergeFrom( + (com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse other) { + if (other + == com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse + .getDefaultInstance()) return this; + if (clientGatewaysBuilder_ == null) { + if (!other.clientGateways_.isEmpty()) { + if (clientGateways_.isEmpty()) { + clientGateways_ = other.clientGateways_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureClientGatewaysIsMutable(); + clientGateways_.addAll(other.clientGateways_); + } + onChanged(); + } + } else { + if (!other.clientGateways_.isEmpty()) { + if (clientGatewaysBuilder_.isEmpty()) { + clientGatewaysBuilder_.dispose(); + clientGatewaysBuilder_ = null; + clientGateways_ = other.clientGateways_; + bitField0_ = (bitField0_ & ~0x00000001); + clientGatewaysBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getClientGatewaysFieldBuilder() + : null; + } else { + clientGatewaysBuilder_.addAllMessages(other.clientGateways_); + } + } + } + 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.clientgateways.v1.ListClientGatewaysResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + clientGateways_ = java.util.Collections.emptyList(); + + private void ensureClientGatewaysIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + clientGateways_ = + new java.util.ArrayList( + clientGateways_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway, + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.Builder, + com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOrBuilder> + clientGatewaysBuilder_; + + /** + * + * + *
+     * The list of ClientGateway.
+     * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + public java.util.List + getClientGatewaysList() { + if (clientGatewaysBuilder_ == null) { + return java.util.Collections.unmodifiableList(clientGateways_); + } else { + return clientGatewaysBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of ClientGateway.
+     * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + public int getClientGatewaysCount() { + if (clientGatewaysBuilder_ == null) { + return clientGateways_.size(); + } else { + return clientGatewaysBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of ClientGateway.
+     * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + public com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway getClientGateways( + int index) { + if (clientGatewaysBuilder_ == null) { + return clientGateways_.get(index); + } else { + return clientGatewaysBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of ClientGateway.
+     * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + public Builder setClientGateways( + int index, com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway value) { + if (clientGatewaysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClientGatewaysIsMutable(); + clientGateways_.set(index, value); + onChanged(); + } else { + clientGatewaysBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of ClientGateway.
+     * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + public Builder setClientGateways( + int index, + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.Builder builderForValue) { + if (clientGatewaysBuilder_ == null) { + ensureClientGatewaysIsMutable(); + clientGateways_.set(index, builderForValue.build()); + onChanged(); + } else { + clientGatewaysBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of ClientGateway.
+     * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + public Builder addClientGateways( + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway value) { + if (clientGatewaysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClientGatewaysIsMutable(); + clientGateways_.add(value); + onChanged(); + } else { + clientGatewaysBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of ClientGateway.
+     * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + public Builder addClientGateways( + int index, com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway value) { + if (clientGatewaysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClientGatewaysIsMutable(); + clientGateways_.add(index, value); + onChanged(); + } else { + clientGatewaysBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of ClientGateway.
+     * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + public Builder addClientGateways( + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.Builder builderForValue) { + if (clientGatewaysBuilder_ == null) { + ensureClientGatewaysIsMutable(); + clientGateways_.add(builderForValue.build()); + onChanged(); + } else { + clientGatewaysBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of ClientGateway.
+     * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + public Builder addClientGateways( + int index, + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.Builder builderForValue) { + if (clientGatewaysBuilder_ == null) { + ensureClientGatewaysIsMutable(); + clientGateways_.add(index, builderForValue.build()); + onChanged(); + } else { + clientGatewaysBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of ClientGateway.
+     * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + public Builder addAllClientGateways( + java.lang.Iterable + values) { + if (clientGatewaysBuilder_ == null) { + ensureClientGatewaysIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, clientGateways_); + onChanged(); + } else { + clientGatewaysBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of ClientGateway.
+     * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + public Builder clearClientGateways() { + if (clientGatewaysBuilder_ == null) { + clientGateways_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + clientGatewaysBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of ClientGateway.
+     * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + public Builder removeClientGateways(int index) { + if (clientGatewaysBuilder_ == null) { + ensureClientGatewaysIsMutable(); + clientGateways_.remove(index); + onChanged(); + } else { + clientGatewaysBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of ClientGateway.
+     * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + public com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.Builder + getClientGatewaysBuilder(int index) { + return getClientGatewaysFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of ClientGateway.
+     * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + public com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOrBuilder + getClientGatewaysOrBuilder(int index) { + if (clientGatewaysBuilder_ == null) { + return clientGateways_.get(index); + } else { + return clientGatewaysBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of ClientGateway.
+     * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOrBuilder> + getClientGatewaysOrBuilderList() { + if (clientGatewaysBuilder_ != null) { + return clientGatewaysBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(clientGateways_); + } + } + /** + * + * + *
+     * The list of ClientGateway.
+     * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + public com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.Builder + addClientGatewaysBuilder() { + return getClientGatewaysFieldBuilder() + .addBuilder( + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.getDefaultInstance()); + } + /** + * + * + *
+     * The list of ClientGateway.
+     * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + public com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.Builder + addClientGatewaysBuilder(int index) { + return getClientGatewaysFieldBuilder() + .addBuilder( + index, + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.getDefaultInstance()); + } + /** + * + * + *
+     * The list of ClientGateway.
+     * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + public java.util.List + getClientGatewaysBuilderList() { + return getClientGatewaysFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway, + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.Builder, + com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOrBuilder> + getClientGatewaysFieldBuilder() { + if (clientGatewaysBuilder_ == null) { + clientGatewaysBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway, + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway.Builder, + com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOrBuilder>( + clientGateways_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + clientGateways_ = null; + } + return clientGatewaysBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse) + private static final com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse(); + } + + public static com.google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListClientGatewaysResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListClientGatewaysResponse(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.clientgateways.v1.ListClientGatewaysResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ListClientGatewaysResponseOrBuilder.java b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ListClientGatewaysResponseOrBuilder.java new file mode 100644 index 000000000000..b4a698c7fb50 --- /dev/null +++ b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/ListClientGatewaysResponseOrBuilder.java @@ -0,0 +1,160 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/beyondcorp/clientgateways/v1/client_gateways_service.proto + +package com.google.cloud.beyondcorp.clientgateways.v1; + +public interface ListClientGatewaysResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of ClientGateway.
+   * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + java.util.List + getClientGatewaysList(); + /** + * + * + *
+   * The list of ClientGateway.
+   * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + com.google.cloud.beyondcorp.clientgateways.v1.ClientGateway getClientGateways(int index); + /** + * + * + *
+   * The list of ClientGateway.
+   * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + int getClientGatewaysCount(); + /** + * + * + *
+   * The list of ClientGateway.
+   * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + java.util.List + getClientGatewaysOrBuilderList(); + /** + * + * + *
+   * The list of ClientGateway.
+   * 
+ * + * repeated .google.cloud.beyondcorp.clientgateways.v1.ClientGateway client_gateways = 1; + * + */ + com.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOrBuilder getClientGatewaysOrBuilder( + int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/LocationName.java b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/v1/LocationName.java new file mode 100644 index 000000000000..8c7f8619016d --- /dev/null +++ b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/java/com/google/cloud/beyondcorp/clientgateways/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.clientgateways.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-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/proto/google/cloud/beyondcorp/clientgateways/v1/client_gateways_service.proto b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/proto/google/cloud/beyondcorp/clientgateways/v1/client_gateways_service.proto new file mode 100644 index 000000000000..089fc73dd091 --- /dev/null +++ b/java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/src/main/proto/google/cloud/beyondcorp/clientgateways/v1/client_gateways_service.proto @@ -0,0 +1,296 @@ +// 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.clientgateways.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/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.BeyondCorp.ClientGateways.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/beyondcorp/clientgateways/v1;clientgateways"; +option java_multiple_files = true; +option java_outer_classname = "ClientGatewaysServiceProto"; +option java_package = "com.google.cloud.beyondcorp.clientgateways.v1"; +option php_namespace = "Google\\Cloud\\BeyondCorp\\ClientGateways\\V1"; +option ruby_package = "Google::Cloud::BeyondCorp::ClientGateways::V1"; + +// ## API Overview +// +// The `beyondcorp.googleapis.com` service implements the Google Cloud +// BeyondCorp API. +// +// ## Data Model +// +// The ClientGatewaysService exposes the following resources: +// +// * Client Gateways, named as follows: +// `projects/{project_id}/locations/{location_id}/clientGateways/{client_gateway_id}`. +service ClientGatewaysService { + option (google.api.default_host) = "beyondcorp.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists ClientGateways in a given project and location. + rpc ListClientGateways(ListClientGatewaysRequest) + returns (ListClientGatewaysResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/clientGateways" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single ClientGateway. + rpc GetClientGateway(GetClientGatewayRequest) returns (ClientGateway) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/clientGateways/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new ClientGateway in a given project and location. + rpc CreateClientGateway(CreateClientGatewayRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/clientGateways" + body: "client_gateway" + }; + option (google.api.method_signature) = + "parent,client_gateway,client_gateway_id"; + option (google.longrunning.operation_info) = { + response_type: "ClientGateway" + metadata_type: "ClientGatewayOperationMetadata" + }; + } + + // Deletes a single ClientGateway. + rpc DeleteClientGateway(DeleteClientGatewayRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/clientGateways/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "ClientGatewayOperationMetadata" + }; + } +} + +// Message describing ClientGateway object. +message ClientGateway { + option (google.api.resource) = { + type: "beyondcorp.googleapis.com/ClientGateway" + pattern: "projects/{project}/locations/{location}/clientGateways/{client_gateway}" + }; + + // Represents the different states of a gateway. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // Gateway is being created. + CREATING = 1; + + // Gateway is being updated. + UPDATING = 2; + + // Gateway is being deleted. + DELETING = 3; + + // Gateway is running. + RUNNING = 4; + + // Gateway is down and may be restored in the future. + // This happens when CCFE sends ProjectState = OFF. + DOWN = 5; + + // ClientGateway encountered an error and is in indeterministic state. + ERROR = 6; + } + + // Required. name of resource. The name is ignored during creation. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. [Output only] Create time stamp. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] Update time stamp. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The operational state of the gateway. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A unique identifier for the instance generated by the system. + string id = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The client connector service name that the client gateway is + // associated to. Client Connector Services, named as follows: + // `projects/{project_id}/locations/{location_id}/client_connector_services/{client_connector_service_id}`. + string client_connector_service = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message for requesting list of ClientGateways. +message ListClientGatewaysRequest { + // Required. Parent value for ListClientGatewaysRequest. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "beyondcorp.googleapis.com/ClientGateway" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing ClientGateways. +message ListClientGatewaysResponse { + // The list of ClientGateway. + repeated ClientGateway client_gateways = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a ClientGateway. +message GetClientGatewayRequest { + // Required. Name of the resource + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "beyondcorp.googleapis.com/ClientGateway" + } + ]; +} + +// Message for creating a ClientGateway. +message CreateClientGatewayRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "beyondcorp.googleapis.com/ClientGateway" + } + ]; + + // Optional. User-settable client gateway 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 client_gateway_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being created. + ClientGateway client_gateway = 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]; +} + +// Message for deleting a ClientGateway +message DeleteClientGatewayRequest { + // Required. Name of the resource + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "beyondcorp.googleapis.com/ClientGateway" + } + ]; + + // 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]; +} + +// Represents the metadata of the long-running operation. +message ClientGatewayOperationMetadata { + // 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 been cancelled successfully + // 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-clientgateways/renovate.json b/java-beyondcorp-clientgateways/renovate.json new file mode 100644 index 000000000000..f625719700a0 --- /dev/null +++ b/java-beyondcorp-clientgateways/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-clientgateways", + "^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-clientgateways/samples/install-without-bom/pom.xml b/java-beyondcorp-clientgateways/samples/install-without-bom/pom.xml new file mode 100644 index 000000000000..1cb6fd3fd487 --- /dev/null +++ b/java-beyondcorp-clientgateways/samples/install-without-bom/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + com.google.cloud + -install-without-bom + jar + Google BeyondCorp ClientGateways Install Without Bom + https://github.com/googleapis/java-beyondcorp-clientgateways + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + google-cloud-beyondcorp-clientgateways + 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-clientgateways/samples/pom.xml b/java-beyondcorp-clientgateways/samples/pom.xml new file mode 100644 index 000000000000..a227c84e74b6 --- /dev/null +++ b/java-beyondcorp-clientgateways/samples/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud--samples + 0.0.1-SNAPSHOT + pom + Google BeyondCorp ClientGateways Samples Parent + https://github.com/googleapis/java-beyondcorp-clientgateways + + 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-clientgateways/samples/snapshot/pom.xml b/java-beyondcorp-clientgateways/samples/snapshot/pom.xml new file mode 100644 index 000000000000..6725869b1e48 --- /dev/null +++ b/java-beyondcorp-clientgateways/samples/snapshot/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + com.google.cloud + -snapshot + jar + Google BeyondCorp ClientGateways Snapshot Samples + https://github.com/googleapis/java-beyondcorp-clientgateways + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-beyondcorp-clientgateways + 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-clientgateways/samples/snippets/pom.xml b/java-beyondcorp-clientgateways/samples/snippets/pom.xml new file mode 100644 index 000000000000..b539b6a20e2d --- /dev/null +++ b/java-beyondcorp-clientgateways/samples/snippets/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + com.google.cloud + -snippets + jar + Google BeyondCorp ClientGateways Snippets + https://github.com/googleapis/java-beyondcorp-clientgateways + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-beyondcorp-clientgateways + 0.0.0 + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.1.3 + test + + + diff --git a/java-beyondcorp-clientgateways/versions.txt b/java-beyondcorp-clientgateways/versions.txt new file mode 100644 index 000000000000..cbcd2d7ca7bb --- /dev/null +++ b/java-beyondcorp-clientgateways/versions.txt @@ -0,0 +1,6 @@ +# Format: +# module:released-version:current-version + +google-cloud-beyondcorp-clientgateways:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-beyondcorp-clientgateways-v1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-beyondcorp-clientgateways-v1:0.0.0:0.0.1-SNAPSHOT