From ed2827505d9d3da4591b5f49a4534d112d73979b Mon Sep 17 00:00:00 2001 From: Neenu1995 Date: Thu, 27 May 2021 17:03:50 -0400 Subject: [PATCH] feat: initial generation --- .github/.OwlBot.lock.yaml | 3 + .github/.OwlBot.yaml | 29 + .github/CODEOWNERS | 10 + .github/ISSUE_TEMPLATE/bug_report.md | 51 + .github/ISSUE_TEMPLATE/feature_request.md | 21 + .github/ISSUE_TEMPLATE/support_request.md | 7 + .github/PULL_REQUEST_TEMPLATE.md | 7 + .github/blunderbuss.yml | 7 + .github/generated-files-bot.yml | 12 + .github/readme/synth.py | 19 + .github/release-please.yml | 3 + .github/snippet-bot.yml | 0 .github/sync-repo-settings.yaml | 49 + .github/trusted-contribution.yml | 2 + .github/workflows/approve-readme.yaml | 54 + .github/workflows/auto-release.yaml | 88 + .github/workflows/ci.yaml | 79 + .github/workflows/samples.yaml | 14 + .gitignore | 17 + .kokoro/build.bat | 3 + .kokoro/build.sh | 125 + .kokoro/coerce_logs.sh | 38 + .kokoro/common.cfg | 13 + .kokoro/common.sh | 58 + .kokoro/continuous/common.cfg | 25 + .kokoro/continuous/java8.cfg | 12 + .kokoro/continuous/readme.cfg | 55 + .kokoro/dependencies.sh | 90 + .kokoro/nightly/common.cfg | 25 + .kokoro/nightly/integration.cfg | 37 + .kokoro/nightly/java11.cfg | 7 + .kokoro/nightly/java7.cfg | 7 + .kokoro/nightly/java8-osx.cfg | 3 + .kokoro/nightly/java8-win.cfg | 3 + .kokoro/nightly/java8.cfg | 12 + .kokoro/nightly/samples.cfg | 38 + .kokoro/populate-secrets.sh | 43 + .kokoro/presubmit/clirr.cfg | 13 + .kokoro/presubmit/common.cfg | 34 + .kokoro/presubmit/dependencies.cfg | 12 + .kokoro/presubmit/integration.cfg | 33 + .kokoro/presubmit/java11.cfg | 7 + .kokoro/presubmit/java7.cfg | 7 + .kokoro/presubmit/java8-osx.cfg | 3 + .kokoro/presubmit/java8-win.cfg | 3 + .kokoro/presubmit/java8.cfg | 12 + .kokoro/presubmit/linkage-monitor.cfg | 12 + .kokoro/presubmit/lint.cfg | 13 + .kokoro/presubmit/samples.cfg | 33 + .kokoro/readme.sh | 45 + .kokoro/release/bump_snapshot.cfg | 53 + .kokoro/release/common.cfg | 49 + .kokoro/release/common.sh | 50 + .kokoro/release/drop.cfg | 6 + .kokoro/release/drop.sh | 32 + .kokoro/release/promote.cfg | 6 + .kokoro/release/promote.sh | 34 + .kokoro/release/publish_javadoc.cfg | 23 + .kokoro/release/publish_javadoc.sh | 53 + .kokoro/release/publish_javadoc11.cfg | 30 + .kokoro/release/publish_javadoc11.sh | 67 + .kokoro/release/snapshot.cfg | 6 + .kokoro/release/snapshot.sh | 33 + .kokoro/release/stage.cfg | 19 + .kokoro/release/stage.sh | 45 + .kokoro/trampoline.sh | 26 + .repo-metadata.json | 15 + CODE_OF_CONDUCT.md | 94 + CONTRIBUTING.md | 139 + LICENSE | 201 ++ codecov.yaml | 4 + google-cloud-shell-bom/pom.xml | 85 + google-cloud-shell/pom.xml | 111 + .../shell/v1/CloudShellServiceClient.java | 627 +++++ .../shell/v1/CloudShellServiceSettings.java | 282 ++ .../google/cloud/shell/v1/gapic_metadata.json | 33 + .../google/cloud/shell/v1/package-info.java | 40 + .../shell/v1/stub/CloudShellServiceStub.java | 98 + .../stub/CloudShellServiceStubSettings.java | 592 ++++ .../GrpcCloudShellServiceCallableFactory.java | 113 + .../v1/stub/GrpcCloudShellServiceStub.java | 365 +++ .../shell/v1/CloudShellServiceClientTest.java | 396 +++ .../cloud/shell/v1/MockCloudShellService.java | 59 + .../shell/v1/MockCloudShellServiceImpl.java | 166 ++ grpc-google-cloud-shell-v1/pom.xml | 69 + .../cloud/shell/v1/CloudShellServiceGrpc.java | 887 ++++++ java.header | 15 + license-checks.xml | 10 + owlbot.py | 24 + pom.xml | 179 ++ .../clirr-ignored-differences.xml | 19 + proto-google-cloud-shell-v1/pom.xml | 46 + .../cloud/shell/v1/AddPublicKeyMetadata.java | 456 ++++ .../v1/AddPublicKeyMetadataOrBuilder.java | 24 + .../cloud/shell/v1/AddPublicKeyRequest.java | 857 ++++++ .../v1/AddPublicKeyRequestOrBuilder.java | 87 + .../cloud/shell/v1/AddPublicKeyResponse.java | 636 +++++ .../v1/AddPublicKeyResponseOrBuilder.java | 50 + .../v1/AuthorizeEnvironmentMetadata.java | 459 ++++ ...AuthorizeEnvironmentMetadataOrBuilder.java | 24 + .../shell/v1/AuthorizeEnvironmentRequest.java | 1295 +++++++++ .../AuthorizeEnvironmentRequestOrBuilder.java | 142 + .../v1/AuthorizeEnvironmentResponse.java | 459 ++++ ...AuthorizeEnvironmentResponseOrBuilder.java | 24 + .../shell/v1/CloudShellErrorDetails.java | 831 ++++++ .../v1/CloudShellErrorDetailsOrBuilder.java | 50 + .../cloud/shell/v1/CloudShellProto.java | 352 +++ .../shell/v1/CreateEnvironmentMetadata.java | 458 ++++ .../CreateEnvironmentMetadataOrBuilder.java | 24 + .../shell/v1/DeleteEnvironmentMetadata.java | 458 ++++ .../DeleteEnvironmentMetadataOrBuilder.java | 24 + .../google/cloud/shell/v1/Environment.java | 2409 +++++++++++++++++ .../cloud/shell/v1/EnvironmentName.java | 192 ++ .../cloud/shell/v1/EnvironmentOrBuilder.java | 307 +++ .../cloud/shell/v1/GetEnvironmentRequest.java | 658 +++++ .../v1/GetEnvironmentRequestOrBuilder.java | 56 + .../shell/v1/RemovePublicKeyMetadata.java | 458 ++++ .../v1/RemovePublicKeyMetadataOrBuilder.java | 24 + .../shell/v1/RemovePublicKeyRequest.java | 823 ++++++ .../v1/RemovePublicKeyRequestOrBuilder.java | 77 + .../shell/v1/RemovePublicKeyResponse.java | 458 ++++ .../v1/RemovePublicKeyResponseOrBuilder.java | 24 + .../shell/v1/StartEnvironmentMetadata.java | 838 ++++++ .../v1/StartEnvironmentMetadataOrBuilder.java | 50 + .../shell/v1/StartEnvironmentRequest.java | 1132 ++++++++ .../v1/StartEnvironmentRequestOrBuilder.java | 136 + .../shell/v1/StartEnvironmentResponse.java | 737 +++++ .../v1/StartEnvironmentResponseOrBuilder.java | 60 + .../google/cloud/shell/v1/cloudshell.proto | 388 +++ renovate.json | 73 + samples/install-without-bom/pom.xml | 84 + samples/pom.xml | 56 + samples/snapshot/pom.xml | 83 + samples/snippets/pom.xml | 47 + versions.txt | 6 + 135 files changed, 22380 insertions(+) create mode 100644 .github/.OwlBot.lock.yaml create mode 100644 .github/.OwlBot.yaml create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/support_request.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/blunderbuss.yml create mode 100644 .github/generated-files-bot.yml create mode 100644 .github/readme/synth.py create mode 100644 .github/release-please.yml create mode 100644 .github/snippet-bot.yml create mode 100644 .github/sync-repo-settings.yaml create mode 100644 .github/trusted-contribution.yml create mode 100644 .github/workflows/approve-readme.yaml create mode 100644 .github/workflows/auto-release.yaml create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/samples.yaml create mode 100644 .gitignore create mode 100644 .kokoro/build.bat create mode 100755 .kokoro/build.sh create mode 100755 .kokoro/coerce_logs.sh create mode 100644 .kokoro/common.cfg create mode 100644 .kokoro/common.sh create mode 100644 .kokoro/continuous/common.cfg create mode 100644 .kokoro/continuous/java8.cfg create mode 100644 .kokoro/continuous/readme.cfg create mode 100755 .kokoro/dependencies.sh create mode 100644 .kokoro/nightly/common.cfg create mode 100644 .kokoro/nightly/integration.cfg create mode 100644 .kokoro/nightly/java11.cfg create mode 100644 .kokoro/nightly/java7.cfg create mode 100644 .kokoro/nightly/java8-osx.cfg create mode 100644 .kokoro/nightly/java8-win.cfg create mode 100644 .kokoro/nightly/java8.cfg create mode 100644 .kokoro/nightly/samples.cfg create mode 100755 .kokoro/populate-secrets.sh create mode 100644 .kokoro/presubmit/clirr.cfg create mode 100644 .kokoro/presubmit/common.cfg create mode 100644 .kokoro/presubmit/dependencies.cfg create mode 100644 .kokoro/presubmit/integration.cfg create mode 100644 .kokoro/presubmit/java11.cfg create mode 100644 .kokoro/presubmit/java7.cfg create mode 100644 .kokoro/presubmit/java8-osx.cfg create mode 100644 .kokoro/presubmit/java8-win.cfg create mode 100644 .kokoro/presubmit/java8.cfg create mode 100644 .kokoro/presubmit/linkage-monitor.cfg create mode 100644 .kokoro/presubmit/lint.cfg create mode 100644 .kokoro/presubmit/samples.cfg create mode 100755 .kokoro/readme.sh create mode 100644 .kokoro/release/bump_snapshot.cfg create mode 100644 .kokoro/release/common.cfg create mode 100755 .kokoro/release/common.sh create mode 100644 .kokoro/release/drop.cfg create mode 100755 .kokoro/release/drop.sh create mode 100644 .kokoro/release/promote.cfg create mode 100755 .kokoro/release/promote.sh create mode 100644 .kokoro/release/publish_javadoc.cfg create mode 100755 .kokoro/release/publish_javadoc.sh create mode 100644 .kokoro/release/publish_javadoc11.cfg create mode 100755 .kokoro/release/publish_javadoc11.sh create mode 100644 .kokoro/release/snapshot.cfg create mode 100755 .kokoro/release/snapshot.sh create mode 100644 .kokoro/release/stage.cfg create mode 100755 .kokoro/release/stage.sh create mode 100644 .kokoro/trampoline.sh create mode 100644 .repo-metadata.json create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 codecov.yaml create mode 100644 google-cloud-shell-bom/pom.xml create mode 100644 google-cloud-shell/pom.xml create mode 100644 google-cloud-shell/src/main/java/com/google/cloud/shell/v1/CloudShellServiceClient.java create mode 100644 google-cloud-shell/src/main/java/com/google/cloud/shell/v1/CloudShellServiceSettings.java create mode 100644 google-cloud-shell/src/main/java/com/google/cloud/shell/v1/gapic_metadata.json create mode 100644 google-cloud-shell/src/main/java/com/google/cloud/shell/v1/package-info.java create mode 100644 google-cloud-shell/src/main/java/com/google/cloud/shell/v1/stub/CloudShellServiceStub.java create mode 100644 google-cloud-shell/src/main/java/com/google/cloud/shell/v1/stub/CloudShellServiceStubSettings.java create mode 100644 google-cloud-shell/src/main/java/com/google/cloud/shell/v1/stub/GrpcCloudShellServiceCallableFactory.java create mode 100644 google-cloud-shell/src/main/java/com/google/cloud/shell/v1/stub/GrpcCloudShellServiceStub.java create mode 100644 google-cloud-shell/src/test/java/com/google/cloud/shell/v1/CloudShellServiceClientTest.java create mode 100644 google-cloud-shell/src/test/java/com/google/cloud/shell/v1/MockCloudShellService.java create mode 100644 google-cloud-shell/src/test/java/com/google/cloud/shell/v1/MockCloudShellServiceImpl.java create mode 100644 grpc-google-cloud-shell-v1/pom.xml create mode 100644 grpc-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CloudShellServiceGrpc.java create mode 100644 java.header create mode 100644 license-checks.xml create mode 100644 owlbot.py create mode 100644 pom.xml create mode 100644 proto-google-cloud-shell-v1/clirr-ignored-differences.xml create mode 100644 proto-google-cloud-shell-v1/pom.xml create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyMetadata.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyMetadataOrBuilder.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyRequest.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyRequestOrBuilder.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyResponse.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyResponseOrBuilder.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentMetadata.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentMetadataOrBuilder.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentRequest.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentRequestOrBuilder.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentResponse.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentResponseOrBuilder.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CloudShellErrorDetails.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CloudShellErrorDetailsOrBuilder.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CloudShellProto.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CreateEnvironmentMetadata.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CreateEnvironmentMetadataOrBuilder.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/DeleteEnvironmentMetadata.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/DeleteEnvironmentMetadataOrBuilder.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/Environment.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/EnvironmentName.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/EnvironmentOrBuilder.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/GetEnvironmentRequest.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/GetEnvironmentRequestOrBuilder.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyMetadata.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyMetadataOrBuilder.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyRequest.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyRequestOrBuilder.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyResponse.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyResponseOrBuilder.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentMetadata.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentMetadataOrBuilder.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentRequest.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentRequestOrBuilder.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentResponse.java create mode 100644 proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentResponseOrBuilder.java create mode 100644 proto-google-cloud-shell-v1/src/main/proto/google/cloud/shell/v1/cloudshell.proto create mode 100644 renovate.json create mode 100644 samples/install-without-bom/pom.xml create mode 100644 samples/pom.xml create mode 100644 samples/snapshot/pom.xml create mode 100644 samples/snippets/pom.xml create mode 100644 versions.txt diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml new file mode 100644 index 00000000..a32a9e04 --- /dev/null +++ b/.github/.OwlBot.lock.yaml @@ -0,0 +1,3 @@ +docker: + digest: sha256:ee698481139bf3df35cd83d2f17f9670ee914d6184f8909a81d672a6abaf0e72 + image: gcr.io/repo-automation-bots/owlbot-java:latest \ No newline at end of file diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml new file mode 100644 index 00000000..e9bb0c13 --- /dev/null +++ b/.github/.OwlBot.yaml @@ -0,0 +1,29 @@ +# 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/repo-automation-bots/owlbot-java:latest" + +deep-remove-regex: +- "/grpc-google-.*/src" +- "/proto-google-.*/src" +- "/google-.*/src" + +deep-copy-regex: +- source: "/google/cloud/shell/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/$1/proto-google-cloud-shell-$1/src" +- source: "/google/cloud/shell/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/$1/grpc-google-cloud-shell-$1/src" +- source: "/google/cloud/shell/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/$1/google-cloud-shell/src" \ No newline at end of file diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..30fdb7b9 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,10 @@ +# Code owners file. +# This file controls who is tagged for review for any given pull request. + +# For syntax help see: +# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax + +* @googleapis/yoshi-java + +# The java-samples-reviewers team is the default owner for samples changes +samples/**/*.java @googleapis/java-samples-reviewers diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..61edb854 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,51 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. + +Please run down the following list and make sure you've tried the usual "quick fixes": + + - Search the issues already opened: https://github.com/googleapis/java-shell/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. shell version(s): + +#### Steps to reproduce + + 1. ? + 2. ? + +#### Code example + +```java +// example +``` + +#### Stack trace +``` +Any relevant stacktrace here. +``` + +#### External references such as API reference guides + +- ? + +#### Any additional information below + + +Following these steps guarantees the quickest resolution possible. + +Thanks! diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..754e30c6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,21 @@ +--- +name: Feature request +about: Suggest an idea for this library + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. + +**Is your feature request related to a problem? Please describe.** +What the problem is. Example: I'm always frustrated when [...] + +**Describe the solution you'd like** +What you want to happen. + +**Describe alternatives you've considered** +Any alternative solutions or features you've considered. + +**Additional context** +Any other context or screenshots about the feature request. diff --git a/.github/ISSUE_TEMPLATE/support_request.md b/.github/ISSUE_TEMPLATE/support_request.md new file mode 100644 index 00000000..99586903 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/support_request.md @@ -0,0 +1,7 @@ +--- +name: Support request +about: If you have a support contract with Google, please create an issue in the Google Cloud Support console. + +--- + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..a021bb58 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,7 @@ +Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: +- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-shell/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea +- [ ] Ensure the tests and linter pass +- [ ] Code coverage does not decrease (if any source code was changed) +- [ ] Appropriate docs were updated (if necessary) + +Fixes # ☕️ diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml new file mode 100644 index 00000000..1a23ea42 --- /dev/null +++ b/.github/blunderbuss.yml @@ -0,0 +1,7 @@ +# Configuration for the Blunderbuss GitHub app. For more info see +# https://github.com/googleapis/repo-automation-bots/tree/master/packages/blunderbuss +assign_prs_by: +- labels: + - samples + to: + - googleapis/java-samples-reviewers \ No newline at end of file diff --git a/.github/generated-files-bot.yml b/.github/generated-files-bot.yml new file mode 100644 index 00000000..c644a24e --- /dev/null +++ b/.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/.github/readme/synth.py b/.github/readme/synth.py new file mode 100644 index 00000000..7b48cc28 --- /dev/null +++ b/.github/readme/synth.py @@ -0,0 +1,19 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""This script is used to synthesize generated the README for this library.""" + +from synthtool.languages import java + +java.custom_templates(["java_library/README.md"]) diff --git a/.github/release-please.yml b/.github/release-please.yml new file mode 100644 index 00000000..8ca7f9ca --- /dev/null +++ b/.github/release-please.yml @@ -0,0 +1,3 @@ +bumpMinorPreMajor: true +handleGHRelease: true +releaseType: java-yoshi diff --git a/.github/snippet-bot.yml b/.github/snippet-bot.yml new file mode 100644 index 00000000..e69de29b diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml new file mode 100644 index 00000000..e100454f --- /dev/null +++ b/.github/sync-repo-settings.yaml @@ -0,0 +1,49 @@ + +# 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 master branch protection +branchProtectionRules: +# Identifies the protection rule pattern. Name of the branch to be protected. +# Defaults to `master` +- pattern: master + # 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 (8)" + - "dependencies (11)" + - "linkage-monitor" + - "lint" + - "clirr" + - "units (7)" + - "units (8)" + - "units (11)" + - "Kokoro - Test: Integration" + - "cla/google" +# 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 diff --git a/.github/trusted-contribution.yml b/.github/trusted-contribution.yml new file mode 100644 index 00000000..f247d5c7 --- /dev/null +++ b/.github/trusted-contribution.yml @@ -0,0 +1,2 @@ +trustedContributors: +- renovate-bot \ No newline at end of file diff --git a/.github/workflows/approve-readme.yaml b/.github/workflows/approve-readme.yaml new file mode 100644 index 00000000..7513acae --- /dev/null +++ b/.github/workflows/approve-readme.yaml @@ -0,0 +1,54 @@ +on: + pull_request: +name: auto-merge-readme +jobs: + approve: + runs-on: ubuntu-latest + if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme' + steps: + - uses: actions/github-script@v3 + with: + github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} + script: | + // only approve PRs from yoshi-automation + if (context.payload.pull_request.user.login !== "yoshi-automation") { + return; + } + + // only approve PRs like "chore: release " + if (!context.payload.pull_request.title === "chore: regenerate README") { + return; + } + + // only approve PRs with README.md and synth.metadata changes + const files = new Set( + ( + await github.paginate( + github.pulls.listFiles.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + }) + ) + ).map(file => file.filename) + ); + if (files.size != 2 || !files.has("README.md") || !files.has(".github/readme/synth.metadata/synth.metadata")) { + return; + } + + // approve README regeneration PR + await github.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Rubber stamped PR!', + pull_number: context.payload.pull_request.number, + event: 'APPROVE' + }); + + // attach automerge label + await github.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: ['automerge'] + }); diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml new file mode 100644 index 00000000..9b4fd4d8 --- /dev/null +++ b/.github/workflows/auto-release.yaml @@ -0,0 +1,88 @@ +on: + pull_request: +name: auto-release +jobs: + approve: + runs-on: ubuntu-latest + if: contains(github.head_ref, 'release-please') + steps: + - uses: actions/github-script@v3 + with: + github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} + debug: true + script: | + // only approve PRs from release-please[bot] + if (context.payload.pull_request.user.login !== "release-please[bot]") { + return; + } + + // only approve PRs like "chore: release " + if ( !context.payload.pull_request.title.startsWith("chore: release") ) { + return; + } + + // only approve PRs with pom.xml and versions.txt changes + const filesPromise = github.pulls.listFiles.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + }); + const changed_files = await github.paginate(filesPromise) + + if ( changed_files.length < 1 ) { + console.log( "Not proceeding since PR is empty!" ) + return; + } + + if ( !changed_files.some(v => v.filename.includes("pom")) || !changed_files.some(v => v.filename.includes("versions.txt")) ) { + console.log( "PR file changes do not have pom.xml or versions.txt -- something is wrong. PTAL!" ) + return; + } + + // trigger auto-release when + // 1) it is a SNAPSHOT release (auto-generated post regular release) + // 2) there are dependency updates only + // 3) there are no open dependency update PRs in this repo (to avoid multiple releases) + if ( + context.payload.pull_request.body.includes("Fix") || + context.payload.pull_request.body.includes("Build") || + context.payload.pull_request.body.includes("Documentation") || + context.payload.pull_request.body.includes("BREAKING CHANGES") || + context.payload.pull_request.body.includes("Features") + ) { + console.log( "Not auto-releasing since it is not a dependency-update-only release." ); + return; + } + + const promise = github.pulls.list.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open' + }); + const open_pulls = await github.paginate(promise) + + if ( open_pulls.length > 1 && !context.payload.pull_request.title.includes("SNAPSHOT") ) { + for ( const pull of open_pulls ) { + if ( pull.title.startsWith("deps: update dependency") ) { + console.log( "Not auto-releasing yet since there are dependency update PRs open in this repo." ); + return; + } + } + } + + // approve release PR + await github.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Rubber stamped release!', + pull_number: context.payload.pull_request.number, + event: 'APPROVE' + }); + + // attach kokoro:force-run and automerge labels + await github.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: ['kokoro:force-run', 'automerge'] + }); diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..0195b32f --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,79 @@ +on: + push: + branches: + - master + pull_request: +name: ci +jobs: + units: + runs-on: ubuntu-latest + strategy: + matrix: + java: [7, 8, 11] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: test + windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.bat + env: + JOB_TYPE: test + dependencies: + runs-on: ubuntu-latest + strategy: + matrix: + java: [8, 11] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/dependencies.sh + linkage-monitor: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - name: Install artifacts to local Maven repository + run: .kokoro/build.sh + shell: bash + - name: Validate any conflicts with regard to com.google.cloud:libraries-bom (latest release) + uses: GoogleCloudPlatform/cloud-opensource-java/linkage-monitor@v1-linkagemonitor + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: lint + clirr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: clirr diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml new file mode 100644 index 00000000..c46230a7 --- /dev/null +++ b/.github/workflows/samples.yaml @@ -0,0 +1,14 @@ +on: + pull_request: +name: samples +jobs: + checkstyle: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - name: Run checkstyle + run: mvn -P lint --quiet --batch-mode checkstyle:check + working-directory: samples/snippets diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..069d08fc --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +# Maven +target/ + +# Eclipse +.classpath +.project +.settings + +# Intellij +*.iml +.idea/ + +# python utilities +*.pyc +__pycache__ + +.flattened-pom.xml diff --git a/.kokoro/build.bat b/.kokoro/build.bat new file mode 100644 index 00000000..05826ad9 --- /dev/null +++ b/.kokoro/build.bat @@ -0,0 +1,3 @@ +:: See documentation in type-shell-output.bat + +"C:\Program Files\Git\bin\bash.exe" %~dp0build.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh new file mode 100755 index 00000000..635fd6e2 --- /dev/null +++ b/.kokoro/build.sh @@ -0,0 +1,125 @@ +#!/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 -Dclirr.skip=true -Denforcer.skip=true + RETURN_CODE=$? + ;; +lint) + mvn com.coveo:fmt-maven-plugin:check + RETURN_CODE=$? + ;; +javadoc) + mvn javadoc:javadoc javadoc:test-javadoc + RETURN_CODE=$? + ;; +integration) + mvn -B ${INTEGRATION_TEST_ARGS} \ + -ntp \ + -Penable-integration-tests \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + ;; +samples) + SAMPLES_DIR=samples + # only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise. + if [[ ! -z ${KOKORO_GITHUB_PULL_REQUEST_NUMBER} ]] + then + SAMPLES_DIR=samples/snapshot + fi + + if [[ -f ${SAMPLES_DIR}/pom.xml ]] + then + for FILE in ${KOKORO_GFILE_DIR}/secret_manager/*-samples-secrets; do + [[ -f "$FILE" ]] || continue + source "$FILE" + done + + pushd ${SAMPLES_DIR} + mvn -B \ + -Penable-samples \ + -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 -Denforcer.skip=true clirr:check + RETURN_CODE=$? + ;; +*) + ;; +esac + +if [ "${REPORT_COVERAGE}" == "true" ] +then + bash ${KOKORO_GFILE_DIR}/codecov.sh +fi + +# fix output location of logs +bash .kokoro/coerce_logs.sh + +if [[ "${ENABLE_BUILD_COP}" == "true" ]] +then + chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot + ${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-shell +fi + +echo "exiting with ${RETURN_CODE}" +exit ${RETURN_CODE} diff --git a/.kokoro/coerce_logs.sh b/.kokoro/coerce_logs.sh new file mode 100755 index 00000000..5cf7ba49 --- /dev/null +++ b/.kokoro/coerce_logs.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This script finds and moves sponge logs so that they can be found by placer +# and are not flagged as flaky by sponge. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +job=$(basename ${KOKORO_JOB_NAME}) + +echo "coercing sponge logs..." +for xml in `find . -name *-sponge_log.xml` +do + echo "processing ${xml}" + class=$(basename ${xml} | cut -d- -f2) + dir=$(dirname ${xml})/${job}/${class} + text=$(dirname ${xml})/${class}-sponge_log.txt + mkdir -p ${dir} + mv ${xml} ${dir}/sponge_log.xml + mv ${text} ${dir}/sponge_log.txt +done diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg new file mode 100644 index 00000000..87c5a62b --- /dev/null +++ b/.kokoro/common.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# All builds use the trampoline script to run in docker. +build_file: "java-shell/.kokoro/trampoline.sh" + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-shell/.kokoro/build.sh" +} diff --git a/.kokoro/common.sh b/.kokoro/common.sh new file mode 100644 index 00000000..ace89f45 --- /dev/null +++ b/.kokoro/common.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +function retry_with_backoff { + attempts_left=$1 + sleep_seconds=$2 + shift 2 + command=$@ + + + # store current flag state + flags=$- + + # allow a failures to continue + set +e + ${command} + exit_code=$? + + # restore "e" flag + if [[ ${flags} =~ e ]] + then set -e + else set +e + fi + + if [[ $exit_code == 0 ]] + then + return 0 + fi + + # failure + if [[ ${attempts_left} > 0 ]] + then + echo "failure (${exit_code}), sleeping ${sleep_seconds}..." + sleep ${sleep_seconds} + new_attempts=$((${attempts_left} - 1)) + new_sleep=$((${sleep_seconds} * 2)) + retry_with_backoff ${new_attempts} ${new_sleep} ${command} + fi + + return $exit_code +} + +## Helper functionss +function now() { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n'; } +function msg() { println "$*" >&2; } +function println() { printf '%s\n' "$(now) $*"; } \ No newline at end of file diff --git a/.kokoro/continuous/common.cfg b/.kokoro/continuous/common.cfg new file mode 100644 index 00000000..8b99a15c --- /dev/null +++ b/.kokoro/continuous/common.cfg @@ -0,0 +1,25 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-shell/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-shell/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/continuous/java8.cfg b/.kokoro/continuous/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/continuous/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/continuous/readme.cfg b/.kokoro/continuous/readme.cfg new file mode 100644 index 00000000..bf91ae42 --- /dev/null +++ b/.kokoro/continuous/readme.cfg @@ -0,0 +1,55 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-shell/.kokoro/readme.sh" +} + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.log" + } +} + +# The github token is stored here. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "yoshi-automation-github-key" + # TODO(theacodes): remove this after secrets have globally propagated + backend_type: FASTCONFIGPUSH + } + } +} + +# Common env vars for all repositories and builds. +env_vars: { + key: "GITHUB_USER" + value: "yoshi-automation" +} +env_vars: { + key: "GITHUB_EMAIL" + value: "yoshi-automation@google.com" +} diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh new file mode 100755 index 00000000..59d2aafc --- /dev/null +++ b/.kokoro/dependencies.sh @@ -0,0 +1,90 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Java +java -version +echo $JOB_TYPE + +export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" + +# this should run maven enforcer +retry_with_backoff 3 10 \ + mvn install -B -V -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/\\s--\\smodule.*// >.org-list.txt + + # Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes) + msg "Generating dependency list using flattened pom..." + mvn dependency:list -f .flattened-pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt + + # Compare two dependency lists + msg "Comparing dependency lists..." + diff .org-list.txt .new-list.txt >.diff.txt + if [[ $? == 0 ]] + then + msg "Success. No diff!" + else + msg "Diff found. See below: " + msg "You can also check .diff.txt file located in $1." + cat .diff.txt + return 1 + fi +} + +# Allow failures to continue running the script +set +e + +error_count=0 +for path in $(find -name ".flattened-pom.xml") +do + # Check flattened pom in each dir that contains it for completeness + dir=$(dirname "$path") + pushd "$dir" + completenessCheck "$dir" + error_count=$(($error_count + $?)) + popd +done + +if [[ $error_count == 0 ]] +then + msg "All checks passed." + exit 0 +else + msg "Errors found. See log statements above." + exit 1 +fi diff --git a/.kokoro/nightly/common.cfg b/.kokoro/nightly/common.cfg new file mode 100644 index 00000000..8b99a15c --- /dev/null +++ b/.kokoro/nightly/common.cfg @@ -0,0 +1,25 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-shell/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-shell/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg new file mode 100644 index 00000000..0048c8ec --- /dev/null +++ b/.kokoro/nightly/integration.cfg @@ -0,0 +1,37 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/.kokoro/nightly/java11.cfg b/.kokoro/nightly/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/nightly/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/.kokoro/nightly/java7.cfg b/.kokoro/nightly/java7.cfg new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/nightly/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/.kokoro/nightly/java8-osx.cfg b/.kokoro/nightly/java8-osx.cfg new file mode 100644 index 00000000..fa6a3104 --- /dev/null +++ b/.kokoro/nightly/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-shell/.kokoro/build.sh" diff --git a/.kokoro/nightly/java8-win.cfg b/.kokoro/nightly/java8-win.cfg new file mode 100644 index 00000000..a72bb528 --- /dev/null +++ b/.kokoro/nightly/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-shell/.kokoro/build.bat" diff --git a/.kokoro/nightly/java8.cfg b/.kokoro/nightly/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/nightly/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/nightly/samples.cfg b/.kokoro/nightly/samples.cfg new file mode 100644 index 00000000..f2542931 --- /dev/null +++ b/.kokoro/nightly/samples.cfg @@ -0,0 +1,38 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-docs-samples-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-docs-samples-service-account" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} diff --git a/.kokoro/populate-secrets.sh b/.kokoro/populate-secrets.sh new file mode 100755 index 00000000..f5251425 --- /dev/null +++ b/.kokoro/populate-secrets.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# Copyright 2020 Google LLC. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;} +function msg { println "$*" >&2 ;} +function println { printf '%s\n' "$(now) $*" ;} + + +# Populates requested secrets set in SECRET_MANAGER_KEYS from service account: +# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com +SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager" +msg "Creating folder on disk for secrets: ${SECRET_LOCATION}" +mkdir -p ${SECRET_LOCATION} +for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g") +do + msg "Retrieving secret ${key}" + docker run --entrypoint=gcloud \ + --volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \ + gcr.io/google.com/cloudsdktool/cloud-sdk \ + secrets versions access latest \ + --project cloud-devrel-kokoro-resources \ + --secret ${key} > \ + "${SECRET_LOCATION}/${key}" + if [[ $? == 0 ]]; then + msg "Secret written to ${SECRET_LOCATION}/${key}" + else + msg "Error retrieving secret ${key}" + fi +done diff --git a/.kokoro/presubmit/clirr.cfg b/.kokoro/presubmit/clirr.cfg new file mode 100644 index 00000000..ec572442 --- /dev/null +++ b/.kokoro/presubmit/clirr.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "clirr" +} \ No newline at end of file diff --git a/.kokoro/presubmit/common.cfg b/.kokoro/presubmit/common.cfg new file mode 100644 index 00000000..d16e089e --- /dev/null +++ b/.kokoro/presubmit/common.cfg @@ -0,0 +1,34 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-shell/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-shell/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "dpebot_codecov_token" + } + } +} diff --git a/.kokoro/presubmit/dependencies.cfg b/.kokoro/presubmit/dependencies.cfg new file mode 100644 index 00000000..2987cf2b --- /dev/null +++ b/.kokoro/presubmit/dependencies.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-shell/.kokoro/dependencies.sh" +} diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg new file mode 100644 index 00000000..dded67a9 --- /dev/null +++ b/.kokoro/presubmit/integration.cfg @@ -0,0 +1,33 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/.kokoro/presubmit/java11.cfg b/.kokoro/presubmit/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/presubmit/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/.kokoro/presubmit/java7.cfg b/.kokoro/presubmit/java7.cfg new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/presubmit/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/.kokoro/presubmit/java8-osx.cfg b/.kokoro/presubmit/java8-osx.cfg new file mode 100644 index 00000000..fa6a3104 --- /dev/null +++ b/.kokoro/presubmit/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-shell/.kokoro/build.sh" diff --git a/.kokoro/presubmit/java8-win.cfg b/.kokoro/presubmit/java8-win.cfg new file mode 100644 index 00000000..a72bb528 --- /dev/null +++ b/.kokoro/presubmit/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-shell/.kokoro/build.bat" diff --git a/.kokoro/presubmit/java8.cfg b/.kokoro/presubmit/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/presubmit/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/presubmit/linkage-monitor.cfg b/.kokoro/presubmit/linkage-monitor.cfg new file mode 100644 index 00000000..debdfe7b --- /dev/null +++ b/.kokoro/presubmit/linkage-monitor.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-shell/.kokoro/linkage-monitor.sh" +} \ No newline at end of file diff --git a/.kokoro/presubmit/lint.cfg b/.kokoro/presubmit/lint.cfg new file mode 100644 index 00000000..6d323c8a --- /dev/null +++ b/.kokoro/presubmit/lint.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "lint" +} \ No newline at end of file diff --git a/.kokoro/presubmit/samples.cfg b/.kokoro/presubmit/samples.cfg new file mode 100644 index 00000000..01e09600 --- /dev/null +++ b/.kokoro/presubmit/samples.cfg @@ -0,0 +1,33 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-docs-samples-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-docs-samples-service-account" +} \ No newline at end of file diff --git a/.kokoro/readme.sh b/.kokoro/readme.sh new file mode 100755 index 00000000..09f390cd --- /dev/null +++ b/.kokoro/readme.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +cd ${KOKORO_ARTIFACTS_DIR}/github/java-shell + +# 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-shell \ + --synth-file-name=.github/readme/synth.py \ + --metadata-path=.github/readme/synth.metadata \ + --pr-title="chore: regenerate README" \ + --branch-suffix="readme" + +# autosynth returns 28 to signal there are no changes +RETURN_CODE=$? +if [[ ${RETURN_CODE} -ne 0 && ${RETURN_CODE} -ne 28 ]] +then + exit ${RETURN_CODE} +fi diff --git a/.kokoro/release/bump_snapshot.cfg b/.kokoro/release/bump_snapshot.cfg new file mode 100644 index 00000000..f853a27f --- /dev/null +++ b/.kokoro/release/bump_snapshot.cfg @@ -0,0 +1,53 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-shell/.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-shell/.kokoro/release/bump_snapshot.sh" +} + +# tokens used by release-please to keep an up-to-date release PR. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-key-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-token-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-url-release-please" + } + } +} diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg new file mode 100644 index 00000000..f086736a --- /dev/null +++ b/.kokoro/release/common.cfg @@ -0,0 +1,49 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-shell/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-keyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-passphrase" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-pubkeyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "sonatype-credentials" + } + } +} diff --git a/.kokoro/release/common.sh b/.kokoro/release/common.sh new file mode 100755 index 00000000..6e3f6599 --- /dev/null +++ b/.kokoro/release/common.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# Get secrets from keystore and set and environment variables +setup_environment_secrets() { + export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) + export GPG_TTY=$(tty) + export GPG_HOMEDIR=/gpg + mkdir $GPG_HOMEDIR + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg + export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|') + export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') +} + +create_settings_xml_file() { + echo " + + + ossrh + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-staging + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-snapshots + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + +" > $1 +} \ No newline at end of file diff --git a/.kokoro/release/drop.cfg b/.kokoro/release/drop.cfg new file mode 100644 index 00000000..3c171e14 --- /dev/null +++ b/.kokoro/release/drop.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-shell/.kokoro/release/drop.sh" +} diff --git a/.kokoro/release/drop.sh b/.kokoro/release/drop.sh new file mode 100755 index 00000000..5c4551ef --- /dev/null +++ b/.kokoro/release/drop.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:drop -B \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/promote.cfg b/.kokoro/release/promote.cfg new file mode 100644 index 00000000..db87dad6 --- /dev/null +++ b/.kokoro/release/promote.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-shell/.kokoro/release/promote.sh" +} diff --git a/.kokoro/release/promote.sh b/.kokoro/release/promote.sh new file mode 100755 index 00000000..1fa95fa5 --- /dev/null +++ b/.kokoro/release/promote.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh + +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg new file mode 100644 index 00000000..ebaecb1d --- /dev/null +++ b/.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-shell/.kokoro/release/publish_javadoc.sh" +} + + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh new file mode 100755 index 00000000..d4f73ba3 --- /dev/null +++ b/.kokoro/release/publish_javadoc.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# Copyright 2019 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +if [[ -z "${CREDENTIALS}" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +fi + +if [[ -z "${STAGING_BUCKET}" ]]; then + echo "Need to set STAGING_BUCKET environment variable" + exit 1 +fi + +# work from the git root directory +pushd $(dirname "$0")/../../ + +# install docuploader package +python3 -m pip install gcp-docuploader + +# compile all packages +mvn clean install -B -q -DskipTests=true + +export NAME=google-cloud-shell +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/.kokoro/release/publish_javadoc11.cfg b/.kokoro/release/publish_javadoc11.cfg new file mode 100644 index 00000000..44c16495 --- /dev/null +++ b/.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-shell/.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/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh new file mode 100755 index 00000000..8bed2e16 --- /dev/null +++ b/.kokoro/release/publish_javadoc11.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# Copyright 2021 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +if [[ -z "${CREDENTIALS}" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +fi + +if [[ -z "${STAGING_BUCKET_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-shell +export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# V3 generates docfx yml from javadoc +# generate yml +mvn clean site -B -q -P docFX + +# copy README to docfx-yml dir and rename index.md +cp README.md target/docfx-yml/index.md +# copy CHANGELOG to docfx-yml dir and rename history.md +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/.kokoro/release/snapshot.cfg b/.kokoro/release/snapshot.cfg new file mode 100644 index 00000000..2394e696 --- /dev/null +++ b/.kokoro/release/snapshot.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-shell/.kokoro/release/snapshot.sh" +} \ No newline at end of file diff --git a/.kokoro/release/snapshot.sh b/.kokoro/release/snapshot.sh new file mode 100755 index 00000000..1f55b770 --- /dev/null +++ b/.kokoro/release/snapshot.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +source $(dirname "$0")/common.sh +MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml +pushd $(dirname "$0")/../../ + +# ensure we're trying to push a snapshot (no-result returns non-zero exit code) +grep SNAPSHOT versions.txt + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn clean deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} diff --git a/.kokoro/release/stage.cfg b/.kokoro/release/stage.cfg new file mode 100644 index 00000000..eef87676 --- /dev/null +++ b/.kokoro/release/stage.cfg @@ -0,0 +1,19 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-shell/.kokoro/release/stage.sh" +} + +# Need to save the properties file +action { + define_artifacts { + regex: "github/java-shell/target/nexus-staging/staging/*.properties" + strip_prefix: "github/java-shell" + } +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" +} diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh new file mode 100755 index 00000000..8a103384 --- /dev/null +++ b/.kokoro/release/stage.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# Start the releasetool reporter +python3 -m pip install gcp-releasetool +python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script + +source $(dirname "$0")/common.sh +source $(dirname "$0")/../common.sh +MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +# attempt to stage 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn clean deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DskipTests=true \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} + +if [[ -n "${AUTORELEASE_PR}" ]] +then + mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml +fi \ No newline at end of file diff --git a/.kokoro/trampoline.sh b/.kokoro/trampoline.sh new file mode 100644 index 00000000..9da0f839 --- /dev/null +++ b/.kokoro/trampoline.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -eo pipefail +# Always run the cleanup script, regardless of the success of bouncing into +# the container. +function cleanup() { + chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + echo "cleanup"; +} +trap cleanup EXIT + +$(dirname $0)/populate-secrets.sh # Secret Manager secrets. +python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/.repo-metadata.json b/.repo-metadata.json new file mode 100644 index 00000000..1776c314 --- /dev/null +++ b/.repo-metadata.json @@ -0,0 +1,15 @@ +{ + "name": "shell", + "name_pretty": "Cloud Shell", + "product_documentation": "https://cloud.google.com/shell/docs", + "api_description": "is an interactive shell environment for Google Cloud that makes it easy for you to learn and experiment with Google Cloud and manage your projects and resources from your web browser.", + "client_documentation": "https://googleapis.dev/java/google-cloud-shell/latest/index.html", + "release_level": "ga", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-shell", + "repo_short": "java-shell", + "distribution_name": "com.google.cloud:google-cloud-shell", + "api_id": "shell.googleapis.com", + "requires_billing": true +} \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..2add2547 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..f2dbdee0 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,139 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. There are +just a few small guidelines you need to follow. + +## Contributor License Agreement + +Contributions to this project must be accompanied by a Contributor License +Agreement. You (or your employer) retain the copyright to your contribution; +this simply gives us permission to use and redistribute your contributions as +part of the project. Head over to to see +your current agreements on file or to sign a new one. + +You generally only need to submit a CLA once, so if you've already submitted one +(even if it was for a different project), you probably don't need to do it +again. + +## Code reviews + +All submissions, including submissions by project members, require review. We +use GitHub pull requests for this purpose. Consult +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more +information on using pull requests. + +## Community Guidelines + +This project follows +[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/). + +## Building the project + +To build, package, and run all unit tests run the command + +``` +mvn clean verify +``` + +### Running Integration tests + +To include integration tests when building the project, you need access to +a GCP Project with a valid service account. + +For instructions on how to generate a service account and corresponding +credentials JSON see: [Creating a Service Account][1]. + +Then run the following to build, package, run all unit tests and run all +integration tests. + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn -Penable-integration-tests clean verify +``` + +## Code Samples + +Code Samples must be bundled in separate Maven modules, and guarded by a +Maven profile with the name `enable-samples`. + +The samples must be separate from the primary project for a few reasons: +1. Primary projects have a minimum Java version of Java 7 whereas samples have + a minimum Java version of Java 8. Due to this we need the ability to + selectively exclude samples from a build run. +2. Many code samples depend on external GCP services and need + credentials to access the service. +3. Code samples are not released as Maven artifacts and must be excluded from + release builds. + +### Building + +```bash +mvn -Penable-samples clean verify +``` + +Some samples require access to GCP services and require a service account: + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn -Penable-samples clean verify +``` + +### Profile Config + +1. To add samples in a profile to your Maven project, add the following to your +`pom.xml` + + ```xml + + [...] + + + enable-samples + + sample + + + + [...] + + ``` + +2. [Activate](#profile-activation) the profile. +3. Define your samples in a normal Maven project in the `samples/` directory. + +### Code Formatting + +Code in this repo is formatted with +[google-java-format](https://github.com/google/google-java-format). +To run formatting on your project, you can run: +``` +mvn com.coveo:fmt-maven-plugin:format +``` + +### Profile Activation + +To include code samples when building and testing the project, enable the +`enable-samples` Maven profile. + +#### Command line + +To activate the Maven profile on the command line add `-Penable-samples` to your +Maven command. + +#### Maven `settings.xml` + +To activate the Maven profile in your `~/.m2/settings.xml` add an entry of +`enable-samples` following the instructions in [Active Profiles][2]. + +This method has the benefit of applying to all projects you build (and is +respected by IntelliJ IDEA) and is recommended if you are going to be +contributing samples to several projects. + +#### IntelliJ IDEA + +To activate the Maven Profile inside IntelliJ IDEA, follow the instructions in +[Activate Maven profiles][3] to activate `enable-samples`. + +[1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account +[2]: https://maven.apache.org/settings.html#Active_Profiles +[3]: https://www.jetbrains.com/help/idea/work-with-maven-profiles.html#activate_maven_profiles diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/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/codecov.yaml b/codecov.yaml new file mode 100644 index 00000000..5724ea94 --- /dev/null +++ b/codecov.yaml @@ -0,0 +1,4 @@ +--- +codecov: + ci: + - source.cloud.google.com diff --git a/google-cloud-shell-bom/pom.xml b/google-cloud-shell-bom/pom.xml new file mode 100644 index 00000000..4ff43832 --- /dev/null +++ b/google-cloud-shell-bom/pom.xml @@ -0,0 +1,85 @@ + + + 4.0.0 + com.google.cloud + google-cloud-shell-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-shared-config + 0.11.0 + + + Google Cloud Shell BOM + https://github.com/googleapis/java-shell + + BOM for Cloud Shell + + + + Google LLC + + + + + chingor13 + Jeff Ching + chingor@google.com + Google LLC + + Developer + + + + + + scm:git:https://github.com/googleapis/java-shell.git + scm:git:git@github.com:googleapis/java-shell.git + https://github.com/googleapis/java-shell + + + + true + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + + com.google.cloud + google-cloud-shell + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-shell-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-shell-v1 + 0.0.1-SNAPSHOT + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + diff --git a/google-cloud-shell/pom.xml b/google-cloud-shell/pom.xml new file mode 100644 index 00000000..b31e2c08 --- /dev/null +++ b/google-cloud-shell/pom.xml @@ -0,0 +1,111 @@ + + + 4.0.0 + com.google.cloud + google-cloud-shell + 0.0.1-SNAPSHOT + jar + Google Cloud Shell + https://github.com/googleapis/java-shell + Cloud Shell is an interactive shell environment for Google Cloud that makes it easy for you to learn and experiment with Google Cloud and manage your projects and resources from your web browser. + + com.google.cloud + google-cloud-shell-parent + 0.0.1-SNAPSHOT + + + google-cloud-shell + + + + 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-shell-v1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + org.threeten + threetenbp + + + + + junit + junit + test + 4.13.2 + + + + com.google.api.grpc + grpc-google-cloud-shell-v1 + test + + + + com.google.api + gax-grpc + testlib + test + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/CloudShellServiceClient.java b/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/CloudShellServiceClient.java new file mode 100644 index 00000000..41c84655 --- /dev/null +++ b/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/CloudShellServiceClient.java @@ -0,0 +1,627 @@ +/* + * 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. + */ + +package com.google.cloud.shell.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.shell.v1.stub.CloudShellServiceStub; +import com.google.cloud.shell.v1.stub.CloudShellServiceStubSettings; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: API for interacting with Google Cloud Shell. Each user of Cloud Shell has at + * least one environment, which has the ID "default". Environment consists of a Docker image + * defining what is installed on the environment and a home directory containing the user's data + * that will remain across sessions. Clients use this API to start and fetch information about their + * environment, which can then be used to connect to that environment via a separate SSH client. + * + *

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
+ * try (CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.create()) {
+ *   EnvironmentName name = EnvironmentName.of("[USER]", "[ENVIRONMENT]");
+ *   Environment response = cloudShellServiceClient.getEnvironment(name);
+ * }
+ * }
+ * + *

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

To customize credentials: + * + *

{@code
+ * CloudShellServiceSettings cloudShellServiceSettings =
+ *     CloudShellServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * CloudShellServiceClient cloudShellServiceClient =
+ *     CloudShellServiceClient.create(cloudShellServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * CloudShellServiceSettings cloudShellServiceSettings =
+ *     CloudShellServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * CloudShellServiceClient cloudShellServiceClient =
+ *     CloudShellServiceClient.create(cloudShellServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class CloudShellServiceClient implements BackgroundResource { + private final CloudShellServiceSettings settings; + private final CloudShellServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of CloudShellServiceClient with default settings. */ + public static final CloudShellServiceClient create() throws IOException { + return create(CloudShellServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of CloudShellServiceClient, 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 CloudShellServiceClient create(CloudShellServiceSettings settings) + throws IOException { + return new CloudShellServiceClient(settings); + } + + /** + * Constructs an instance of CloudShellServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(CloudShellServiceSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final CloudShellServiceClient create(CloudShellServiceStub stub) { + return new CloudShellServiceClient(stub); + } + + /** + * Constructs an instance of CloudShellServiceClient, 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 CloudShellServiceClient(CloudShellServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((CloudShellServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected CloudShellServiceClient(CloudShellServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final CloudShellServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public CloudShellServiceStub 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. + /** + * Gets an environment. Returns NOT_FOUND if the environment does not exist. + * + *

Sample code: + * + *

{@code
+   * try (CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.create()) {
+   *   EnvironmentName name = EnvironmentName.of("[USER]", "[ENVIRONMENT]");
+   *   Environment response = cloudShellServiceClient.getEnvironment(name);
+   * }
+   * }
+ * + * @param name Required. Name of the requested resource, for example + * `users/me/environments/default` or + * `users/someone{@literal @}example.com/environments/default`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Environment getEnvironment(EnvironmentName name) { + GetEnvironmentRequest request = + GetEnvironmentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getEnvironment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets an environment. Returns NOT_FOUND if the environment does not exist. + * + *

Sample code: + * + *

{@code
+   * try (CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.create()) {
+   *   String name = EnvironmentName.of("[USER]", "[ENVIRONMENT]").toString();
+   *   Environment response = cloudShellServiceClient.getEnvironment(name);
+   * }
+   * }
+ * + * @param name Required. Name of the requested resource, for example + * `users/me/environments/default` or + * `users/someone{@literal @}example.com/environments/default`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Environment getEnvironment(String name) { + GetEnvironmentRequest request = GetEnvironmentRequest.newBuilder().setName(name).build(); + return getEnvironment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets an environment. Returns NOT_FOUND if the environment does not exist. + * + *

Sample code: + * + *

{@code
+   * try (CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.create()) {
+   *   GetEnvironmentRequest request =
+   *       GetEnvironmentRequest.newBuilder()
+   *           .setName(EnvironmentName.of("[USER]", "[ENVIRONMENT]").toString())
+   *           .build();
+   *   Environment response = cloudShellServiceClient.getEnvironment(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Environment getEnvironment(GetEnvironmentRequest request) { + return getEnvironmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets an environment. Returns NOT_FOUND if the environment does not exist. + * + *

Sample code: + * + *

{@code
+   * try (CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.create()) {
+   *   GetEnvironmentRequest request =
+   *       GetEnvironmentRequest.newBuilder()
+   *           .setName(EnvironmentName.of("[USER]", "[ENVIRONMENT]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudShellServiceClient.getEnvironmentCallable().futureCall(request);
+   *   // Do something.
+   *   Environment response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getEnvironmentCallable() { + return stub.getEnvironmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Starts an existing environment, allowing clients to connect to it. The returned operation will + * contain an instance of StartEnvironmentMetadata in its metadata field. Users can wait for the + * environment to start by polling this operation via GetOperation. Once the environment has + * finished starting and is ready to accept connections, the operation will contain a + * StartEnvironmentResponse in its response field. + * + *

Sample code: + * + *

{@code
+   * try (CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.create()) {
+   *   StartEnvironmentRequest request =
+   *       StartEnvironmentRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setAccessToken("accessToken-1042689291")
+   *           .addAllPublicKeys(new ArrayList())
+   *           .build();
+   *   StartEnvironmentResponse response =
+   *       cloudShellServiceClient.startEnvironmentAsync(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 + startEnvironmentAsync(StartEnvironmentRequest request) { + return startEnvironmentOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Starts an existing environment, allowing clients to connect to it. The returned operation will + * contain an instance of StartEnvironmentMetadata in its metadata field. Users can wait for the + * environment to start by polling this operation via GetOperation. Once the environment has + * finished starting and is ready to accept connections, the operation will contain a + * StartEnvironmentResponse in its response field. + * + *

Sample code: + * + *

{@code
+   * try (CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.create()) {
+   *   StartEnvironmentRequest request =
+   *       StartEnvironmentRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setAccessToken("accessToken-1042689291")
+   *           .addAllPublicKeys(new ArrayList())
+   *           .build();
+   *   OperationFuture future =
+   *       cloudShellServiceClient.startEnvironmentOperationCallable().futureCall(request);
+   *   // Do something.
+   *   StartEnvironmentResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + StartEnvironmentRequest, StartEnvironmentResponse, StartEnvironmentMetadata> + startEnvironmentOperationCallable() { + return stub.startEnvironmentOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Starts an existing environment, allowing clients to connect to it. The returned operation will + * contain an instance of StartEnvironmentMetadata in its metadata field. Users can wait for the + * environment to start by polling this operation via GetOperation. Once the environment has + * finished starting and is ready to accept connections, the operation will contain a + * StartEnvironmentResponse in its response field. + * + *

Sample code: + * + *

{@code
+   * try (CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.create()) {
+   *   StartEnvironmentRequest request =
+   *       StartEnvironmentRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setAccessToken("accessToken-1042689291")
+   *           .addAllPublicKeys(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudShellServiceClient.startEnvironmentCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable startEnvironmentCallable() { + return stub.startEnvironmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sends OAuth credentials to a running environment on behalf of a user. When this completes, the + * environment will be authorized to run various Google Cloud command line tools without requiring + * the user to manually authenticate. + * + *

Sample code: + * + *

{@code
+   * try (CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.create()) {
+   *   AuthorizeEnvironmentRequest request =
+   *       AuthorizeEnvironmentRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setAccessToken("accessToken-1042689291")
+   *           .setIdToken("idToken1642509726")
+   *           .setExpireTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   AuthorizeEnvironmentResponse response =
+   *       cloudShellServiceClient.authorizeEnvironmentAsync(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 + authorizeEnvironmentAsync(AuthorizeEnvironmentRequest request) { + return authorizeEnvironmentOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sends OAuth credentials to a running environment on behalf of a user. When this completes, the + * environment will be authorized to run various Google Cloud command line tools without requiring + * the user to manually authenticate. + * + *

Sample code: + * + *

{@code
+   * try (CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.create()) {
+   *   AuthorizeEnvironmentRequest request =
+   *       AuthorizeEnvironmentRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setAccessToken("accessToken-1042689291")
+   *           .setIdToken("idToken1642509726")
+   *           .setExpireTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       cloudShellServiceClient.authorizeEnvironmentOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AuthorizeEnvironmentResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + AuthorizeEnvironmentRequest, AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> + authorizeEnvironmentOperationCallable() { + return stub.authorizeEnvironmentOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sends OAuth credentials to a running environment on behalf of a user. When this completes, the + * environment will be authorized to run various Google Cloud command line tools without requiring + * the user to manually authenticate. + * + *

Sample code: + * + *

{@code
+   * try (CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.create()) {
+   *   AuthorizeEnvironmentRequest request =
+   *       AuthorizeEnvironmentRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setAccessToken("accessToken-1042689291")
+   *           .setIdToken("idToken1642509726")
+   *           .setExpireTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudShellServiceClient.authorizeEnvironmentCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + authorizeEnvironmentCallable() { + return stub.authorizeEnvironmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds a public SSH key to an environment, allowing clients with the corresponding private key to + * connect to that environment via SSH. If a key with the same content already exists, this will + * error with ALREADY_EXISTS. + * + *

Sample code: + * + *

{@code
+   * try (CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.create()) {
+   *   AddPublicKeyRequest request =
+   *       AddPublicKeyRequest.newBuilder()
+   *           .setEnvironment("environment-85904877")
+   *           .setKey("key106079")
+   *           .build();
+   *   AddPublicKeyResponse response = cloudShellServiceClient.addPublicKeyAsync(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 addPublicKeyAsync( + AddPublicKeyRequest request) { + return addPublicKeyOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds a public SSH key to an environment, allowing clients with the corresponding private key to + * connect to that environment via SSH. If a key with the same content already exists, this will + * error with ALREADY_EXISTS. + * + *

Sample code: + * + *

{@code
+   * try (CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.create()) {
+   *   AddPublicKeyRequest request =
+   *       AddPublicKeyRequest.newBuilder()
+   *           .setEnvironment("environment-85904877")
+   *           .setKey("key106079")
+   *           .build();
+   *   OperationFuture future =
+   *       cloudShellServiceClient.addPublicKeyOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AddPublicKeyResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + addPublicKeyOperationCallable() { + return stub.addPublicKeyOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds a public SSH key to an environment, allowing clients with the corresponding private key to + * connect to that environment via SSH. If a key with the same content already exists, this will + * error with ALREADY_EXISTS. + * + *

Sample code: + * + *

{@code
+   * try (CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.create()) {
+   *   AddPublicKeyRequest request =
+   *       AddPublicKeyRequest.newBuilder()
+   *           .setEnvironment("environment-85904877")
+   *           .setKey("key106079")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudShellServiceClient.addPublicKeyCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable addPublicKeyCallable() { + return stub.addPublicKeyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Removes a public SSH key from an environment. Clients will no longer be able to connect to the + * environment using the corresponding private key. If a key with the same content is not present, + * this will error with NOT_FOUND. + * + *

Sample code: + * + *

{@code
+   * try (CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.create()) {
+   *   RemovePublicKeyRequest request =
+   *       RemovePublicKeyRequest.newBuilder()
+   *           .setEnvironment("environment-85904877")
+   *           .setKey("key106079")
+   *           .build();
+   *   RemovePublicKeyResponse response =
+   *       cloudShellServiceClient.removePublicKeyAsync(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 + removePublicKeyAsync(RemovePublicKeyRequest request) { + return removePublicKeyOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Removes a public SSH key from an environment. Clients will no longer be able to connect to the + * environment using the corresponding private key. If a key with the same content is not present, + * this will error with NOT_FOUND. + * + *

Sample code: + * + *

{@code
+   * try (CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.create()) {
+   *   RemovePublicKeyRequest request =
+   *       RemovePublicKeyRequest.newBuilder()
+   *           .setEnvironment("environment-85904877")
+   *           .setKey("key106079")
+   *           .build();
+   *   OperationFuture future =
+   *       cloudShellServiceClient.removePublicKeyOperationCallable().futureCall(request);
+   *   // Do something.
+   *   RemovePublicKeyResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + RemovePublicKeyRequest, RemovePublicKeyResponse, RemovePublicKeyMetadata> + removePublicKeyOperationCallable() { + return stub.removePublicKeyOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Removes a public SSH key from an environment. Clients will no longer be able to connect to the + * environment using the corresponding private key. If a key with the same content is not present, + * this will error with NOT_FOUND. + * + *

Sample code: + * + *

{@code
+   * try (CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.create()) {
+   *   RemovePublicKeyRequest request =
+   *       RemovePublicKeyRequest.newBuilder()
+   *           .setEnvironment("environment-85904877")
+   *           .setKey("key106079")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudShellServiceClient.removePublicKeyCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable removePublicKeyCallable() { + return stub.removePublicKeyCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/CloudShellServiceSettings.java b/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/CloudShellServiceSettings.java new file mode 100644 index 00000000..7b23e1fe --- /dev/null +++ b/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/CloudShellServiceSettings.java @@ -0,0 +1,282 @@ +/* + * 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. + */ + +package com.google.cloud.shell.v1; + +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.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.shell.v1.stub.CloudShellServiceStubSettings; +import com.google.longrunning.Operation; +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 CloudShellServiceClient}. + * + *

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

    + *
  • The default service address (cloudshell.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getEnvironment to 30 seconds: + * + *

{@code
+ * CloudShellServiceSettings.Builder cloudShellServiceSettingsBuilder =
+ *     CloudShellServiceSettings.newBuilder();
+ * cloudShellServiceSettingsBuilder
+ *     .getEnvironmentSettings()
+ *     .setRetrySettings(
+ *         cloudShellServiceSettingsBuilder
+ *             .getEnvironmentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CloudShellServiceSettings cloudShellServiceSettings = cloudShellServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class CloudShellServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to getEnvironment. */ + public UnaryCallSettings getEnvironmentSettings() { + return ((CloudShellServiceStubSettings) getStubSettings()).getEnvironmentSettings(); + } + + /** Returns the object with the settings used for calls to startEnvironment. */ + public UnaryCallSettings startEnvironmentSettings() { + return ((CloudShellServiceStubSettings) getStubSettings()).startEnvironmentSettings(); + } + + /** Returns the object with the settings used for calls to startEnvironment. */ + public OperationCallSettings< + StartEnvironmentRequest, StartEnvironmentResponse, StartEnvironmentMetadata> + startEnvironmentOperationSettings() { + return ((CloudShellServiceStubSettings) getStubSettings()).startEnvironmentOperationSettings(); + } + + /** Returns the object with the settings used for calls to authorizeEnvironment. */ + public UnaryCallSettings authorizeEnvironmentSettings() { + return ((CloudShellServiceStubSettings) getStubSettings()).authorizeEnvironmentSettings(); + } + + /** Returns the object with the settings used for calls to authorizeEnvironment. */ + public OperationCallSettings< + AuthorizeEnvironmentRequest, AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> + authorizeEnvironmentOperationSettings() { + return ((CloudShellServiceStubSettings) getStubSettings()) + .authorizeEnvironmentOperationSettings(); + } + + /** Returns the object with the settings used for calls to addPublicKey. */ + public UnaryCallSettings addPublicKeySettings() { + return ((CloudShellServiceStubSettings) getStubSettings()).addPublicKeySettings(); + } + + /** Returns the object with the settings used for calls to addPublicKey. */ + public OperationCallSettings + addPublicKeyOperationSettings() { + return ((CloudShellServiceStubSettings) getStubSettings()).addPublicKeyOperationSettings(); + } + + /** Returns the object with the settings used for calls to removePublicKey. */ + public UnaryCallSettings removePublicKeySettings() { + return ((CloudShellServiceStubSettings) getStubSettings()).removePublicKeySettings(); + } + + /** Returns the object with the settings used for calls to removePublicKey. */ + public OperationCallSettings< + RemovePublicKeyRequest, RemovePublicKeyResponse, RemovePublicKeyMetadata> + removePublicKeyOperationSettings() { + return ((CloudShellServiceStubSettings) getStubSettings()).removePublicKeyOperationSettings(); + } + + public static final CloudShellServiceSettings create(CloudShellServiceStubSettings stub) + throws IOException { + return new CloudShellServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return CloudShellServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return CloudShellServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return CloudShellServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return CloudShellServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CloudShellServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return CloudShellServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudShellServiceStubSettings.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 CloudShellServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for CloudShellServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(CloudShellServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(CloudShellServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(CloudShellServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(CloudShellServiceStubSettings.newBuilder()); + } + + public CloudShellServiceStubSettings.Builder getStubSettingsBuilder() { + return ((CloudShellServiceStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to getEnvironment. */ + public UnaryCallSettings.Builder getEnvironmentSettings() { + return getStubSettingsBuilder().getEnvironmentSettings(); + } + + /** Returns the builder for the settings used for calls to startEnvironment. */ + public UnaryCallSettings.Builder + startEnvironmentSettings() { + return getStubSettingsBuilder().startEnvironmentSettings(); + } + + /** Returns the builder for the settings used for calls to startEnvironment. */ + public OperationCallSettings.Builder< + StartEnvironmentRequest, StartEnvironmentResponse, StartEnvironmentMetadata> + startEnvironmentOperationSettings() { + return getStubSettingsBuilder().startEnvironmentOperationSettings(); + } + + /** Returns the builder for the settings used for calls to authorizeEnvironment. */ + public UnaryCallSettings.Builder + authorizeEnvironmentSettings() { + return getStubSettingsBuilder().authorizeEnvironmentSettings(); + } + + /** Returns the builder for the settings used for calls to authorizeEnvironment. */ + public OperationCallSettings.Builder< + AuthorizeEnvironmentRequest, AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> + authorizeEnvironmentOperationSettings() { + return getStubSettingsBuilder().authorizeEnvironmentOperationSettings(); + } + + /** Returns the builder for the settings used for calls to addPublicKey. */ + public UnaryCallSettings.Builder addPublicKeySettings() { + return getStubSettingsBuilder().addPublicKeySettings(); + } + + /** Returns the builder for the settings used for calls to addPublicKey. */ + public OperationCallSettings.Builder< + AddPublicKeyRequest, AddPublicKeyResponse, AddPublicKeyMetadata> + addPublicKeyOperationSettings() { + return getStubSettingsBuilder().addPublicKeyOperationSettings(); + } + + /** Returns the builder for the settings used for calls to removePublicKey. */ + public UnaryCallSettings.Builder removePublicKeySettings() { + return getStubSettingsBuilder().removePublicKeySettings(); + } + + /** Returns the builder for the settings used for calls to removePublicKey. */ + public OperationCallSettings.Builder< + RemovePublicKeyRequest, RemovePublicKeyResponse, RemovePublicKeyMetadata> + removePublicKeyOperationSettings() { + return getStubSettingsBuilder().removePublicKeyOperationSettings(); + } + + @Override + public CloudShellServiceSettings build() throws IOException { + return new CloudShellServiceSettings(this); + } + } +} diff --git a/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/gapic_metadata.json b/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/gapic_metadata.json new file mode 100644 index 00000000..e2b20e2a --- /dev/null +++ b/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.shell.v1", + "libraryPackage": "com.google.cloud.shell.v1", + "services": { + "CloudShellService": { + "clients": { + "grpc": { + "libraryClient": "CloudShellServiceClient", + "rpcs": { + "AddPublicKey": { + "methods": ["addPublicKeyAsync", "addPublicKeyOperationCallable", "addPublicKeyCallable"] + }, + "AuthorizeEnvironment": { + "methods": ["authorizeEnvironmentAsync", "authorizeEnvironmentOperationCallable", "authorizeEnvironmentCallable"] + }, + "GetEnvironment": { + "methods": ["getEnvironment", "getEnvironment", "getEnvironment", "getEnvironmentCallable"] + }, + "RemovePublicKey": { + "methods": ["removePublicKeyAsync", "removePublicKeyOperationCallable", "removePublicKeyCallable"] + }, + "StartEnvironment": { + "methods": ["startEnvironmentAsync", "startEnvironmentOperationCallable", "startEnvironmentCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/package-info.java b/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/package-info.java new file mode 100644 index 00000000..b38ae2bc --- /dev/null +++ b/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/package-info.java @@ -0,0 +1,40 @@ +/* + * 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. + */ + +/** + * The interfaces provided are listed below, along with usage samples. + * + *

======================= CloudShellServiceClient ======================= + * + *

Service Description: API for interacting with Google Cloud Shell. Each user of Cloud Shell has + * at least one environment, which has the ID "default". Environment consists of a Docker image + * defining what is installed on the environment and a home directory containing the user's data + * that will remain across sessions. Clients use this API to start and fetch information about their + * environment, which can then be used to connect to that environment via a separate SSH client. + * + *

Sample for CloudShellServiceClient: + * + *

{@code
+ * try (CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.create()) {
+ *   EnvironmentName name = EnvironmentName.of("[USER]", "[ENVIRONMENT]");
+ *   Environment response = cloudShellServiceClient.getEnvironment(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.shell.v1; + +import javax.annotation.Generated; diff --git a/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/stub/CloudShellServiceStub.java b/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/stub/CloudShellServiceStub.java new file mode 100644 index 00000000..faceab46 --- /dev/null +++ b/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/stub/CloudShellServiceStub.java @@ -0,0 +1,98 @@ +/* + * 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. + */ + +package com.google.cloud.shell.v1.stub; + +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.shell.v1.AddPublicKeyMetadata; +import com.google.cloud.shell.v1.AddPublicKeyRequest; +import com.google.cloud.shell.v1.AddPublicKeyResponse; +import com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata; +import com.google.cloud.shell.v1.AuthorizeEnvironmentRequest; +import com.google.cloud.shell.v1.AuthorizeEnvironmentResponse; +import com.google.cloud.shell.v1.Environment; +import com.google.cloud.shell.v1.GetEnvironmentRequest; +import com.google.cloud.shell.v1.RemovePublicKeyMetadata; +import com.google.cloud.shell.v1.RemovePublicKeyRequest; +import com.google.cloud.shell.v1.RemovePublicKeyResponse; +import com.google.cloud.shell.v1.StartEnvironmentMetadata; +import com.google.cloud.shell.v1.StartEnvironmentRequest; +import com.google.cloud.shell.v1.StartEnvironmentResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the CloudShellService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class CloudShellServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable getEnvironmentCallable() { + throw new UnsupportedOperationException("Not implemented: getEnvironmentCallable()"); + } + + public OperationCallable< + StartEnvironmentRequest, StartEnvironmentResponse, StartEnvironmentMetadata> + startEnvironmentOperationCallable() { + throw new UnsupportedOperationException("Not implemented: startEnvironmentOperationCallable()"); + } + + public UnaryCallable startEnvironmentCallable() { + throw new UnsupportedOperationException("Not implemented: startEnvironmentCallable()"); + } + + public OperationCallable< + AuthorizeEnvironmentRequest, AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> + authorizeEnvironmentOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: authorizeEnvironmentOperationCallable()"); + } + + public UnaryCallable authorizeEnvironmentCallable() { + throw new UnsupportedOperationException("Not implemented: authorizeEnvironmentCallable()"); + } + + public OperationCallable + addPublicKeyOperationCallable() { + throw new UnsupportedOperationException("Not implemented: addPublicKeyOperationCallable()"); + } + + public UnaryCallable addPublicKeyCallable() { + throw new UnsupportedOperationException("Not implemented: addPublicKeyCallable()"); + } + + public OperationCallable + removePublicKeyOperationCallable() { + throw new UnsupportedOperationException("Not implemented: removePublicKeyOperationCallable()"); + } + + public UnaryCallable removePublicKeyCallable() { + throw new UnsupportedOperationException("Not implemented: removePublicKeyCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/stub/CloudShellServiceStubSettings.java b/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/stub/CloudShellServiceStubSettings.java new file mode 100644 index 00000000..97584680 --- /dev/null +++ b/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/stub/CloudShellServiceStubSettings.java @@ -0,0 +1,592 @@ +/* + * 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. + */ + +package com.google.cloud.shell.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.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.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.shell.v1.AddPublicKeyMetadata; +import com.google.cloud.shell.v1.AddPublicKeyRequest; +import com.google.cloud.shell.v1.AddPublicKeyResponse; +import com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata; +import com.google.cloud.shell.v1.AuthorizeEnvironmentRequest; +import com.google.cloud.shell.v1.AuthorizeEnvironmentResponse; +import com.google.cloud.shell.v1.Environment; +import com.google.cloud.shell.v1.GetEnvironmentRequest; +import com.google.cloud.shell.v1.RemovePublicKeyMetadata; +import com.google.cloud.shell.v1.RemovePublicKeyRequest; +import com.google.cloud.shell.v1.RemovePublicKeyResponse; +import com.google.cloud.shell.v1.StartEnvironmentMetadata; +import com.google.cloud.shell.v1.StartEnvironmentRequest; +import com.google.cloud.shell.v1.StartEnvironmentResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import 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 CloudShellServiceStub}. + * + *

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

    + *
  • The default service address (cloudshell.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getEnvironment to 30 seconds: + * + *

{@code
+ * CloudShellServiceStubSettings.Builder cloudShellServiceSettingsBuilder =
+ *     CloudShellServiceStubSettings.newBuilder();
+ * cloudShellServiceSettingsBuilder
+ *     .getEnvironmentSettings()
+ *     .setRetrySettings(
+ *         cloudShellServiceSettingsBuilder
+ *             .getEnvironmentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CloudShellServiceStubSettings cloudShellServiceSettings =
+ *     cloudShellServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class CloudShellServiceStubSettings 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 UnaryCallSettings getEnvironmentSettings; + private final UnaryCallSettings startEnvironmentSettings; + private final OperationCallSettings< + StartEnvironmentRequest, StartEnvironmentResponse, StartEnvironmentMetadata> + startEnvironmentOperationSettings; + private final UnaryCallSettings + authorizeEnvironmentSettings; + private final OperationCallSettings< + AuthorizeEnvironmentRequest, AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> + authorizeEnvironmentOperationSettings; + private final UnaryCallSettings addPublicKeySettings; + private final OperationCallSettings< + AddPublicKeyRequest, AddPublicKeyResponse, AddPublicKeyMetadata> + addPublicKeyOperationSettings; + private final UnaryCallSettings removePublicKeySettings; + private final OperationCallSettings< + RemovePublicKeyRequest, RemovePublicKeyResponse, RemovePublicKeyMetadata> + removePublicKeyOperationSettings; + + /** Returns the object with the settings used for calls to getEnvironment. */ + public UnaryCallSettings getEnvironmentSettings() { + return getEnvironmentSettings; + } + + /** Returns the object with the settings used for calls to startEnvironment. */ + public UnaryCallSettings startEnvironmentSettings() { + return startEnvironmentSettings; + } + + /** Returns the object with the settings used for calls to startEnvironment. */ + public OperationCallSettings< + StartEnvironmentRequest, StartEnvironmentResponse, StartEnvironmentMetadata> + startEnvironmentOperationSettings() { + return startEnvironmentOperationSettings; + } + + /** Returns the object with the settings used for calls to authorizeEnvironment. */ + public UnaryCallSettings authorizeEnvironmentSettings() { + return authorizeEnvironmentSettings; + } + + /** Returns the object with the settings used for calls to authorizeEnvironment. */ + public OperationCallSettings< + AuthorizeEnvironmentRequest, AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> + authorizeEnvironmentOperationSettings() { + return authorizeEnvironmentOperationSettings; + } + + /** Returns the object with the settings used for calls to addPublicKey. */ + public UnaryCallSettings addPublicKeySettings() { + return addPublicKeySettings; + } + + /** Returns the object with the settings used for calls to addPublicKey. */ + public OperationCallSettings + addPublicKeyOperationSettings() { + return addPublicKeyOperationSettings; + } + + /** Returns the object with the settings used for calls to removePublicKey. */ + public UnaryCallSettings removePublicKeySettings() { + return removePublicKeySettings; + } + + /** Returns the object with the settings used for calls to removePublicKey. */ + public OperationCallSettings< + RemovePublicKeyRequest, RemovePublicKeyResponse, RemovePublicKeyMetadata> + removePublicKeyOperationSettings() { + return removePublicKeyOperationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public CloudShellServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCloudShellServiceStub.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 "cloudshell.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CloudShellServiceStubSettings.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 CloudShellServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getEnvironmentSettings = settingsBuilder.getEnvironmentSettings().build(); + startEnvironmentSettings = settingsBuilder.startEnvironmentSettings().build(); + startEnvironmentOperationSettings = settingsBuilder.startEnvironmentOperationSettings().build(); + authorizeEnvironmentSettings = settingsBuilder.authorizeEnvironmentSettings().build(); + authorizeEnvironmentOperationSettings = + settingsBuilder.authorizeEnvironmentOperationSettings().build(); + addPublicKeySettings = settingsBuilder.addPublicKeySettings().build(); + addPublicKeyOperationSettings = settingsBuilder.addPublicKeyOperationSettings().build(); + removePublicKeySettings = settingsBuilder.removePublicKeySettings().build(); + removePublicKeyOperationSettings = settingsBuilder.removePublicKeyOperationSettings().build(); + } + + /** Builder for CloudShellServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + getEnvironmentSettings; + private final UnaryCallSettings.Builder + startEnvironmentSettings; + private final OperationCallSettings.Builder< + StartEnvironmentRequest, StartEnvironmentResponse, StartEnvironmentMetadata> + startEnvironmentOperationSettings; + private final UnaryCallSettings.Builder + authorizeEnvironmentSettings; + private final OperationCallSettings.Builder< + AuthorizeEnvironmentRequest, AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> + authorizeEnvironmentOperationSettings; + private final UnaryCallSettings.Builder addPublicKeySettings; + private final OperationCallSettings.Builder< + AddPublicKeyRequest, AddPublicKeyResponse, AddPublicKeyMetadata> + addPublicKeyOperationSettings; + private final UnaryCallSettings.Builder + removePublicKeySettings; + private final OperationCallSettings.Builder< + RemovePublicKeyRequest, RemovePublicKeyResponse, RemovePublicKeyMetadata> + removePublicKeyOperationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getEnvironmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + startEnvironmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + startEnvironmentOperationSettings = OperationCallSettings.newBuilder(); + authorizeEnvironmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + authorizeEnvironmentOperationSettings = OperationCallSettings.newBuilder(); + addPublicKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + addPublicKeyOperationSettings = OperationCallSettings.newBuilder(); + removePublicKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + removePublicKeyOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getEnvironmentSettings, + startEnvironmentSettings, + authorizeEnvironmentSettings, + addPublicKeySettings, + removePublicKeySettings); + initDefaults(this); + } + + protected Builder(CloudShellServiceStubSettings settings) { + super(settings); + + getEnvironmentSettings = settings.getEnvironmentSettings.toBuilder(); + startEnvironmentSettings = settings.startEnvironmentSettings.toBuilder(); + startEnvironmentOperationSettings = settings.startEnvironmentOperationSettings.toBuilder(); + authorizeEnvironmentSettings = settings.authorizeEnvironmentSettings.toBuilder(); + authorizeEnvironmentOperationSettings = + settings.authorizeEnvironmentOperationSettings.toBuilder(); + addPublicKeySettings = settings.addPublicKeySettings.toBuilder(); + addPublicKeyOperationSettings = settings.addPublicKeyOperationSettings.toBuilder(); + removePublicKeySettings = settings.removePublicKeySettings.toBuilder(); + removePublicKeyOperationSettings = settings.removePublicKeyOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getEnvironmentSettings, + startEnvironmentSettings, + authorizeEnvironmentSettings, + addPublicKeySettings, + removePublicKeySettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .getEnvironmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .startEnvironmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .authorizeEnvironmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .addPublicKeySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .removePublicKeySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .startEnvironmentOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(StartEnvironmentResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(StartEnvironmentMetadata.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 + .authorizeEnvironmentOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + AuthorizeEnvironmentResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + AuthorizeEnvironmentMetadata.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 + .addPublicKeyOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(AddPublicKeyResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(AddPublicKeyMetadata.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 + .removePublicKeyOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(RemovePublicKeyResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(RemovePublicKeyMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to getEnvironment. */ + public UnaryCallSettings.Builder getEnvironmentSettings() { + return getEnvironmentSettings; + } + + /** Returns the builder for the settings used for calls to startEnvironment. */ + public UnaryCallSettings.Builder + startEnvironmentSettings() { + return startEnvironmentSettings; + } + + /** Returns the builder for the settings used for calls to startEnvironment. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + StartEnvironmentRequest, StartEnvironmentResponse, StartEnvironmentMetadata> + startEnvironmentOperationSettings() { + return startEnvironmentOperationSettings; + } + + /** Returns the builder for the settings used for calls to authorizeEnvironment. */ + public UnaryCallSettings.Builder + authorizeEnvironmentSettings() { + return authorizeEnvironmentSettings; + } + + /** Returns the builder for the settings used for calls to authorizeEnvironment. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + AuthorizeEnvironmentRequest, AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> + authorizeEnvironmentOperationSettings() { + return authorizeEnvironmentOperationSettings; + } + + /** Returns the builder for the settings used for calls to addPublicKey. */ + public UnaryCallSettings.Builder addPublicKeySettings() { + return addPublicKeySettings; + } + + /** Returns the builder for the settings used for calls to addPublicKey. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + AddPublicKeyRequest, AddPublicKeyResponse, AddPublicKeyMetadata> + addPublicKeyOperationSettings() { + return addPublicKeyOperationSettings; + } + + /** Returns the builder for the settings used for calls to removePublicKey. */ + public UnaryCallSettings.Builder removePublicKeySettings() { + return removePublicKeySettings; + } + + /** Returns the builder for the settings used for calls to removePublicKey. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + RemovePublicKeyRequest, RemovePublicKeyResponse, RemovePublicKeyMetadata> + removePublicKeyOperationSettings() { + return removePublicKeyOperationSettings; + } + + @Override + public CloudShellServiceStubSettings build() throws IOException { + return new CloudShellServiceStubSettings(this); + } + } +} diff --git a/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/stub/GrpcCloudShellServiceCallableFactory.java b/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/stub/GrpcCloudShellServiceCallableFactory.java new file mode 100644 index 00000000..9f6b8bc3 --- /dev/null +++ b/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/stub/GrpcCloudShellServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * 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. + */ + +package com.google.cloud.shell.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 CloudShellService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcCloudShellServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/stub/GrpcCloudShellServiceStub.java b/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/stub/GrpcCloudShellServiceStub.java new file mode 100644 index 00000000..f8a66626 --- /dev/null +++ b/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/stub/GrpcCloudShellServiceStub.java @@ -0,0 +1,365 @@ +/* + * 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. + */ + +package com.google.cloud.shell.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.shell.v1.AddPublicKeyMetadata; +import com.google.cloud.shell.v1.AddPublicKeyRequest; +import com.google.cloud.shell.v1.AddPublicKeyResponse; +import com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata; +import com.google.cloud.shell.v1.AuthorizeEnvironmentRequest; +import com.google.cloud.shell.v1.AuthorizeEnvironmentResponse; +import com.google.cloud.shell.v1.Environment; +import com.google.cloud.shell.v1.GetEnvironmentRequest; +import com.google.cloud.shell.v1.RemovePublicKeyMetadata; +import com.google.cloud.shell.v1.RemovePublicKeyRequest; +import com.google.cloud.shell.v1.RemovePublicKeyResponse; +import com.google.cloud.shell.v1.StartEnvironmentMetadata; +import com.google.cloud.shell.v1.StartEnvironmentRequest; +import com.google.cloud.shell.v1.StartEnvironmentResponse; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the CloudShellService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcCloudShellServiceStub extends CloudShellServiceStub { + private static final MethodDescriptor + getEnvironmentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.shell.v1.CloudShellService/GetEnvironment") + .setRequestMarshaller( + ProtoUtils.marshaller(GetEnvironmentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Environment.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + startEnvironmentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.shell.v1.CloudShellService/StartEnvironment") + .setRequestMarshaller( + ProtoUtils.marshaller(StartEnvironmentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + authorizeEnvironmentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.shell.v1.CloudShellService/AuthorizeEnvironment") + .setRequestMarshaller( + ProtoUtils.marshaller(AuthorizeEnvironmentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + addPublicKeyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.shell.v1.CloudShellService/AddPublicKey") + .setRequestMarshaller(ProtoUtils.marshaller(AddPublicKeyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + removePublicKeyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.shell.v1.CloudShellService/RemovePublicKey") + .setRequestMarshaller( + ProtoUtils.marshaller(RemovePublicKeyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable getEnvironmentCallable; + private final UnaryCallable startEnvironmentCallable; + private final OperationCallable< + StartEnvironmentRequest, StartEnvironmentResponse, StartEnvironmentMetadata> + startEnvironmentOperationCallable; + private final UnaryCallable authorizeEnvironmentCallable; + private final OperationCallable< + AuthorizeEnvironmentRequest, AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> + authorizeEnvironmentOperationCallable; + private final UnaryCallable addPublicKeyCallable; + private final OperationCallable + addPublicKeyOperationCallable; + private final UnaryCallable removePublicKeyCallable; + private final OperationCallable< + RemovePublicKeyRequest, RemovePublicKeyResponse, RemovePublicKeyMetadata> + removePublicKeyOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcCloudShellServiceStub create(CloudShellServiceStubSettings settings) + throws IOException { + return new GrpcCloudShellServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCloudShellServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcCloudShellServiceStub( + CloudShellServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCloudShellServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCloudShellServiceStub( + CloudShellServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcCloudShellServiceStub, 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 GrpcCloudShellServiceStub( + CloudShellServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcCloudShellServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcCloudShellServiceStub, 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 GrpcCloudShellServiceStub( + CloudShellServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings getEnvironmentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getEnvironmentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetEnvironmentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings startEnvironmentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(startEnvironmentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(StartEnvironmentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings authorizeEnvironmentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(authorizeEnvironmentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(AuthorizeEnvironmentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings addPublicKeyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(addPublicKeyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(AddPublicKeyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("environment", String.valueOf(request.getEnvironment())); + return params.build(); + } + }) + .build(); + GrpcCallSettings removePublicKeyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(removePublicKeyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(RemovePublicKeyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("environment", String.valueOf(request.getEnvironment())); + return params.build(); + } + }) + .build(); + + this.getEnvironmentCallable = + callableFactory.createUnaryCallable( + getEnvironmentTransportSettings, settings.getEnvironmentSettings(), clientContext); + this.startEnvironmentCallable = + callableFactory.createUnaryCallable( + startEnvironmentTransportSettings, settings.startEnvironmentSettings(), clientContext); + this.startEnvironmentOperationCallable = + callableFactory.createOperationCallable( + startEnvironmentTransportSettings, + settings.startEnvironmentOperationSettings(), + clientContext, + operationsStub); + this.authorizeEnvironmentCallable = + callableFactory.createUnaryCallable( + authorizeEnvironmentTransportSettings, + settings.authorizeEnvironmentSettings(), + clientContext); + this.authorizeEnvironmentOperationCallable = + callableFactory.createOperationCallable( + authorizeEnvironmentTransportSettings, + settings.authorizeEnvironmentOperationSettings(), + clientContext, + operationsStub); + this.addPublicKeyCallable = + callableFactory.createUnaryCallable( + addPublicKeyTransportSettings, settings.addPublicKeySettings(), clientContext); + this.addPublicKeyOperationCallable = + callableFactory.createOperationCallable( + addPublicKeyTransportSettings, + settings.addPublicKeyOperationSettings(), + clientContext, + operationsStub); + this.removePublicKeyCallable = + callableFactory.createUnaryCallable( + removePublicKeyTransportSettings, settings.removePublicKeySettings(), clientContext); + this.removePublicKeyOperationCallable = + callableFactory.createOperationCallable( + removePublicKeyTransportSettings, + settings.removePublicKeyOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getEnvironmentCallable() { + return getEnvironmentCallable; + } + + @Override + public UnaryCallable startEnvironmentCallable() { + return startEnvironmentCallable; + } + + @Override + public OperationCallable< + StartEnvironmentRequest, StartEnvironmentResponse, StartEnvironmentMetadata> + startEnvironmentOperationCallable() { + return startEnvironmentOperationCallable; + } + + @Override + public UnaryCallable authorizeEnvironmentCallable() { + return authorizeEnvironmentCallable; + } + + @Override + public OperationCallable< + AuthorizeEnvironmentRequest, AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> + authorizeEnvironmentOperationCallable() { + return authorizeEnvironmentOperationCallable; + } + + @Override + public UnaryCallable addPublicKeyCallable() { + return addPublicKeyCallable; + } + + @Override + public OperationCallable + addPublicKeyOperationCallable() { + return addPublicKeyOperationCallable; + } + + @Override + public UnaryCallable removePublicKeyCallable() { + return removePublicKeyCallable; + } + + @Override + public OperationCallable + removePublicKeyOperationCallable() { + return removePublicKeyOperationCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-shell/src/test/java/com/google/cloud/shell/v1/CloudShellServiceClientTest.java b/google-cloud-shell/src/test/java/com/google/cloud/shell/v1/CloudShellServiceClientTest.java new file mode 100644 index 00000000..face216e --- /dev/null +++ b/google-cloud-shell/src/test/java/com/google/cloud/shell/v1/CloudShellServiceClientTest.java @@ -0,0 +1,396 @@ +/* + * 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. + */ + +package com.google.cloud.shell.v1; + +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.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +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 CloudShellServiceClientTest { + private static MockServiceHelper mockServiceHelper; + private CloudShellServiceClient client; + private static MockCloudShellService mockCloudShellService; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockCloudShellService = new MockCloudShellService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockCloudShellService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + CloudShellServiceSettings settings = + CloudShellServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudShellServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getEnvironmentTest() throws Exception { + Environment expectedResponse = + Environment.newBuilder() + .setName(EnvironmentName.of("[USER]", "[ENVIRONMENT]").toString()) + .setId("id3355") + .setDockerImage("dockerImage2086149915") + .setWebHost("webHost1223060252") + .setSshUsername("sshUsername-812965122") + .setSshHost("sshHost-1920605232") + .setSshPort(612046936) + .addAllPublicKeys(new ArrayList()) + .build(); + mockCloudShellService.addResponse(expectedResponse); + + EnvironmentName name = EnvironmentName.of("[USER]", "[ENVIRONMENT]"); + + Environment actualResponse = client.getEnvironment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudShellService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetEnvironmentRequest actualRequest = ((GetEnvironmentRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getEnvironmentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudShellService.addException(exception); + + try { + EnvironmentName name = EnvironmentName.of("[USER]", "[ENVIRONMENT]"); + client.getEnvironment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEnvironmentTest2() throws Exception { + Environment expectedResponse = + Environment.newBuilder() + .setName(EnvironmentName.of("[USER]", "[ENVIRONMENT]").toString()) + .setId("id3355") + .setDockerImage("dockerImage2086149915") + .setWebHost("webHost1223060252") + .setSshUsername("sshUsername-812965122") + .setSshHost("sshHost-1920605232") + .setSshPort(612046936) + .addAllPublicKeys(new ArrayList()) + .build(); + mockCloudShellService.addResponse(expectedResponse); + + String name = "name3373707"; + + Environment actualResponse = client.getEnvironment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudShellService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetEnvironmentRequest actualRequest = ((GetEnvironmentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getEnvironmentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudShellService.addException(exception); + + try { + String name = "name3373707"; + client.getEnvironment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void startEnvironmentTest() throws Exception { + StartEnvironmentResponse expectedResponse = + StartEnvironmentResponse.newBuilder() + .setEnvironment(Environment.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("startEnvironmentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudShellService.addResponse(resultOperation); + + StartEnvironmentRequest request = + StartEnvironmentRequest.newBuilder() + .setName("name3373707") + .setAccessToken("accessToken-1042689291") + .addAllPublicKeys(new ArrayList()) + .build(); + + StartEnvironmentResponse actualResponse = client.startEnvironmentAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudShellService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + StartEnvironmentRequest actualRequest = ((StartEnvironmentRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getAccessToken(), actualRequest.getAccessToken()); + Assert.assertEquals(request.getPublicKeysList(), actualRequest.getPublicKeysList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void startEnvironmentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudShellService.addException(exception); + + try { + StartEnvironmentRequest request = + StartEnvironmentRequest.newBuilder() + .setName("name3373707") + .setAccessToken("accessToken-1042689291") + .addAllPublicKeys(new ArrayList()) + .build(); + client.startEnvironmentAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void authorizeEnvironmentTest() throws Exception { + AuthorizeEnvironmentResponse expectedResponse = + AuthorizeEnvironmentResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("authorizeEnvironmentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudShellService.addResponse(resultOperation); + + AuthorizeEnvironmentRequest request = + AuthorizeEnvironmentRequest.newBuilder() + .setName("name3373707") + .setAccessToken("accessToken-1042689291") + .setIdToken("idToken1642509726") + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + + AuthorizeEnvironmentResponse actualResponse = client.authorizeEnvironmentAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudShellService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AuthorizeEnvironmentRequest actualRequest = + ((AuthorizeEnvironmentRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getAccessToken(), actualRequest.getAccessToken()); + Assert.assertEquals(request.getIdToken(), actualRequest.getIdToken()); + Assert.assertEquals(request.getExpireTime(), actualRequest.getExpireTime()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void authorizeEnvironmentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudShellService.addException(exception); + + try { + AuthorizeEnvironmentRequest request = + AuthorizeEnvironmentRequest.newBuilder() + .setName("name3373707") + .setAccessToken("accessToken-1042689291") + .setIdToken("idToken1642509726") + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + client.authorizeEnvironmentAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void addPublicKeyTest() throws Exception { + AddPublicKeyResponse expectedResponse = + AddPublicKeyResponse.newBuilder().setKey("key106079").build(); + Operation resultOperation = + Operation.newBuilder() + .setName("addPublicKeyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudShellService.addResponse(resultOperation); + + AddPublicKeyRequest request = + AddPublicKeyRequest.newBuilder() + .setEnvironment("environment-85904877") + .setKey("key106079") + .build(); + + AddPublicKeyResponse actualResponse = client.addPublicKeyAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudShellService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddPublicKeyRequest actualRequest = ((AddPublicKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getEnvironment(), actualRequest.getEnvironment()); + Assert.assertEquals(request.getKey(), actualRequest.getKey()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addPublicKeyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudShellService.addException(exception); + + try { + AddPublicKeyRequest request = + AddPublicKeyRequest.newBuilder() + .setEnvironment("environment-85904877") + .setKey("key106079") + .build(); + client.addPublicKeyAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void removePublicKeyTest() throws Exception { + RemovePublicKeyResponse expectedResponse = RemovePublicKeyResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("removePublicKeyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudShellService.addResponse(resultOperation); + + RemovePublicKeyRequest request = + RemovePublicKeyRequest.newBuilder() + .setEnvironment("environment-85904877") + .setKey("key106079") + .build(); + + RemovePublicKeyResponse actualResponse = client.removePublicKeyAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudShellService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RemovePublicKeyRequest actualRequest = ((RemovePublicKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getEnvironment(), actualRequest.getEnvironment()); + Assert.assertEquals(request.getKey(), actualRequest.getKey()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void removePublicKeyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudShellService.addException(exception); + + try { + RemovePublicKeyRequest request = + RemovePublicKeyRequest.newBuilder() + .setEnvironment("environment-85904877") + .setKey("key106079") + .build(); + client.removePublicKeyAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/google-cloud-shell/src/test/java/com/google/cloud/shell/v1/MockCloudShellService.java b/google-cloud-shell/src/test/java/com/google/cloud/shell/v1/MockCloudShellService.java new file mode 100644 index 00000000..ecb3536c --- /dev/null +++ b/google-cloud-shell/src/test/java/com/google/cloud/shell/v1/MockCloudShellService.java @@ -0,0 +1,59 @@ +/* + * 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. + */ + +package com.google.cloud.shell.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 MockCloudShellService implements MockGrpcService { + private final MockCloudShellServiceImpl serviceImpl; + + public MockCloudShellService() { + serviceImpl = new MockCloudShellServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-shell/src/test/java/com/google/cloud/shell/v1/MockCloudShellServiceImpl.java b/google-cloud-shell/src/test/java/com/google/cloud/shell/v1/MockCloudShellServiceImpl.java new file mode 100644 index 00000000..dbd4a049 --- /dev/null +++ b/google-cloud-shell/src/test/java/com/google/cloud/shell/v1/MockCloudShellServiceImpl.java @@ -0,0 +1,166 @@ +/* + * 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. + */ + +package com.google.cloud.shell.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.shell.v1.CloudShellServiceGrpc.CloudShellServiceImplBase; +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 MockCloudShellServiceImpl extends CloudShellServiceImplBase { + private List requests; + private Queue responses; + + public MockCloudShellServiceImpl() { + 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 getEnvironment( + GetEnvironmentRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Environment) { + requests.add(request); + responseObserver.onNext(((Environment) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetEnvironment, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Environment.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void startEnvironment( + StartEnvironmentRequest 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 StartEnvironment, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void authorizeEnvironment( + AuthorizeEnvironmentRequest 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 AuthorizeEnvironment, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void addPublicKey( + AddPublicKeyRequest 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 AddPublicKey, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void removePublicKey( + RemovePublicKeyRequest 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 RemovePublicKey, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/grpc-google-cloud-shell-v1/pom.xml b/grpc-google-cloud-shell-v1/pom.xml new file mode 100644 index 00000000..2f227267 --- /dev/null +++ b/grpc-google-cloud-shell-v1/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-shell-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-shell-v1 + GRPC library for google-cloud-shell + + com.google.cloud + google-cloud-shell-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-shell-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/grpc-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CloudShellServiceGrpc.java b/grpc-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CloudShellServiceGrpc.java new file mode 100644 index 00000000..c149bdc3 --- /dev/null +++ b/grpc-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CloudShellServiceGrpc.java @@ -0,0 +1,887 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.shell.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * API for interacting with Google Cloud Shell. Each user of Cloud Shell has at
+ * least one environment, which has the ID "default". Environment consists of a
+ * Docker image defining what is installed on the environment and a home
+ * directory containing the user's data that will remain across sessions.
+ * Clients use this API to start and fetch information about their environment,
+ * which can then be used to connect to that environment via a separate SSH
+ * client.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/shell/v1/cloudshell.proto") +public final class CloudShellServiceGrpc { + + private CloudShellServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.shell.v1.CloudShellService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.shell.v1.GetEnvironmentRequest, com.google.cloud.shell.v1.Environment> + getGetEnvironmentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetEnvironment", + requestType = com.google.cloud.shell.v1.GetEnvironmentRequest.class, + responseType = com.google.cloud.shell.v1.Environment.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.shell.v1.GetEnvironmentRequest, com.google.cloud.shell.v1.Environment> + getGetEnvironmentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.shell.v1.GetEnvironmentRequest, com.google.cloud.shell.v1.Environment> + getGetEnvironmentMethod; + if ((getGetEnvironmentMethod = CloudShellServiceGrpc.getGetEnvironmentMethod) == null) { + synchronized (CloudShellServiceGrpc.class) { + if ((getGetEnvironmentMethod = CloudShellServiceGrpc.getGetEnvironmentMethod) == null) { + CloudShellServiceGrpc.getGetEnvironmentMethod = + getGetEnvironmentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetEnvironment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.shell.v1.GetEnvironmentRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.shell.v1.Environment.getDefaultInstance())) + .setSchemaDescriptor( + new CloudShellServiceMethodDescriptorSupplier("GetEnvironment")) + .build(); + } + } + } + return getGetEnvironmentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.shell.v1.StartEnvironmentRequest, com.google.longrunning.Operation> + getStartEnvironmentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StartEnvironment", + requestType = com.google.cloud.shell.v1.StartEnvironmentRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.shell.v1.StartEnvironmentRequest, com.google.longrunning.Operation> + getStartEnvironmentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.shell.v1.StartEnvironmentRequest, com.google.longrunning.Operation> + getStartEnvironmentMethod; + if ((getStartEnvironmentMethod = CloudShellServiceGrpc.getStartEnvironmentMethod) == null) { + synchronized (CloudShellServiceGrpc.class) { + if ((getStartEnvironmentMethod = CloudShellServiceGrpc.getStartEnvironmentMethod) == null) { + CloudShellServiceGrpc.getStartEnvironmentMethod = + getStartEnvironmentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StartEnvironment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.shell.v1.StartEnvironmentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudShellServiceMethodDescriptorSupplier("StartEnvironment")) + .build(); + } + } + } + return getStartEnvironmentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.shell.v1.AuthorizeEnvironmentRequest, com.google.longrunning.Operation> + getAuthorizeEnvironmentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AuthorizeEnvironment", + requestType = com.google.cloud.shell.v1.AuthorizeEnvironmentRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.shell.v1.AuthorizeEnvironmentRequest, com.google.longrunning.Operation> + getAuthorizeEnvironmentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.shell.v1.AuthorizeEnvironmentRequest, com.google.longrunning.Operation> + getAuthorizeEnvironmentMethod; + if ((getAuthorizeEnvironmentMethod = CloudShellServiceGrpc.getAuthorizeEnvironmentMethod) + == null) { + synchronized (CloudShellServiceGrpc.class) { + if ((getAuthorizeEnvironmentMethod = CloudShellServiceGrpc.getAuthorizeEnvironmentMethod) + == null) { + CloudShellServiceGrpc.getAuthorizeEnvironmentMethod = + getAuthorizeEnvironmentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "AuthorizeEnvironment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.shell.v1.AuthorizeEnvironmentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudShellServiceMethodDescriptorSupplier("AuthorizeEnvironment")) + .build(); + } + } + } + return getAuthorizeEnvironmentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.shell.v1.AddPublicKeyRequest, com.google.longrunning.Operation> + getAddPublicKeyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AddPublicKey", + requestType = com.google.cloud.shell.v1.AddPublicKeyRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.shell.v1.AddPublicKeyRequest, com.google.longrunning.Operation> + getAddPublicKeyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.shell.v1.AddPublicKeyRequest, com.google.longrunning.Operation> + getAddPublicKeyMethod; + if ((getAddPublicKeyMethod = CloudShellServiceGrpc.getAddPublicKeyMethod) == null) { + synchronized (CloudShellServiceGrpc.class) { + if ((getAddPublicKeyMethod = CloudShellServiceGrpc.getAddPublicKeyMethod) == null) { + CloudShellServiceGrpc.getAddPublicKeyMethod = + getAddPublicKeyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "AddPublicKey")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.shell.v1.AddPublicKeyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudShellServiceMethodDescriptorSupplier("AddPublicKey")) + .build(); + } + } + } + return getAddPublicKeyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.shell.v1.RemovePublicKeyRequest, com.google.longrunning.Operation> + getRemovePublicKeyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RemovePublicKey", + requestType = com.google.cloud.shell.v1.RemovePublicKeyRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.shell.v1.RemovePublicKeyRequest, com.google.longrunning.Operation> + getRemovePublicKeyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.shell.v1.RemovePublicKeyRequest, com.google.longrunning.Operation> + getRemovePublicKeyMethod; + if ((getRemovePublicKeyMethod = CloudShellServiceGrpc.getRemovePublicKeyMethod) == null) { + synchronized (CloudShellServiceGrpc.class) { + if ((getRemovePublicKeyMethod = CloudShellServiceGrpc.getRemovePublicKeyMethod) == null) { + CloudShellServiceGrpc.getRemovePublicKeyMethod = + getRemovePublicKeyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RemovePublicKey")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.shell.v1.RemovePublicKeyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudShellServiceMethodDescriptorSupplier("RemovePublicKey")) + .build(); + } + } + } + return getRemovePublicKeyMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static CloudShellServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudShellServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudShellServiceStub(channel, callOptions); + } + }; + return CloudShellServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CloudShellServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudShellServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudShellServiceBlockingStub(channel, callOptions); + } + }; + return CloudShellServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static CloudShellServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudShellServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudShellServiceFutureStub(channel, callOptions); + } + }; + return CloudShellServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * API for interacting with Google Cloud Shell. Each user of Cloud Shell has at
+   * least one environment, which has the ID "default". Environment consists of a
+   * Docker image defining what is installed on the environment and a home
+   * directory containing the user's data that will remain across sessions.
+   * Clients use this API to start and fetch information about their environment,
+   * which can then be used to connect to that environment via a separate SSH
+   * client.
+   * 
+ */ + public abstract static class CloudShellServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Gets an environment. Returns NOT_FOUND if the environment does not exist.
+     * 
+ */ + public void getEnvironment( + com.google.cloud.shell.v1.GetEnvironmentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetEnvironmentMethod(), responseObserver); + } + + /** + * + * + *
+     * Starts an existing environment, allowing clients to connect to it. The
+     * returned operation will contain an instance of StartEnvironmentMetadata in
+     * its metadata field. Users can wait for the environment to start by polling
+     * this operation via GetOperation. Once the environment has finished starting
+     * and is ready to accept connections, the operation will contain a
+     * StartEnvironmentResponse in its response field.
+     * 
+ */ + public void startEnvironment( + com.google.cloud.shell.v1.StartEnvironmentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getStartEnvironmentMethod(), responseObserver); + } + + /** + * + * + *
+     * Sends OAuth credentials to a running environment on behalf of a user. When
+     * this completes, the environment will be authorized to run various Google
+     * Cloud command line tools without requiring the user to manually
+     * authenticate.
+     * 
+ */ + public void authorizeEnvironment( + com.google.cloud.shell.v1.AuthorizeEnvironmentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAuthorizeEnvironmentMethod(), responseObserver); + } + + /** + * + * + *
+     * Adds a public SSH key to an environment, allowing clients with the
+     * corresponding private key to connect to that environment via SSH. If a key
+     * with the same content already exists, this will error with ALREADY_EXISTS.
+     * 
+ */ + public void addPublicKey( + com.google.cloud.shell.v1.AddPublicKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAddPublicKeyMethod(), responseObserver); + } + + /** + * + * + *
+     * Removes a public SSH key from an environment. Clients will no longer be
+     * able to connect to the environment using the corresponding private key.
+     * If a key with the same content is not present, this will error with
+     * NOT_FOUND.
+     * 
+ */ + public void removePublicKey( + com.google.cloud.shell.v1.RemovePublicKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRemovePublicKeyMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetEnvironmentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.shell.v1.GetEnvironmentRequest, + com.google.cloud.shell.v1.Environment>(this, METHODID_GET_ENVIRONMENT))) + .addMethod( + getStartEnvironmentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.shell.v1.StartEnvironmentRequest, + com.google.longrunning.Operation>(this, METHODID_START_ENVIRONMENT))) + .addMethod( + getAuthorizeEnvironmentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.shell.v1.AuthorizeEnvironmentRequest, + com.google.longrunning.Operation>(this, METHODID_AUTHORIZE_ENVIRONMENT))) + .addMethod( + getAddPublicKeyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.shell.v1.AddPublicKeyRequest, + com.google.longrunning.Operation>(this, METHODID_ADD_PUBLIC_KEY))) + .addMethod( + getRemovePublicKeyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.shell.v1.RemovePublicKeyRequest, + com.google.longrunning.Operation>(this, METHODID_REMOVE_PUBLIC_KEY))) + .build(); + } + } + + /** + * + * + *
+   * API for interacting with Google Cloud Shell. Each user of Cloud Shell has at
+   * least one environment, which has the ID "default". Environment consists of a
+   * Docker image defining what is installed on the environment and a home
+   * directory containing the user's data that will remain across sessions.
+   * Clients use this API to start and fetch information about their environment,
+   * which can then be used to connect to that environment via a separate SSH
+   * client.
+   * 
+ */ + public static final class CloudShellServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private CloudShellServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudShellServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudShellServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets an environment. Returns NOT_FOUND if the environment does not exist.
+     * 
+ */ + public void getEnvironment( + com.google.cloud.shell.v1.GetEnvironmentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetEnvironmentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Starts an existing environment, allowing clients to connect to it. The
+     * returned operation will contain an instance of StartEnvironmentMetadata in
+     * its metadata field. Users can wait for the environment to start by polling
+     * this operation via GetOperation. Once the environment has finished starting
+     * and is ready to accept connections, the operation will contain a
+     * StartEnvironmentResponse in its response field.
+     * 
+ */ + public void startEnvironment( + com.google.cloud.shell.v1.StartEnvironmentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getStartEnvironmentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Sends OAuth credentials to a running environment on behalf of a user. When
+     * this completes, the environment will be authorized to run various Google
+     * Cloud command line tools without requiring the user to manually
+     * authenticate.
+     * 
+ */ + public void authorizeEnvironment( + com.google.cloud.shell.v1.AuthorizeEnvironmentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAuthorizeEnvironmentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Adds a public SSH key to an environment, allowing clients with the
+     * corresponding private key to connect to that environment via SSH. If a key
+     * with the same content already exists, this will error with ALREADY_EXISTS.
+     * 
+ */ + public void addPublicKey( + com.google.cloud.shell.v1.AddPublicKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAddPublicKeyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Removes a public SSH key from an environment. Clients will no longer be
+     * able to connect to the environment using the corresponding private key.
+     * If a key with the same content is not present, this will error with
+     * NOT_FOUND.
+     * 
+ */ + public void removePublicKey( + com.google.cloud.shell.v1.RemovePublicKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRemovePublicKeyMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * API for interacting with Google Cloud Shell. Each user of Cloud Shell has at
+   * least one environment, which has the ID "default". Environment consists of a
+   * Docker image defining what is installed on the environment and a home
+   * directory containing the user's data that will remain across sessions.
+   * Clients use this API to start and fetch information about their environment,
+   * which can then be used to connect to that environment via a separate SSH
+   * client.
+   * 
+ */ + public static final class CloudShellServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private CloudShellServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudShellServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudShellServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets an environment. Returns NOT_FOUND if the environment does not exist.
+     * 
+ */ + public com.google.cloud.shell.v1.Environment getEnvironment( + com.google.cloud.shell.v1.GetEnvironmentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetEnvironmentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Starts an existing environment, allowing clients to connect to it. The
+     * returned operation will contain an instance of StartEnvironmentMetadata in
+     * its metadata field. Users can wait for the environment to start by polling
+     * this operation via GetOperation. Once the environment has finished starting
+     * and is ready to accept connections, the operation will contain a
+     * StartEnvironmentResponse in its response field.
+     * 
+ */ + public com.google.longrunning.Operation startEnvironment( + com.google.cloud.shell.v1.StartEnvironmentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getStartEnvironmentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Sends OAuth credentials to a running environment on behalf of a user. When
+     * this completes, the environment will be authorized to run various Google
+     * Cloud command line tools without requiring the user to manually
+     * authenticate.
+     * 
+ */ + public com.google.longrunning.Operation authorizeEnvironment( + com.google.cloud.shell.v1.AuthorizeEnvironmentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAuthorizeEnvironmentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Adds a public SSH key to an environment, allowing clients with the
+     * corresponding private key to connect to that environment via SSH. If a key
+     * with the same content already exists, this will error with ALREADY_EXISTS.
+     * 
+ */ + public com.google.longrunning.Operation addPublicKey( + com.google.cloud.shell.v1.AddPublicKeyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAddPublicKeyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Removes a public SSH key from an environment. Clients will no longer be
+     * able to connect to the environment using the corresponding private key.
+     * If a key with the same content is not present, this will error with
+     * NOT_FOUND.
+     * 
+ */ + public com.google.longrunning.Operation removePublicKey( + com.google.cloud.shell.v1.RemovePublicKeyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRemovePublicKeyMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * API for interacting with Google Cloud Shell. Each user of Cloud Shell has at
+   * least one environment, which has the ID "default". Environment consists of a
+   * Docker image defining what is installed on the environment and a home
+   * directory containing the user's data that will remain across sessions.
+   * Clients use this API to start and fetch information about their environment,
+   * which can then be used to connect to that environment via a separate SSH
+   * client.
+   * 
+ */ + public static final class CloudShellServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private CloudShellServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudShellServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudShellServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets an environment. Returns NOT_FOUND if the environment does not exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getEnvironment(com.google.cloud.shell.v1.GetEnvironmentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetEnvironmentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Starts an existing environment, allowing clients to connect to it. The
+     * returned operation will contain an instance of StartEnvironmentMetadata in
+     * its metadata field. Users can wait for the environment to start by polling
+     * this operation via GetOperation. Once the environment has finished starting
+     * and is ready to accept connections, the operation will contain a
+     * StartEnvironmentResponse in its response field.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + startEnvironment(com.google.cloud.shell.v1.StartEnvironmentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getStartEnvironmentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Sends OAuth credentials to a running environment on behalf of a user. When
+     * this completes, the environment will be authorized to run various Google
+     * Cloud command line tools without requiring the user to manually
+     * authenticate.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + authorizeEnvironment(com.google.cloud.shell.v1.AuthorizeEnvironmentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAuthorizeEnvironmentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Adds a public SSH key to an environment, allowing clients with the
+     * corresponding private key to connect to that environment via SSH. If a key
+     * with the same content already exists, this will error with ALREADY_EXISTS.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + addPublicKey(com.google.cloud.shell.v1.AddPublicKeyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAddPublicKeyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Removes a public SSH key from an environment. Clients will no longer be
+     * able to connect to the environment using the corresponding private key.
+     * If a key with the same content is not present, this will error with
+     * NOT_FOUND.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + removePublicKey(com.google.cloud.shell.v1.RemovePublicKeyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRemovePublicKeyMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_ENVIRONMENT = 0; + private static final int METHODID_START_ENVIRONMENT = 1; + private static final int METHODID_AUTHORIZE_ENVIRONMENT = 2; + private static final int METHODID_ADD_PUBLIC_KEY = 3; + private static final int METHODID_REMOVE_PUBLIC_KEY = 4; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final CloudShellServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(CloudShellServiceImplBase 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_GET_ENVIRONMENT: + serviceImpl.getEnvironment( + (com.google.cloud.shell.v1.GetEnvironmentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_START_ENVIRONMENT: + serviceImpl.startEnvironment( + (com.google.cloud.shell.v1.StartEnvironmentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_AUTHORIZE_ENVIRONMENT: + serviceImpl.authorizeEnvironment( + (com.google.cloud.shell.v1.AuthorizeEnvironmentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ADD_PUBLIC_KEY: + serviceImpl.addPublicKey( + (com.google.cloud.shell.v1.AddPublicKeyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REMOVE_PUBLIC_KEY: + serviceImpl.removePublicKey( + (com.google.cloud.shell.v1.RemovePublicKeyRequest) 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 CloudShellServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CloudShellServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CloudShellService"); + } + } + + private static final class CloudShellServiceFileDescriptorSupplier + extends CloudShellServiceBaseDescriptorSupplier { + CloudShellServiceFileDescriptorSupplier() {} + } + + private static final class CloudShellServiceMethodDescriptorSupplier + extends CloudShellServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + CloudShellServiceMethodDescriptorSupplier(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 (CloudShellServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new CloudShellServiceFileDescriptorSupplier()) + .addMethod(getGetEnvironmentMethod()) + .addMethod(getStartEnvironmentMethod()) + .addMethod(getAuthorizeEnvironmentMethod()) + .addMethod(getAddPublicKeyMethod()) + .addMethod(getRemovePublicKeyMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java.header b/java.header new file mode 100644 index 00000000..3a9b503a --- /dev/null +++ b/java.header @@ -0,0 +1,15 @@ +^/\*$ +^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)( All [rR]ights [rR]eserved\.)?$ +^ \*$ +^ \* Licensed under the Apache License, Version 2\.0 \(the "License"\);$ +^ \* you may not use this file except in compliance with the License\.$ +^ \* You may obtain a copy of the License at$ +^ \*$ +^ \*[ ]+https?://www.apache.org/licenses/LICENSE-2\.0$ +^ \*$ +^ \* Unless required by applicable law or agreed to in writing, software$ +^ \* distributed under the License is distributed on an "AS IS" BASIS,$ +^ \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.$ +^ \* See the License for the specific language governing permissions and$ +^ \* limitations under the License\.$ +^ \*/$ diff --git a/license-checks.xml b/license-checks.xml new file mode 100644 index 00000000..6597fced --- /dev/null +++ b/license-checks.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/owlbot.py b/owlbot.py new file mode 100644 index 00000000..77243461 --- /dev/null +++ b/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/pom.xml b/pom.xml new file mode 100644 index 00000000..251ecae8 --- /dev/null +++ b/pom.xml @@ -0,0 +1,179 @@ + + + 4.0.0 + com.google.cloud + google-cloud-shell-parent + pom + 0.0.1-SNAPSHOT + Google Cloud Shell Parent + https://github.com/googleapis/java-shell + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-shared-config + 0.11.0 + + + + + chingor + Jeff Ching + chingor@google.com + Google + + Developer + + + + + Google LLC + + + scm:git:git@github.com:googleapis/java-shell.git + scm:git:git@github.com:googleapis/java-shell.git + https://github.com/googleapis/java-shell + HEAD + + + https://github.com/googleapis/java-shell/issues + GitHub Issues + + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + UTF-8 + UTF-8 + github + google-cloud-shell-parent + + + + + + com.google.cloud + google-cloud-shell + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-shell-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-shell-v1 + 0.0.1-SNAPSHOT + + + + com.google.cloud + google-cloud-shared-dependencies + 0.20.1 + pom + import + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + org.objenesis:objenesis + javax.annotation:javax.annotation-api + + + + + + + + + google-cloud-shell + grpc-google-cloud-shell-v1 + proto-google-cloud-shell-v1 + google-cloud-shell-bom + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.1.1 + + + + index + dependency-info + team + ci-management + issue-management + licenses + scm + dependency-management + distribution-management + summary + modules + + + + + true + ${site.installationModule} + jar + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + html + + aggregate + javadoc + + + + + none + protected + true + ${project.build.directory}/javadoc + + + Test helpers packages + com.google.cloud.testing + + + SPI packages + com.google.cloud.spi* + + + + + https://grpc.io/grpc-java/javadoc/ + https://developers.google.com/protocol-buffers/docs/reference/java/ + https://googleapis.dev/java/google-auth-library/latest/ + https://googleapis.dev/java/gax/latest/ + https://googleapis.github.io/api-common-java/${google.api-common.version}/apidocs/ + + + + + + \ No newline at end of file diff --git a/proto-google-cloud-shell-v1/clirr-ignored-differences.xml b/proto-google-cloud-shell-v1/clirr-ignored-differences.xml new file mode 100644 index 00000000..d1420842 --- /dev/null +++ b/proto-google-cloud-shell-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/shell/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/shell/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/shell/v1/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-shell-v1/pom.xml b/proto-google-cloud-shell-v1/pom.xml new file mode 100644 index 00000000..84cd7834 --- /dev/null +++ b/proto-google-cloud-shell-v1/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-shell-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-shell-v1 + Proto library for google-cloud-shell + + com.google.cloud + google-cloud-shell-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/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyMetadata.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyMetadata.java new file mode 100644 index 00000000..5e00e64f --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyMetadata.java @@ -0,0 +1,456 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +/** + * + * + *
+ * Message included in the metadata field of operations returned from
+ * [AddPublicKey][google.cloud.shell.v1.CloudShellService.AddPublicKey].
+ * 
+ * + * Protobuf type {@code google.cloud.shell.v1.AddPublicKeyMetadata} + */ +public final class AddPublicKeyMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.shell.v1.AddPublicKeyMetadata) + AddPublicKeyMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddPublicKeyMetadata.newBuilder() to construct. + private AddPublicKeyMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddPublicKeyMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddPublicKeyMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AddPublicKeyMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AddPublicKeyMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AddPublicKeyMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.AddPublicKeyMetadata.class, + com.google.cloud.shell.v1.AddPublicKeyMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.shell.v1.AddPublicKeyMetadata)) { + return super.equals(obj); + } + com.google.cloud.shell.v1.AddPublicKeyMetadata other = + (com.google.cloud.shell.v1.AddPublicKeyMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.shell.v1.AddPublicKeyMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.AddPublicKeyMetadata 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.shell.v1.AddPublicKeyMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.AddPublicKeyMetadata 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.shell.v1.AddPublicKeyMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.AddPublicKeyMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.shell.v1.AddPublicKeyMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.AddPublicKeyMetadata 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.shell.v1.AddPublicKeyMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.AddPublicKeyMetadata 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.shell.v1.AddPublicKeyMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.AddPublicKeyMetadata 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.shell.v1.AddPublicKeyMetadata 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 included in the metadata field of operations returned from
+   * [AddPublicKey][google.cloud.shell.v1.CloudShellService.AddPublicKey].
+   * 
+ * + * Protobuf type {@code google.cloud.shell.v1.AddPublicKeyMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.shell.v1.AddPublicKeyMetadata) + com.google.cloud.shell.v1.AddPublicKeyMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AddPublicKeyMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AddPublicKeyMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.AddPublicKeyMetadata.class, + com.google.cloud.shell.v1.AddPublicKeyMetadata.Builder.class); + } + + // Construct using com.google.cloud.shell.v1.AddPublicKeyMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AddPublicKeyMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.shell.v1.AddPublicKeyMetadata getDefaultInstanceForType() { + return com.google.cloud.shell.v1.AddPublicKeyMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.shell.v1.AddPublicKeyMetadata build() { + com.google.cloud.shell.v1.AddPublicKeyMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.shell.v1.AddPublicKeyMetadata buildPartial() { + com.google.cloud.shell.v1.AddPublicKeyMetadata result = + new com.google.cloud.shell.v1.AddPublicKeyMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.shell.v1.AddPublicKeyMetadata) { + return mergeFrom((com.google.cloud.shell.v1.AddPublicKeyMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.shell.v1.AddPublicKeyMetadata other) { + if (other == com.google.cloud.shell.v1.AddPublicKeyMetadata.getDefaultInstance()) return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.shell.v1.AddPublicKeyMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.shell.v1.AddPublicKeyMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.shell.v1.AddPublicKeyMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.shell.v1.AddPublicKeyMetadata) + private static final com.google.cloud.shell.v1.AddPublicKeyMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.shell.v1.AddPublicKeyMetadata(); + } + + public static com.google.cloud.shell.v1.AddPublicKeyMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddPublicKeyMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddPublicKeyMetadata(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.shell.v1.AddPublicKeyMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyMetadataOrBuilder.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyMetadataOrBuilder.java new file mode 100644 index 00000000..8c052e71 --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +public interface AddPublicKeyMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.shell.v1.AddPublicKeyMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyRequest.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyRequest.java new file mode 100644 index 00000000..d14be45e --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyRequest.java @@ -0,0 +1,857 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +/** + * + * + *
+ * Request message for
+ * [AddPublicKey][google.cloud.shell.v1.CloudShellService.AddPublicKey].
+ * 
+ * + * Protobuf type {@code google.cloud.shell.v1.AddPublicKeyRequest} + */ +public final class AddPublicKeyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.shell.v1.AddPublicKeyRequest) + AddPublicKeyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddPublicKeyRequest.newBuilder() to construct. + private AddPublicKeyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddPublicKeyRequest() { + environment_ = ""; + key_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddPublicKeyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AddPublicKeyRequest( + 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(); + + environment_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AddPublicKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AddPublicKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.AddPublicKeyRequest.class, + com.google.cloud.shell.v1.AddPublicKeyRequest.Builder.class); + } + + public static final int ENVIRONMENT_FIELD_NUMBER = 1; + private volatile java.lang.Object environment_; + /** + * + * + *
+   * Environment this key should be added to, e.g.
+   * `users/me/environments/default`.
+   * 
+ * + * string environment = 1; + * + * @return The environment. + */ + @java.lang.Override + public java.lang.String getEnvironment() { + java.lang.Object ref = environment_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + environment_ = s; + return s; + } + } + /** + * + * + *
+   * Environment this key should be added to, e.g.
+   * `users/me/environments/default`.
+   * 
+ * + * string environment = 1; + * + * @return The bytes for environment. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEnvironmentBytes() { + java.lang.Object ref = environment_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + environment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KEY_FIELD_NUMBER = 2; + private volatile java.lang.Object key_; + /** + * + * + *
+   * Key that should be added to the environment. Supported formats are
+   * `ssh-dss` (see RFC4253), `ssh-rsa` (see RFC4253), `ecdsa-sha2-nistp256`
+   * (see RFC5656), `ecdsa-sha2-nistp384` (see RFC5656) and
+   * `ecdsa-sha2-nistp521` (see RFC5656). It should be structured as
+   * &lt;format&gt; &lt;content&gt;, where &lt;content&gt; part is encoded with
+   * Base64.
+   * 
+ * + * string key = 2; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * + * + *
+   * Key that should be added to the environment. Supported formats are
+   * `ssh-dss` (see RFC4253), `ssh-rsa` (see RFC4253), `ecdsa-sha2-nistp256`
+   * (see RFC5656), `ecdsa-sha2-nistp384` (see RFC5656) and
+   * `ecdsa-sha2-nistp521` (see RFC5656). It should be structured as
+   * &lt;format&gt; &lt;content&gt;, where &lt;content&gt; part is encoded with
+   * Base64.
+   * 
+ * + * string key = 2; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = 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 (!getEnvironmentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, environment_); + } + if (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, key_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getEnvironmentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, environment_); + } + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, key_); + } + 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.shell.v1.AddPublicKeyRequest)) { + return super.equals(obj); + } + com.google.cloud.shell.v1.AddPublicKeyRequest other = + (com.google.cloud.shell.v1.AddPublicKeyRequest) obj; + + if (!getEnvironment().equals(other.getEnvironment())) return false; + if (!getKey().equals(other.getKey())) 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) + ENVIRONMENT_FIELD_NUMBER; + hash = (53 * hash) + getEnvironment().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.shell.v1.AddPublicKeyRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.AddPublicKeyRequest 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.shell.v1.AddPublicKeyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.AddPublicKeyRequest 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.shell.v1.AddPublicKeyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.AddPublicKeyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.shell.v1.AddPublicKeyRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.AddPublicKeyRequest 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.shell.v1.AddPublicKeyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.AddPublicKeyRequest 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.shell.v1.AddPublicKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.AddPublicKeyRequest 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.shell.v1.AddPublicKeyRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [AddPublicKey][google.cloud.shell.v1.CloudShellService.AddPublicKey].
+   * 
+ * + * Protobuf type {@code google.cloud.shell.v1.AddPublicKeyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.shell.v1.AddPublicKeyRequest) + com.google.cloud.shell.v1.AddPublicKeyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AddPublicKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AddPublicKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.AddPublicKeyRequest.class, + com.google.cloud.shell.v1.AddPublicKeyRequest.Builder.class); + } + + // Construct using com.google.cloud.shell.v1.AddPublicKeyRequest.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(); + environment_ = ""; + + key_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AddPublicKeyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.shell.v1.AddPublicKeyRequest getDefaultInstanceForType() { + return com.google.cloud.shell.v1.AddPublicKeyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.shell.v1.AddPublicKeyRequest build() { + com.google.cloud.shell.v1.AddPublicKeyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.shell.v1.AddPublicKeyRequest buildPartial() { + com.google.cloud.shell.v1.AddPublicKeyRequest result = + new com.google.cloud.shell.v1.AddPublicKeyRequest(this); + result.environment_ = environment_; + result.key_ = key_; + 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.shell.v1.AddPublicKeyRequest) { + return mergeFrom((com.google.cloud.shell.v1.AddPublicKeyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.shell.v1.AddPublicKeyRequest other) { + if (other == com.google.cloud.shell.v1.AddPublicKeyRequest.getDefaultInstance()) return this; + if (!other.getEnvironment().isEmpty()) { + environment_ = other.environment_; + onChanged(); + } + if (!other.getKey().isEmpty()) { + key_ = other.key_; + 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.shell.v1.AddPublicKeyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.shell.v1.AddPublicKeyRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object environment_ = ""; + /** + * + * + *
+     * Environment this key should be added to, e.g.
+     * `users/me/environments/default`.
+     * 
+ * + * string environment = 1; + * + * @return The environment. + */ + public java.lang.String getEnvironment() { + java.lang.Object ref = environment_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + environment_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Environment this key should be added to, e.g.
+     * `users/me/environments/default`.
+     * 
+ * + * string environment = 1; + * + * @return The bytes for environment. + */ + public com.google.protobuf.ByteString getEnvironmentBytes() { + java.lang.Object ref = environment_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + environment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Environment this key should be added to, e.g.
+     * `users/me/environments/default`.
+     * 
+ * + * string environment = 1; + * + * @param value The environment to set. + * @return This builder for chaining. + */ + public Builder setEnvironment(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + environment_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Environment this key should be added to, e.g.
+     * `users/me/environments/default`.
+     * 
+ * + * string environment = 1; + * + * @return This builder for chaining. + */ + public Builder clearEnvironment() { + + environment_ = getDefaultInstance().getEnvironment(); + onChanged(); + return this; + } + /** + * + * + *
+     * Environment this key should be added to, e.g.
+     * `users/me/environments/default`.
+     * 
+ * + * string environment = 1; + * + * @param value The bytes for environment to set. + * @return This builder for chaining. + */ + public Builder setEnvironmentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + environment_ = value; + onChanged(); + return this; + } + + private java.lang.Object key_ = ""; + /** + * + * + *
+     * Key that should be added to the environment. Supported formats are
+     * `ssh-dss` (see RFC4253), `ssh-rsa` (see RFC4253), `ecdsa-sha2-nistp256`
+     * (see RFC5656), `ecdsa-sha2-nistp384` (see RFC5656) and
+     * `ecdsa-sha2-nistp521` (see RFC5656). It should be structured as
+     * &lt;format&gt; &lt;content&gt;, where &lt;content&gt; part is encoded with
+     * Base64.
+     * 
+ * + * string key = 2; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Key that should be added to the environment. Supported formats are
+     * `ssh-dss` (see RFC4253), `ssh-rsa` (see RFC4253), `ecdsa-sha2-nistp256`
+     * (see RFC5656), `ecdsa-sha2-nistp384` (see RFC5656) and
+     * `ecdsa-sha2-nistp521` (see RFC5656). It should be structured as
+     * &lt;format&gt; &lt;content&gt;, where &lt;content&gt; part is encoded with
+     * Base64.
+     * 
+ * + * string key = 2; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Key that should be added to the environment. Supported formats are
+     * `ssh-dss` (see RFC4253), `ssh-rsa` (see RFC4253), `ecdsa-sha2-nistp256`
+     * (see RFC5656), `ecdsa-sha2-nistp384` (see RFC5656) and
+     * `ecdsa-sha2-nistp521` (see RFC5656). It should be structured as
+     * &lt;format&gt; &lt;content&gt;, where &lt;content&gt; part is encoded with
+     * Base64.
+     * 
+ * + * string key = 2; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Key that should be added to the environment. Supported formats are
+     * `ssh-dss` (see RFC4253), `ssh-rsa` (see RFC4253), `ecdsa-sha2-nistp256`
+     * (see RFC5656), `ecdsa-sha2-nistp384` (see RFC5656) and
+     * `ecdsa-sha2-nistp521` (see RFC5656). It should be structured as
+     * &lt;format&gt; &lt;content&gt;, where &lt;content&gt; part is encoded with
+     * Base64.
+     * 
+ * + * string key = 2; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * + * + *
+     * Key that should be added to the environment. Supported formats are
+     * `ssh-dss` (see RFC4253), `ssh-rsa` (see RFC4253), `ecdsa-sha2-nistp256`
+     * (see RFC5656), `ecdsa-sha2-nistp384` (see RFC5656) and
+     * `ecdsa-sha2-nistp521` (see RFC5656). It should be structured as
+     * &lt;format&gt; &lt;content&gt;, where &lt;content&gt; part is encoded with
+     * Base64.
+     * 
+ * + * string key = 2; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = 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.shell.v1.AddPublicKeyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.shell.v1.AddPublicKeyRequest) + private static final com.google.cloud.shell.v1.AddPublicKeyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.shell.v1.AddPublicKeyRequest(); + } + + public static com.google.cloud.shell.v1.AddPublicKeyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddPublicKeyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddPublicKeyRequest(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.shell.v1.AddPublicKeyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyRequestOrBuilder.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyRequestOrBuilder.java new file mode 100644 index 00000000..29d97f9e --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyRequestOrBuilder.java @@ -0,0 +1,87 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +public interface AddPublicKeyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.shell.v1.AddPublicKeyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Environment this key should be added to, e.g.
+   * `users/me/environments/default`.
+   * 
+ * + * string environment = 1; + * + * @return The environment. + */ + java.lang.String getEnvironment(); + /** + * + * + *
+   * Environment this key should be added to, e.g.
+   * `users/me/environments/default`.
+   * 
+ * + * string environment = 1; + * + * @return The bytes for environment. + */ + com.google.protobuf.ByteString getEnvironmentBytes(); + + /** + * + * + *
+   * Key that should be added to the environment. Supported formats are
+   * `ssh-dss` (see RFC4253), `ssh-rsa` (see RFC4253), `ecdsa-sha2-nistp256`
+   * (see RFC5656), `ecdsa-sha2-nistp384` (see RFC5656) and
+   * `ecdsa-sha2-nistp521` (see RFC5656). It should be structured as
+   * &lt;format&gt; &lt;content&gt;, where &lt;content&gt; part is encoded with
+   * Base64.
+   * 
+ * + * string key = 2; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+   * Key that should be added to the environment. Supported formats are
+   * `ssh-dss` (see RFC4253), `ssh-rsa` (see RFC4253), `ecdsa-sha2-nistp256`
+   * (see RFC5656), `ecdsa-sha2-nistp384` (see RFC5656) and
+   * `ecdsa-sha2-nistp521` (see RFC5656). It should be structured as
+   * &lt;format&gt; &lt;content&gt;, where &lt;content&gt; part is encoded with
+   * Base64.
+   * 
+ * + * string key = 2; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyResponse.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyResponse.java new file mode 100644 index 00000000..059ef08e --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyResponse.java @@ -0,0 +1,636 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +/** + * + * + *
+ * Response message for
+ * [AddPublicKey][google.cloud.shell.v1.CloudShellService.AddPublicKey].
+ * 
+ * + * Protobuf type {@code google.cloud.shell.v1.AddPublicKeyResponse} + */ +public final class AddPublicKeyResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.shell.v1.AddPublicKeyResponse) + AddPublicKeyResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddPublicKeyResponse.newBuilder() to construct. + private AddPublicKeyResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddPublicKeyResponse() { + key_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddPublicKeyResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AddPublicKeyResponse( + 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(); + + key_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AddPublicKeyResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AddPublicKeyResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.AddPublicKeyResponse.class, + com.google.cloud.shell.v1.AddPublicKeyResponse.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * + * + *
+   * Key that was added to the environment.
+   * 
+ * + * string key = 1; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * + * + *
+   * Key that was added to the environment.
+   * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = 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 (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + 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.shell.v1.AddPublicKeyResponse)) { + return super.equals(obj); + } + com.google.cloud.shell.v1.AddPublicKeyResponse other = + (com.google.cloud.shell.v1.AddPublicKeyResponse) obj; + + if (!getKey().equals(other.getKey())) 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) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.shell.v1.AddPublicKeyResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.AddPublicKeyResponse 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.shell.v1.AddPublicKeyResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.AddPublicKeyResponse 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.shell.v1.AddPublicKeyResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.AddPublicKeyResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.shell.v1.AddPublicKeyResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.AddPublicKeyResponse 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.shell.v1.AddPublicKeyResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.AddPublicKeyResponse 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.shell.v1.AddPublicKeyResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.AddPublicKeyResponse 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.shell.v1.AddPublicKeyResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for
+   * [AddPublicKey][google.cloud.shell.v1.CloudShellService.AddPublicKey].
+   * 
+ * + * Protobuf type {@code google.cloud.shell.v1.AddPublicKeyResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.shell.v1.AddPublicKeyResponse) + com.google.cloud.shell.v1.AddPublicKeyResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AddPublicKeyResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AddPublicKeyResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.AddPublicKeyResponse.class, + com.google.cloud.shell.v1.AddPublicKeyResponse.Builder.class); + } + + // Construct using com.google.cloud.shell.v1.AddPublicKeyResponse.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(); + key_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AddPublicKeyResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.shell.v1.AddPublicKeyResponse getDefaultInstanceForType() { + return com.google.cloud.shell.v1.AddPublicKeyResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.shell.v1.AddPublicKeyResponse build() { + com.google.cloud.shell.v1.AddPublicKeyResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.shell.v1.AddPublicKeyResponse buildPartial() { + com.google.cloud.shell.v1.AddPublicKeyResponse result = + new com.google.cloud.shell.v1.AddPublicKeyResponse(this); + result.key_ = key_; + 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.shell.v1.AddPublicKeyResponse) { + return mergeFrom((com.google.cloud.shell.v1.AddPublicKeyResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.shell.v1.AddPublicKeyResponse other) { + if (other == com.google.cloud.shell.v1.AddPublicKeyResponse.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + 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.shell.v1.AddPublicKeyResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.shell.v1.AddPublicKeyResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object key_ = ""; + /** + * + * + *
+     * Key that was added to the environment.
+     * 
+ * + * string key = 1; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Key that was added to the environment.
+     * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Key that was added to the environment.
+     * 
+ * + * string key = 1; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Key that was added to the environment.
+     * 
+ * + * string key = 1; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * + * + *
+     * Key that was added to the environment.
+     * 
+ * + * string key = 1; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = 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.shell.v1.AddPublicKeyResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.shell.v1.AddPublicKeyResponse) + private static final com.google.cloud.shell.v1.AddPublicKeyResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.shell.v1.AddPublicKeyResponse(); + } + + public static com.google.cloud.shell.v1.AddPublicKeyResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddPublicKeyResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddPublicKeyResponse(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.shell.v1.AddPublicKeyResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyResponseOrBuilder.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyResponseOrBuilder.java new file mode 100644 index 00000000..99937918 --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AddPublicKeyResponseOrBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +public interface AddPublicKeyResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.shell.v1.AddPublicKeyResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Key that was added to the environment.
+   * 
+ * + * string key = 1; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+   * Key that was added to the environment.
+   * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentMetadata.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentMetadata.java new file mode 100644 index 00000000..4802914a --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentMetadata.java @@ -0,0 +1,459 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +/** + * + * + *
+ * Message included in the metadata field of operations returned from
+ * [AuthorizeEnvironment][google.cloud.shell.v1.CloudShellService.AuthorizeEnvironment].
+ * 
+ * + * Protobuf type {@code google.cloud.shell.v1.AuthorizeEnvironmentMetadata} + */ +public final class AuthorizeEnvironmentMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.shell.v1.AuthorizeEnvironmentMetadata) + AuthorizeEnvironmentMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use AuthorizeEnvironmentMetadata.newBuilder() to construct. + private AuthorizeEnvironmentMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AuthorizeEnvironmentMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AuthorizeEnvironmentMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AuthorizeEnvironmentMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AuthorizeEnvironmentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AuthorizeEnvironmentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata.class, + com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata)) { + return super.equals(obj); + } + com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata other = + (com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata 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.shell.v1.AuthorizeEnvironmentMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata 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.shell.v1.AuthorizeEnvironmentMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata 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.shell.v1.AuthorizeEnvironmentMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata 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.shell.v1.AuthorizeEnvironmentMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata 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.shell.v1.AuthorizeEnvironmentMetadata 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 included in the metadata field of operations returned from
+   * [AuthorizeEnvironment][google.cloud.shell.v1.CloudShellService.AuthorizeEnvironment].
+   * 
+ * + * Protobuf type {@code google.cloud.shell.v1.AuthorizeEnvironmentMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.shell.v1.AuthorizeEnvironmentMetadata) + com.google.cloud.shell.v1.AuthorizeEnvironmentMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AuthorizeEnvironmentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AuthorizeEnvironmentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata.class, + com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata.Builder.class); + } + + // Construct using com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AuthorizeEnvironmentMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata getDefaultInstanceForType() { + return com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata build() { + com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata buildPartial() { + com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata result = + new com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata) { + return mergeFrom((com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata other) { + if (other == com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.shell.v1.AuthorizeEnvironmentMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.shell.v1.AuthorizeEnvironmentMetadata) + private static final com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata(); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AuthorizeEnvironmentMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AuthorizeEnvironmentMetadata(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.shell.v1.AuthorizeEnvironmentMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentMetadataOrBuilder.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentMetadataOrBuilder.java new file mode 100644 index 00000000..d9de3502 --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +public interface AuthorizeEnvironmentMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.shell.v1.AuthorizeEnvironmentMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentRequest.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentRequest.java new file mode 100644 index 00000000..7f364f23 --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentRequest.java @@ -0,0 +1,1295 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +/** + * + * + *
+ * Request message for
+ * [AuthorizeEnvironment][google.cloud.shell.v1.CloudShellService.AuthorizeEnvironment].
+ * 
+ * + * Protobuf type {@code google.cloud.shell.v1.AuthorizeEnvironmentRequest} + */ +public final class AuthorizeEnvironmentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.shell.v1.AuthorizeEnvironmentRequest) + AuthorizeEnvironmentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use AuthorizeEnvironmentRequest.newBuilder() to construct. + private AuthorizeEnvironmentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AuthorizeEnvironmentRequest() { + name_ = ""; + accessToken_ = ""; + idToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AuthorizeEnvironmentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AuthorizeEnvironmentRequest( + 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(); + + accessToken_ = s; + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (expireTime_ != null) { + subBuilder = expireTime_.toBuilder(); + } + expireTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(expireTime_); + expireTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + idToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AuthorizeEnvironmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AuthorizeEnvironmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.AuthorizeEnvironmentRequest.class, + com.google.cloud.shell.v1.AuthorizeEnvironmentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Name of the resource that should receive the credentials, for example
+   * `users/me/environments/default` or
+   * `users/someone@example.com/environments/default`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the resource that should receive the credentials, for example
+   * `users/me/environments/default` or
+   * `users/someone@example.com/environments/default`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACCESS_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object accessToken_; + /** + * + * + *
+   * The OAuth access token that should be sent to the environment.
+   * 
+ * + * string access_token = 2; + * + * @return The accessToken. + */ + @java.lang.Override + public java.lang.String getAccessToken() { + java.lang.Object ref = accessToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + accessToken_ = s; + return s; + } + } + /** + * + * + *
+   * The OAuth access token that should be sent to the environment.
+   * 
+ * + * string access_token = 2; + * + * @return The bytes for accessToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAccessTokenBytes() { + java.lang.Object ref = accessToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + accessToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ID_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object idToken_; + /** + * + * + *
+   * The OAuth ID token that should be sent to the environment.
+   * 
+ * + * string id_token = 4; + * + * @return The idToken. + */ + @java.lang.Override + public java.lang.String getIdToken() { + java.lang.Object ref = idToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + idToken_ = s; + return s; + } + } + /** + * + * + *
+   * The OAuth ID token that should be sent to the environment.
+   * 
+ * + * string id_token = 4; + * + * @return The bytes for idToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdTokenBytes() { + java.lang.Object ref = idToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + idToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXPIRE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp expireTime_; + /** + * + * + *
+   * The time when the credentials expire. If not set, defaults to one hour from
+   * when the server received the request.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return expireTime_ != null; + } + /** + * + * + *
+   * The time when the credentials expire. If not set, defaults to one hour from
+   * when the server received the request.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + /** + * + * + *
+   * The time when the credentials expire. If not set, defaults to one hour from
+   * when the server received the request.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + return getExpireTime(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getAccessTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, accessToken_); + } + if (expireTime_ != null) { + output.writeMessage(3, getExpireTime()); + } + if (!getIdTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, idToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getAccessTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, accessToken_); + } + if (expireTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getExpireTime()); + } + if (!getIdTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, idToken_); + } + 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.shell.v1.AuthorizeEnvironmentRequest)) { + return super.equals(obj); + } + com.google.cloud.shell.v1.AuthorizeEnvironmentRequest other = + (com.google.cloud.shell.v1.AuthorizeEnvironmentRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getAccessToken().equals(other.getAccessToken())) return false; + if (!getIdToken().equals(other.getIdToken())) return false; + if (hasExpireTime() != other.hasExpireTime()) return false; + if (hasExpireTime()) { + if (!getExpireTime().equals(other.getExpireTime())) 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) + ACCESS_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getAccessToken().hashCode(); + hash = (37 * hash) + ID_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getIdToken().hashCode(); + if (hasExpireTime()) { + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentRequest 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.shell.v1.AuthorizeEnvironmentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentRequest 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.shell.v1.AuthorizeEnvironmentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentRequest 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.shell.v1.AuthorizeEnvironmentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentRequest 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.shell.v1.AuthorizeEnvironmentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentRequest 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.shell.v1.AuthorizeEnvironmentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [AuthorizeEnvironment][google.cloud.shell.v1.CloudShellService.AuthorizeEnvironment].
+   * 
+ * + * Protobuf type {@code google.cloud.shell.v1.AuthorizeEnvironmentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.shell.v1.AuthorizeEnvironmentRequest) + com.google.cloud.shell.v1.AuthorizeEnvironmentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AuthorizeEnvironmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AuthorizeEnvironmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.AuthorizeEnvironmentRequest.class, + com.google.cloud.shell.v1.AuthorizeEnvironmentRequest.Builder.class); + } + + // Construct using com.google.cloud.shell.v1.AuthorizeEnvironmentRequest.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_ = ""; + + accessToken_ = ""; + + idToken_ = ""; + + if (expireTimeBuilder_ == null) { + expireTime_ = null; + } else { + expireTime_ = null; + expireTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AuthorizeEnvironmentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.shell.v1.AuthorizeEnvironmentRequest getDefaultInstanceForType() { + return com.google.cloud.shell.v1.AuthorizeEnvironmentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.shell.v1.AuthorizeEnvironmentRequest build() { + com.google.cloud.shell.v1.AuthorizeEnvironmentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.shell.v1.AuthorizeEnvironmentRequest buildPartial() { + com.google.cloud.shell.v1.AuthorizeEnvironmentRequest result = + new com.google.cloud.shell.v1.AuthorizeEnvironmentRequest(this); + result.name_ = name_; + result.accessToken_ = accessToken_; + result.idToken_ = idToken_; + if (expireTimeBuilder_ == null) { + result.expireTime_ = expireTime_; + } else { + result.expireTime_ = expireTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.shell.v1.AuthorizeEnvironmentRequest) { + return mergeFrom((com.google.cloud.shell.v1.AuthorizeEnvironmentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.shell.v1.AuthorizeEnvironmentRequest other) { + if (other == com.google.cloud.shell.v1.AuthorizeEnvironmentRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getAccessToken().isEmpty()) { + accessToken_ = other.accessToken_; + onChanged(); + } + if (!other.getIdToken().isEmpty()) { + idToken_ = other.idToken_; + onChanged(); + } + if (other.hasExpireTime()) { + mergeExpireTime(other.getExpireTime()); + } + 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.shell.v1.AuthorizeEnvironmentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.shell.v1.AuthorizeEnvironmentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Name of the resource that should receive the credentials, for example
+     * `users/me/environments/default` or
+     * `users/someone@example.com/environments/default`.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the resource that should receive the credentials, for example
+     * `users/me/environments/default` or
+     * `users/someone@example.com/environments/default`.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the resource that should receive the credentials, for example
+     * `users/me/environments/default` or
+     * `users/someone@example.com/environments/default`.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the resource that should receive the credentials, for example
+     * `users/me/environments/default` or
+     * `users/someone@example.com/environments/default`.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the resource that should receive the credentials, for example
+     * `users/me/environments/default` or
+     * `users/someone@example.com/environments/default`.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object accessToken_ = ""; + /** + * + * + *
+     * The OAuth access token that should be sent to the environment.
+     * 
+ * + * string access_token = 2; + * + * @return The accessToken. + */ + public java.lang.String getAccessToken() { + java.lang.Object ref = accessToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + accessToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The OAuth access token that should be sent to the environment.
+     * 
+ * + * string access_token = 2; + * + * @return The bytes for accessToken. + */ + public com.google.protobuf.ByteString getAccessTokenBytes() { + java.lang.Object ref = accessToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + accessToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The OAuth access token that should be sent to the environment.
+     * 
+ * + * string access_token = 2; + * + * @param value The accessToken to set. + * @return This builder for chaining. + */ + public Builder setAccessToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + accessToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The OAuth access token that should be sent to the environment.
+     * 
+ * + * string access_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearAccessToken() { + + accessToken_ = getDefaultInstance().getAccessToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The OAuth access token that should be sent to the environment.
+     * 
+ * + * string access_token = 2; + * + * @param value The bytes for accessToken to set. + * @return This builder for chaining. + */ + public Builder setAccessTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + accessToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object idToken_ = ""; + /** + * + * + *
+     * The OAuth ID token that should be sent to the environment.
+     * 
+ * + * string id_token = 4; + * + * @return The idToken. + */ + public java.lang.String getIdToken() { + java.lang.Object ref = idToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + idToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The OAuth ID token that should be sent to the environment.
+     * 
+ * + * string id_token = 4; + * + * @return The bytes for idToken. + */ + public com.google.protobuf.ByteString getIdTokenBytes() { + java.lang.Object ref = idToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + idToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The OAuth ID token that should be sent to the environment.
+     * 
+ * + * string id_token = 4; + * + * @param value The idToken to set. + * @return This builder for chaining. + */ + public Builder setIdToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + idToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The OAuth ID token that should be sent to the environment.
+     * 
+ * + * string id_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearIdToken() { + + idToken_ = getDefaultInstance().getIdToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The OAuth ID token that should be sent to the environment.
+     * 
+ * + * string id_token = 4; + * + * @param value The bytes for idToken to set. + * @return This builder for chaining. + */ + public Builder setIdTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + idToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp expireTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expireTimeBuilder_; + /** + * + * + *
+     * The time when the credentials expire. If not set, defaults to one hour from
+     * when the server received the request.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + * + * @return Whether the expireTime field is set. + */ + public boolean hasExpireTime() { + return expireTimeBuilder_ != null || expireTime_ != null; + } + /** + * + * + *
+     * The time when the credentials expire. If not set, defaults to one hour from
+     * when the server received the request.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + * + * @return The expireTime. + */ + public com.google.protobuf.Timestamp getExpireTime() { + if (expireTimeBuilder_ == null) { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } else { + return expireTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time when the credentials expire. If not set, defaults to one hour from
+     * when the server received the request.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expireTime_ = value; + onChanged(); + } else { + expireTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time when the credentials expire. If not set, defaults to one hour from
+     * when the server received the request.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expireTime_ = builderForValue.build(); + onChanged(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time when the credentials expire. If not set, defaults to one hour from
+     * when the server received the request.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (expireTime_ != null) { + expireTime_ = + com.google.protobuf.Timestamp.newBuilder(expireTime_).mergeFrom(value).buildPartial(); + } else { + expireTime_ = value; + } + onChanged(); + } else { + expireTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time when the credentials expire. If not set, defaults to one hour from
+     * when the server received the request.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public Builder clearExpireTime() { + if (expireTimeBuilder_ == null) { + expireTime_ = null; + onChanged(); + } else { + expireTime_ = null; + expireTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time when the credentials expire. If not set, defaults to one hour from
+     * when the server received the request.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + + onChanged(); + return getExpireTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time when the credentials expire. If not set, defaults to one hour from
+     * when the server received the request.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expireTimeBuilder_ != null) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } + } + /** + * + * + *
+     * The time when the credentials expire. If not set, defaults to one hour from
+     * when the server received the request.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + expireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpireTime(), getParentForChildren(), isClean()); + expireTime_ = null; + } + return expireTimeBuilder_; + } + + @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.shell.v1.AuthorizeEnvironmentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.shell.v1.AuthorizeEnvironmentRequest) + private static final com.google.cloud.shell.v1.AuthorizeEnvironmentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.shell.v1.AuthorizeEnvironmentRequest(); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AuthorizeEnvironmentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AuthorizeEnvironmentRequest(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.shell.v1.AuthorizeEnvironmentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentRequestOrBuilder.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentRequestOrBuilder.java new file mode 100644 index 00000000..1b0167e5 --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentRequestOrBuilder.java @@ -0,0 +1,142 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +public interface AuthorizeEnvironmentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.shell.v1.AuthorizeEnvironmentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the resource that should receive the credentials, for example
+   * `users/me/environments/default` or
+   * `users/someone@example.com/environments/default`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Name of the resource that should receive the credentials, for example
+   * `users/me/environments/default` or
+   * `users/someone@example.com/environments/default`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The OAuth access token that should be sent to the environment.
+   * 
+ * + * string access_token = 2; + * + * @return The accessToken. + */ + java.lang.String getAccessToken(); + /** + * + * + *
+   * The OAuth access token that should be sent to the environment.
+   * 
+ * + * string access_token = 2; + * + * @return The bytes for accessToken. + */ + com.google.protobuf.ByteString getAccessTokenBytes(); + + /** + * + * + *
+   * The OAuth ID token that should be sent to the environment.
+   * 
+ * + * string id_token = 4; + * + * @return The idToken. + */ + java.lang.String getIdToken(); + /** + * + * + *
+   * The OAuth ID token that should be sent to the environment.
+   * 
+ * + * string id_token = 4; + * + * @return The bytes for idToken. + */ + com.google.protobuf.ByteString getIdTokenBytes(); + + /** + * + * + *
+   * The time when the credentials expire. If not set, defaults to one hour from
+   * when the server received the request.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + * + * @return Whether the expireTime field is set. + */ + boolean hasExpireTime(); + /** + * + * + *
+   * The time when the credentials expire. If not set, defaults to one hour from
+   * when the server received the request.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + * + * @return The expireTime. + */ + com.google.protobuf.Timestamp getExpireTime(); + /** + * + * + *
+   * The time when the credentials expire. If not set, defaults to one hour from
+   * when the server received the request.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentResponse.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentResponse.java new file mode 100644 index 00000000..718a547c --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentResponse.java @@ -0,0 +1,459 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +/** + * + * + *
+ * Response message for
+ * [AuthorizeEnvironment][google.cloud.shell.v1.CloudShellService.AuthorizeEnvironment].
+ * 
+ * + * Protobuf type {@code google.cloud.shell.v1.AuthorizeEnvironmentResponse} + */ +public final class AuthorizeEnvironmentResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.shell.v1.AuthorizeEnvironmentResponse) + AuthorizeEnvironmentResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use AuthorizeEnvironmentResponse.newBuilder() to construct. + private AuthorizeEnvironmentResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AuthorizeEnvironmentResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AuthorizeEnvironmentResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AuthorizeEnvironmentResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AuthorizeEnvironmentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AuthorizeEnvironmentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.AuthorizeEnvironmentResponse.class, + com.google.cloud.shell.v1.AuthorizeEnvironmentResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.shell.v1.AuthorizeEnvironmentResponse)) { + return super.equals(obj); + } + com.google.cloud.shell.v1.AuthorizeEnvironmentResponse other = + (com.google.cloud.shell.v1.AuthorizeEnvironmentResponse) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentResponse 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.shell.v1.AuthorizeEnvironmentResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentResponse 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.shell.v1.AuthorizeEnvironmentResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentResponse 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.shell.v1.AuthorizeEnvironmentResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentResponse 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.shell.v1.AuthorizeEnvironmentResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentResponse 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.shell.v1.AuthorizeEnvironmentResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for
+   * [AuthorizeEnvironment][google.cloud.shell.v1.CloudShellService.AuthorizeEnvironment].
+   * 
+ * + * Protobuf type {@code google.cloud.shell.v1.AuthorizeEnvironmentResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.shell.v1.AuthorizeEnvironmentResponse) + com.google.cloud.shell.v1.AuthorizeEnvironmentResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AuthorizeEnvironmentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AuthorizeEnvironmentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.AuthorizeEnvironmentResponse.class, + com.google.cloud.shell.v1.AuthorizeEnvironmentResponse.Builder.class); + } + + // Construct using com.google.cloud.shell.v1.AuthorizeEnvironmentResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_AuthorizeEnvironmentResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.shell.v1.AuthorizeEnvironmentResponse getDefaultInstanceForType() { + return com.google.cloud.shell.v1.AuthorizeEnvironmentResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.shell.v1.AuthorizeEnvironmentResponse build() { + com.google.cloud.shell.v1.AuthorizeEnvironmentResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.shell.v1.AuthorizeEnvironmentResponse buildPartial() { + com.google.cloud.shell.v1.AuthorizeEnvironmentResponse result = + new com.google.cloud.shell.v1.AuthorizeEnvironmentResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.shell.v1.AuthorizeEnvironmentResponse) { + return mergeFrom((com.google.cloud.shell.v1.AuthorizeEnvironmentResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.shell.v1.AuthorizeEnvironmentResponse other) { + if (other == com.google.cloud.shell.v1.AuthorizeEnvironmentResponse.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.shell.v1.AuthorizeEnvironmentResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.shell.v1.AuthorizeEnvironmentResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.shell.v1.AuthorizeEnvironmentResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.shell.v1.AuthorizeEnvironmentResponse) + private static final com.google.cloud.shell.v1.AuthorizeEnvironmentResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.shell.v1.AuthorizeEnvironmentResponse(); + } + + public static com.google.cloud.shell.v1.AuthorizeEnvironmentResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AuthorizeEnvironmentResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AuthorizeEnvironmentResponse(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.shell.v1.AuthorizeEnvironmentResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentResponseOrBuilder.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentResponseOrBuilder.java new file mode 100644 index 00000000..47b02ea3 --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/AuthorizeEnvironmentResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +public interface AuthorizeEnvironmentResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.shell.v1.AuthorizeEnvironmentResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CloudShellErrorDetails.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CloudShellErrorDetails.java new file mode 100644 index 00000000..f3644197 --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CloudShellErrorDetails.java @@ -0,0 +1,831 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +/** + * + * + *
+ * Cloud-shell specific information that will be included as details in failure
+ * responses.
+ * 
+ * + * Protobuf type {@code google.cloud.shell.v1.CloudShellErrorDetails} + */ +public final class CloudShellErrorDetails extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.shell.v1.CloudShellErrorDetails) + CloudShellErrorDetailsOrBuilder { + private static final long serialVersionUID = 0L; + // Use CloudShellErrorDetails.newBuilder() to construct. + private CloudShellErrorDetails(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CloudShellErrorDetails() { + code_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CloudShellErrorDetails(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CloudShellErrorDetails( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + code_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_CloudShellErrorDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_CloudShellErrorDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.CloudShellErrorDetails.class, + com.google.cloud.shell.v1.CloudShellErrorDetails.Builder.class); + } + + /** + * + * + *
+   * Set of possible errors returned from API calls.
+   * 
+ * + * Protobuf enum {@code google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode} + */ + public enum CloudShellErrorCode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * An unknown error occurred.
+     * 
+ * + * CLOUD_SHELL_ERROR_CODE_UNSPECIFIED = 0; + */ + CLOUD_SHELL_ERROR_CODE_UNSPECIFIED(0), + /** + * + * + *
+     * The image used by the Cloud Shell environment either does not exist or
+     * the user does not have access to it.
+     * 
+ * + * IMAGE_UNAVAILABLE = 1; + */ + IMAGE_UNAVAILABLE(1), + /** + * + * + *
+     * Cloud Shell has been disabled by an administrator for the user making the
+     * request.
+     * 
+ * + * CLOUD_SHELL_DISABLED = 2; + */ + CLOUD_SHELL_DISABLED(2), + /** + * + * + *
+     * Cloud Shell has been permanently disabled due to a Terms of Service
+     * violation by the user.
+     * 
+ * + * TOS_VIOLATION = 4; + */ + TOS_VIOLATION(4), + /** + * + * + *
+     * The user has exhausted their weekly Cloud Shell quota, and Cloud Shell
+     * will be disabled until the quota resets.
+     * 
+ * + * QUOTA_EXCEEDED = 5; + */ + QUOTA_EXCEEDED(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * An unknown error occurred.
+     * 
+ * + * CLOUD_SHELL_ERROR_CODE_UNSPECIFIED = 0; + */ + public static final int CLOUD_SHELL_ERROR_CODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The image used by the Cloud Shell environment either does not exist or
+     * the user does not have access to it.
+     * 
+ * + * IMAGE_UNAVAILABLE = 1; + */ + public static final int IMAGE_UNAVAILABLE_VALUE = 1; + /** + * + * + *
+     * Cloud Shell has been disabled by an administrator for the user making the
+     * request.
+     * 
+ * + * CLOUD_SHELL_DISABLED = 2; + */ + public static final int CLOUD_SHELL_DISABLED_VALUE = 2; + /** + * + * + *
+     * Cloud Shell has been permanently disabled due to a Terms of Service
+     * violation by the user.
+     * 
+ * + * TOS_VIOLATION = 4; + */ + public static final int TOS_VIOLATION_VALUE = 4; + /** + * + * + *
+     * The user has exhausted their weekly Cloud Shell quota, and Cloud Shell
+     * will be disabled until the quota resets.
+     * 
+ * + * QUOTA_EXCEEDED = 5; + */ + public static final int QUOTA_EXCEEDED_VALUE = 5; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CloudShellErrorCode 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 CloudShellErrorCode forNumber(int value) { + switch (value) { + case 0: + return CLOUD_SHELL_ERROR_CODE_UNSPECIFIED; + case 1: + return IMAGE_UNAVAILABLE; + case 2: + return CLOUD_SHELL_DISABLED; + case 4: + return TOS_VIOLATION; + case 5: + return QUOTA_EXCEEDED; + 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 CloudShellErrorCode findValueByNumber(int number) { + return CloudShellErrorCode.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.shell.v1.CloudShellErrorDetails.getDescriptor().getEnumTypes().get(0); + } + + private static final CloudShellErrorCode[] VALUES = values(); + + public static CloudShellErrorCode 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 CloudShellErrorCode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode) + } + + public static final int CODE_FIELD_NUMBER = 1; + private int code_; + /** + * + * + *
+   * Code indicating the specific error the occurred.
+   * 
+ * + * .google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode code = 1; + * + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return code_; + } + /** + * + * + *
+   * Code indicating the specific error the occurred.
+   * 
+ * + * .google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode code = 1; + * + * @return The code. + */ + @java.lang.Override + public com.google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode getCode() { + @SuppressWarnings("deprecation") + com.google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode result = + com.google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode.valueOf(code_); + return result == null + ? com.google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (code_ + != com.google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode + .CLOUD_SHELL_ERROR_CODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, code_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (code_ + != com.google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode + .CLOUD_SHELL_ERROR_CODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, code_); + } + 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.shell.v1.CloudShellErrorDetails)) { + return super.equals(obj); + } + com.google.cloud.shell.v1.CloudShellErrorDetails other = + (com.google.cloud.shell.v1.CloudShellErrorDetails) obj; + + if (code_ != other.code_) 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) + CODE_FIELD_NUMBER; + hash = (53 * hash) + code_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.shell.v1.CloudShellErrorDetails parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.CloudShellErrorDetails 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.shell.v1.CloudShellErrorDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.CloudShellErrorDetails 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.shell.v1.CloudShellErrorDetails parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.CloudShellErrorDetails parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.shell.v1.CloudShellErrorDetails parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.CloudShellErrorDetails 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.shell.v1.CloudShellErrorDetails parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.CloudShellErrorDetails 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.shell.v1.CloudShellErrorDetails parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.CloudShellErrorDetails 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.shell.v1.CloudShellErrorDetails 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; + } + /** + * + * + *
+   * Cloud-shell specific information that will be included as details in failure
+   * responses.
+   * 
+ * + * Protobuf type {@code google.cloud.shell.v1.CloudShellErrorDetails} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.shell.v1.CloudShellErrorDetails) + com.google.cloud.shell.v1.CloudShellErrorDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_CloudShellErrorDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_CloudShellErrorDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.CloudShellErrorDetails.class, + com.google.cloud.shell.v1.CloudShellErrorDetails.Builder.class); + } + + // Construct using com.google.cloud.shell.v1.CloudShellErrorDetails.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(); + code_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_CloudShellErrorDetails_descriptor; + } + + @java.lang.Override + public com.google.cloud.shell.v1.CloudShellErrorDetails getDefaultInstanceForType() { + return com.google.cloud.shell.v1.CloudShellErrorDetails.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.shell.v1.CloudShellErrorDetails build() { + com.google.cloud.shell.v1.CloudShellErrorDetails result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.shell.v1.CloudShellErrorDetails buildPartial() { + com.google.cloud.shell.v1.CloudShellErrorDetails result = + new com.google.cloud.shell.v1.CloudShellErrorDetails(this); + result.code_ = code_; + 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.shell.v1.CloudShellErrorDetails) { + return mergeFrom((com.google.cloud.shell.v1.CloudShellErrorDetails) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.shell.v1.CloudShellErrorDetails other) { + if (other == com.google.cloud.shell.v1.CloudShellErrorDetails.getDefaultInstance()) + return this; + if (other.code_ != 0) { + setCodeValue(other.getCodeValue()); + } + 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.shell.v1.CloudShellErrorDetails parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.shell.v1.CloudShellErrorDetails) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int code_ = 0; + /** + * + * + *
+     * Code indicating the specific error the occurred.
+     * 
+ * + * .google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode code = 1; + * + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return code_; + } + /** + * + * + *
+     * Code indicating the specific error the occurred.
+     * 
+ * + * .google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode code = 1; + * + * @param value The enum numeric value on the wire for code to set. + * @return This builder for chaining. + */ + public Builder setCodeValue(int value) { + + code_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Code indicating the specific error the occurred.
+     * 
+ * + * .google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode code = 1; + * + * @return The code. + */ + @java.lang.Override + public com.google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode getCode() { + @SuppressWarnings("deprecation") + com.google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode result = + com.google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode.valueOf(code_); + return result == null + ? com.google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Code indicating the specific error the occurred.
+     * 
+ * + * .google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode code = 1; + * + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode( + com.google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode value) { + if (value == null) { + throw new NullPointerException(); + } + + code_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Code indicating the specific error the occurred.
+     * 
+ * + * .google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode code = 1; + * + * @return This builder for chaining. + */ + public Builder clearCode() { + + code_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.shell.v1.CloudShellErrorDetails) + } + + // @@protoc_insertion_point(class_scope:google.cloud.shell.v1.CloudShellErrorDetails) + private static final com.google.cloud.shell.v1.CloudShellErrorDetails DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.shell.v1.CloudShellErrorDetails(); + } + + public static com.google.cloud.shell.v1.CloudShellErrorDetails getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CloudShellErrorDetails parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CloudShellErrorDetails(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.shell.v1.CloudShellErrorDetails getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CloudShellErrorDetailsOrBuilder.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CloudShellErrorDetailsOrBuilder.java new file mode 100644 index 00000000..bd17b24d --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CloudShellErrorDetailsOrBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +public interface CloudShellErrorDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.shell.v1.CloudShellErrorDetails) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Code indicating the specific error the occurred.
+   * 
+ * + * .google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode code = 1; + * + * @return The enum numeric value on the wire for code. + */ + int getCodeValue(); + /** + * + * + *
+   * Code indicating the specific error the occurred.
+   * 
+ * + * .google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode code = 1; + * + * @return The code. + */ + com.google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode getCode(); +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CloudShellProto.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CloudShellProto.java new file mode 100644 index 00000000..819ddaf3 --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CloudShellProto.java @@ -0,0 +1,352 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +public final class CloudShellProto { + private CloudShellProto() {} + + 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_shell_v1_Environment_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_shell_v1_Environment_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_shell_v1_GetEnvironmentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_shell_v1_GetEnvironmentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_shell_v1_CreateEnvironmentMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_shell_v1_CreateEnvironmentMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_shell_v1_DeleteEnvironmentMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_shell_v1_DeleteEnvironmentMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_shell_v1_StartEnvironmentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_shell_v1_StartEnvironmentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_shell_v1_AuthorizeEnvironmentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_shell_v1_AuthorizeEnvironmentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_shell_v1_AuthorizeEnvironmentResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_shell_v1_AuthorizeEnvironmentResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_shell_v1_AuthorizeEnvironmentMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_shell_v1_AuthorizeEnvironmentMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_shell_v1_StartEnvironmentMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_shell_v1_StartEnvironmentMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_shell_v1_StartEnvironmentResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_shell_v1_StartEnvironmentResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_shell_v1_AddPublicKeyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_shell_v1_AddPublicKeyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_shell_v1_AddPublicKeyResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_shell_v1_AddPublicKeyResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_shell_v1_AddPublicKeyMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_shell_v1_AddPublicKeyMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_shell_v1_RemovePublicKeyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_shell_v1_RemovePublicKeyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_shell_v1_RemovePublicKeyResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_shell_v1_RemovePublicKeyResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_shell_v1_RemovePublicKeyMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_shell_v1_RemovePublicKeyMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_shell_v1_CloudShellErrorDetails_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_shell_v1_CloudShellErrorDetails_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n&google/cloud/shell/v1/cloudshell.proto" + + "\022\025google.cloud.shell.v1\032\034google/api/anno" + + "tations.proto\032\027google/api/client.proto\032\037" + + "google/api/field_behavior.proto\032\031google/" + + "api/resource.proto\032#google/longrunning/o" + + "perations.proto\032 google/protobuf/field_m" + + "ask.proto\032\037google/protobuf/timestamp.pro" + + "to\"\263\003\n\013Environment\022\021\n\004name\030\001 \001(\tB\003\340A\005\022\017\n" + + "\002id\030\002 \001(\tB\003\340A\003\022\034\n\014docker_image\030\003 \001(\tB\006\340A" + + "\002\340A\005\022<\n\005state\030\004 \001(\0162(.google.cloud.shell" + + ".v1.Environment.StateB\003\340A\003\022\025\n\010web_host\030\014" + + " \001(\tB\003\340A\003\022\031\n\014ssh_username\030\005 \001(\tB\003\340A\003\022\025\n\010" + + "ssh_host\030\006 \001(\tB\003\340A\003\022\025\n\010ssh_port\030\007 \001(\005B\003\340" + + "A\003\022\030\n\013public_keys\030\010 \003(\tB\003\340A\003\"U\n\005State\022\025\n" + + "\021STATE_UNSPECIFIED\020\000\022\r\n\tSUSPENDED\020\001\022\013\n\007P" + + "ENDING\020\002\022\013\n\007RUNNING\020\003\022\014\n\010DELETING\020\004:S\352AP" + + "\n%cloudshell.googleapis.com/Environment\022" + + "\'users/{user}/environments/{environment}" + + "\"T\n\025GetEnvironmentRequest\022;\n\004name\030\001 \001(\tB" + + "-\340A\002\372A\'\n%cloudshell.googleapis.com/Envir" + + "onment\"\033\n\031CreateEnvironmentMetadata\"\033\n\031D" + + "eleteEnvironmentMetadata\"R\n\027StartEnviron" + + "mentRequest\022\014\n\004name\030\001 \001(\t\022\024\n\014access_toke" + + "n\030\002 \001(\t\022\023\n\013public_keys\030\003 \003(\t\"\204\001\n\033Authori" + + "zeEnvironmentRequest\022\014\n\004name\030\001 \001(\t\022\024\n\014ac" + + "cess_token\030\002 \001(\t\022\020\n\010id_token\030\004 \001(\t\022/\n\013ex" + + "pire_time\030\003 \001(\0132\032.google.protobuf.Timest" + + "amp\"\036\n\034AuthorizeEnvironmentResponse\"\036\n\034A" + + "uthorizeEnvironmentMetadata\"\322\001\n\030StartEnv" + + "ironmentMetadata\022D\n\005state\030\001 \001(\01625.google" + + ".cloud.shell.v1.StartEnvironmentMetadata" + + ".State\"p\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\014" + + "\n\010STARTING\020\001\022\024\n\020UNARCHIVING_DISK\020\002\022\036\n\032AW" + + "AITING_COMPUTE_RESOURCES\020\004\022\014\n\010FINISHED\020\003" + + "\"S\n\030StartEnvironmentResponse\0227\n\013environm" + + "ent\030\001 \001(\0132\".google.cloud.shell.v1.Enviro" + + "nment\"7\n\023AddPublicKeyRequest\022\023\n\013environm" + + "ent\030\001 \001(\t\022\013\n\003key\030\002 \001(\t\"#\n\024AddPublicKeyRe" + + "sponse\022\013\n\003key\030\001 \001(\t\"\026\n\024AddPublicKeyMetad" + + "ata\":\n\026RemovePublicKeyRequest\022\023\n\013environ" + + "ment\030\001 \001(\t\022\013\n\003key\030\002 \001(\t\"\031\n\027RemovePublicK" + + "eyResponse\"\031\n\027RemovePublicKeyMetadata\"\201\002" + + "\n\026CloudShellErrorDetails\022O\n\004code\030\001 \001(\0162A" + + ".google.cloud.shell.v1.CloudShellErrorDe" + + "tails.CloudShellErrorCode\"\225\001\n\023CloudShell" + + "ErrorCode\022&\n\"CLOUD_SHELL_ERROR_CODE_UNSP" + + "ECIFIED\020\000\022\025\n\021IMAGE_UNAVAILABLE\020\001\022\030\n\024CLOU" + + "D_SHELL_DISABLED\020\002\022\021\n\rTOS_VIOLATION\020\004\022\022\n" + + "\016QUOTA_EXCEEDED\020\0052\324\010\n\021CloudShellService\022" + + "\224\001\n\016GetEnvironment\022,.google.cloud.shell." + + "v1.GetEnvironmentRequest\032\".google.cloud." + + "shell.v1.Environment\"0\202\323\344\223\002#\022!/v1/{name=" + + "users/*/environments/*}\332A\004name\022\314\001\n\020Start" + + "Environment\022..google.cloud.shell.v1.Star" + + "tEnvironmentRequest\032\035.google.longrunning" + + ".Operation\"i\202\323\344\223\002,\"\'/v1/{name=users/*/en" + + "vironments/*}:start:\001*\312A4\n\030StartEnvironm" + + "entResponse\022\030StartEnvironmentMetadata\022\340\001" + + "\n\024AuthorizeEnvironment\0222.google.cloud.sh" + + "ell.v1.AuthorizeEnvironmentRequest\032\035.goo" + + "gle.longrunning.Operation\"u\202\323\344\223\0020\"+/v1/{" + + "name=users/*/environments/*}:authorize:\001" + + "*\312A<\n\034AuthorizeEnvironmentResponse\022\034Auth" + + "orizeEnvironmentMetadata\022\312\001\n\014AddPublicKe" + + "y\022*.google.cloud.shell.v1.AddPublicKeyRe" + + "quest\032\035.google.longrunning.Operation\"o\202\323" + + "\344\223\002:\"5/v1/{environment=users/*/environme" + + "nts/*}:addPublicKey:\001*\312A,\n\024AddPublicKeyR" + + "esponse\022\024AddPublicKeyMetadata\022\331\001\n\017Remove" + + "PublicKey\022-.google.cloud.shell.v1.Remove" + + "PublicKeyRequest\032\035.google.longrunning.Op" + + "eration\"x\202\323\344\223\002=\"8/v1/{environment=users/" + + "*/environments/*}:removePublicKey:\001*\312A2\n" + + "\027RemovePublicKeyResponse\022\027RemovePublicKe" + + "yMetadata\032M\312A\031cloudshell.googleapis.com\322" + + "A.https://www.googleapis.com/auth/cloud-" + + "platformBj\n\031com.google.cloud.shell.v1B\017C" + + "loudShellProtoP\001Z:google.golang.org/genp" + + "roto/googleapis/cloud/shell/v1;shellb\006pr" + + "oto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_shell_v1_Environment_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_shell_v1_Environment_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_shell_v1_Environment_descriptor, + new java.lang.String[] { + "Name", + "Id", + "DockerImage", + "State", + "WebHost", + "SshUsername", + "SshHost", + "SshPort", + "PublicKeys", + }); + internal_static_google_cloud_shell_v1_GetEnvironmentRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_shell_v1_GetEnvironmentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_shell_v1_GetEnvironmentRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_shell_v1_CreateEnvironmentMetadata_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_shell_v1_CreateEnvironmentMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_shell_v1_CreateEnvironmentMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_shell_v1_DeleteEnvironmentMetadata_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_shell_v1_DeleteEnvironmentMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_shell_v1_DeleteEnvironmentMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_shell_v1_StartEnvironmentRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_shell_v1_StartEnvironmentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_shell_v1_StartEnvironmentRequest_descriptor, + new java.lang.String[] { + "Name", "AccessToken", "PublicKeys", + }); + internal_static_google_cloud_shell_v1_AuthorizeEnvironmentRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_shell_v1_AuthorizeEnvironmentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_shell_v1_AuthorizeEnvironmentRequest_descriptor, + new java.lang.String[] { + "Name", "AccessToken", "IdToken", "ExpireTime", + }); + internal_static_google_cloud_shell_v1_AuthorizeEnvironmentResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_shell_v1_AuthorizeEnvironmentResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_shell_v1_AuthorizeEnvironmentResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_shell_v1_AuthorizeEnvironmentMetadata_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_shell_v1_AuthorizeEnvironmentMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_shell_v1_AuthorizeEnvironmentMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_shell_v1_StartEnvironmentMetadata_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_shell_v1_StartEnvironmentMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_shell_v1_StartEnvironmentMetadata_descriptor, + new java.lang.String[] { + "State", + }); + internal_static_google_cloud_shell_v1_StartEnvironmentResponse_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_shell_v1_StartEnvironmentResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_shell_v1_StartEnvironmentResponse_descriptor, + new java.lang.String[] { + "Environment", + }); + internal_static_google_cloud_shell_v1_AddPublicKeyRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_shell_v1_AddPublicKeyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_shell_v1_AddPublicKeyRequest_descriptor, + new java.lang.String[] { + "Environment", "Key", + }); + internal_static_google_cloud_shell_v1_AddPublicKeyResponse_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_shell_v1_AddPublicKeyResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_shell_v1_AddPublicKeyResponse_descriptor, + new java.lang.String[] { + "Key", + }); + internal_static_google_cloud_shell_v1_AddPublicKeyMetadata_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_shell_v1_AddPublicKeyMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_shell_v1_AddPublicKeyMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_shell_v1_RemovePublicKeyRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_shell_v1_RemovePublicKeyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_shell_v1_RemovePublicKeyRequest_descriptor, + new java.lang.String[] { + "Environment", "Key", + }); + internal_static_google_cloud_shell_v1_RemovePublicKeyResponse_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_shell_v1_RemovePublicKeyResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_shell_v1_RemovePublicKeyResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_shell_v1_RemovePublicKeyMetadata_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_shell_v1_RemovePublicKeyMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_shell_v1_RemovePublicKeyMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_shell_v1_CloudShellErrorDetails_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_shell_v1_CloudShellErrorDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_shell_v1_CloudShellErrorDetails_descriptor, + new java.lang.String[] { + "Code", + }); + 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.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CreateEnvironmentMetadata.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CreateEnvironmentMetadata.java new file mode 100644 index 00000000..b52ff195 --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CreateEnvironmentMetadata.java @@ -0,0 +1,458 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +/** + * + * + *
+ * Message included in the metadata field of operations returned from
+ * [CreateEnvironment][google.cloud.shell.v1.CloudShellService.CreateEnvironment].
+ * 
+ * + * Protobuf type {@code google.cloud.shell.v1.CreateEnvironmentMetadata} + */ +public final class CreateEnvironmentMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.shell.v1.CreateEnvironmentMetadata) + CreateEnvironmentMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateEnvironmentMetadata.newBuilder() to construct. + private CreateEnvironmentMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateEnvironmentMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateEnvironmentMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateEnvironmentMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_CreateEnvironmentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_CreateEnvironmentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.CreateEnvironmentMetadata.class, + com.google.cloud.shell.v1.CreateEnvironmentMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.shell.v1.CreateEnvironmentMetadata)) { + return super.equals(obj); + } + com.google.cloud.shell.v1.CreateEnvironmentMetadata other = + (com.google.cloud.shell.v1.CreateEnvironmentMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.shell.v1.CreateEnvironmentMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.CreateEnvironmentMetadata 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.shell.v1.CreateEnvironmentMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.CreateEnvironmentMetadata 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.shell.v1.CreateEnvironmentMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.CreateEnvironmentMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.shell.v1.CreateEnvironmentMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.CreateEnvironmentMetadata 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.shell.v1.CreateEnvironmentMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.CreateEnvironmentMetadata 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.shell.v1.CreateEnvironmentMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.CreateEnvironmentMetadata 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.shell.v1.CreateEnvironmentMetadata 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 included in the metadata field of operations returned from
+   * [CreateEnvironment][google.cloud.shell.v1.CloudShellService.CreateEnvironment].
+   * 
+ * + * Protobuf type {@code google.cloud.shell.v1.CreateEnvironmentMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.shell.v1.CreateEnvironmentMetadata) + com.google.cloud.shell.v1.CreateEnvironmentMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_CreateEnvironmentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_CreateEnvironmentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.CreateEnvironmentMetadata.class, + com.google.cloud.shell.v1.CreateEnvironmentMetadata.Builder.class); + } + + // Construct using com.google.cloud.shell.v1.CreateEnvironmentMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_CreateEnvironmentMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.shell.v1.CreateEnvironmentMetadata getDefaultInstanceForType() { + return com.google.cloud.shell.v1.CreateEnvironmentMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.shell.v1.CreateEnvironmentMetadata build() { + com.google.cloud.shell.v1.CreateEnvironmentMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.shell.v1.CreateEnvironmentMetadata buildPartial() { + com.google.cloud.shell.v1.CreateEnvironmentMetadata result = + new com.google.cloud.shell.v1.CreateEnvironmentMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.shell.v1.CreateEnvironmentMetadata) { + return mergeFrom((com.google.cloud.shell.v1.CreateEnvironmentMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.shell.v1.CreateEnvironmentMetadata other) { + if (other == com.google.cloud.shell.v1.CreateEnvironmentMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.shell.v1.CreateEnvironmentMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.shell.v1.CreateEnvironmentMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.shell.v1.CreateEnvironmentMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.shell.v1.CreateEnvironmentMetadata) + private static final com.google.cloud.shell.v1.CreateEnvironmentMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.shell.v1.CreateEnvironmentMetadata(); + } + + public static com.google.cloud.shell.v1.CreateEnvironmentMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateEnvironmentMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateEnvironmentMetadata(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.shell.v1.CreateEnvironmentMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CreateEnvironmentMetadataOrBuilder.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CreateEnvironmentMetadataOrBuilder.java new file mode 100644 index 00000000..2fdf33b3 --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/CreateEnvironmentMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +public interface CreateEnvironmentMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.shell.v1.CreateEnvironmentMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/DeleteEnvironmentMetadata.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/DeleteEnvironmentMetadata.java new file mode 100644 index 00000000..0c84caef --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/DeleteEnvironmentMetadata.java @@ -0,0 +1,458 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +/** + * + * + *
+ * Message included in the metadata field of operations returned from
+ * [DeleteEnvironment][google.cloud.shell.v1.CloudShellService.DeleteEnvironment].
+ * 
+ * + * Protobuf type {@code google.cloud.shell.v1.DeleteEnvironmentMetadata} + */ +public final class DeleteEnvironmentMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.shell.v1.DeleteEnvironmentMetadata) + DeleteEnvironmentMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteEnvironmentMetadata.newBuilder() to construct. + private DeleteEnvironmentMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteEnvironmentMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteEnvironmentMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteEnvironmentMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_DeleteEnvironmentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_DeleteEnvironmentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.DeleteEnvironmentMetadata.class, + com.google.cloud.shell.v1.DeleteEnvironmentMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.shell.v1.DeleteEnvironmentMetadata)) { + return super.equals(obj); + } + com.google.cloud.shell.v1.DeleteEnvironmentMetadata other = + (com.google.cloud.shell.v1.DeleteEnvironmentMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.shell.v1.DeleteEnvironmentMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.DeleteEnvironmentMetadata 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.shell.v1.DeleteEnvironmentMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.DeleteEnvironmentMetadata 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.shell.v1.DeleteEnvironmentMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.DeleteEnvironmentMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.shell.v1.DeleteEnvironmentMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.DeleteEnvironmentMetadata 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.shell.v1.DeleteEnvironmentMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.DeleteEnvironmentMetadata 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.shell.v1.DeleteEnvironmentMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.DeleteEnvironmentMetadata 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.shell.v1.DeleteEnvironmentMetadata 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 included in the metadata field of operations returned from
+   * [DeleteEnvironment][google.cloud.shell.v1.CloudShellService.DeleteEnvironment].
+   * 
+ * + * Protobuf type {@code google.cloud.shell.v1.DeleteEnvironmentMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.shell.v1.DeleteEnvironmentMetadata) + com.google.cloud.shell.v1.DeleteEnvironmentMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_DeleteEnvironmentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_DeleteEnvironmentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.DeleteEnvironmentMetadata.class, + com.google.cloud.shell.v1.DeleteEnvironmentMetadata.Builder.class); + } + + // Construct using com.google.cloud.shell.v1.DeleteEnvironmentMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_DeleteEnvironmentMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.shell.v1.DeleteEnvironmentMetadata getDefaultInstanceForType() { + return com.google.cloud.shell.v1.DeleteEnvironmentMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.shell.v1.DeleteEnvironmentMetadata build() { + com.google.cloud.shell.v1.DeleteEnvironmentMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.shell.v1.DeleteEnvironmentMetadata buildPartial() { + com.google.cloud.shell.v1.DeleteEnvironmentMetadata result = + new com.google.cloud.shell.v1.DeleteEnvironmentMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.shell.v1.DeleteEnvironmentMetadata) { + return mergeFrom((com.google.cloud.shell.v1.DeleteEnvironmentMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.shell.v1.DeleteEnvironmentMetadata other) { + if (other == com.google.cloud.shell.v1.DeleteEnvironmentMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.shell.v1.DeleteEnvironmentMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.shell.v1.DeleteEnvironmentMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.shell.v1.DeleteEnvironmentMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.shell.v1.DeleteEnvironmentMetadata) + private static final com.google.cloud.shell.v1.DeleteEnvironmentMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.shell.v1.DeleteEnvironmentMetadata(); + } + + public static com.google.cloud.shell.v1.DeleteEnvironmentMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteEnvironmentMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteEnvironmentMetadata(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.shell.v1.DeleteEnvironmentMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/DeleteEnvironmentMetadataOrBuilder.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/DeleteEnvironmentMetadataOrBuilder.java new file mode 100644 index 00000000..1d69025b --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/DeleteEnvironmentMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +public interface DeleteEnvironmentMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.shell.v1.DeleteEnvironmentMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/Environment.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/Environment.java new file mode 100644 index 00000000..bf5597fb --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/Environment.java @@ -0,0 +1,2409 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +/** + * + * + *
+ * A Cloud Shell environment, which is defined as the combination of a Docker
+ * image specifying what is installed on the environment and a home directory
+ * containing the user's data that will remain across sessions. Each user has
+ * at least an environment with the ID "default".
+ * 
+ * + * Protobuf type {@code google.cloud.shell.v1.Environment} + */ +public final class Environment extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.shell.v1.Environment) + EnvironmentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Environment.newBuilder() to construct. + private Environment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Environment() { + name_ = ""; + id_ = ""; + dockerImage_ = ""; + state_ = 0; + webHost_ = ""; + sshUsername_ = ""; + sshHost_ = ""; + publicKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Environment(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Environment( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + id_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + dockerImage_ = s; + break; + } + case 32: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + sshUsername_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + sshHost_ = s; + break; + } + case 56: + { + sshPort_ = input.readInt32(); + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + publicKeys_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + publicKeys_.add(s); + break; + } + case 98: + { + java.lang.String s = input.readStringRequireUtf8(); + + webHost_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + publicKeys_ = publicKeys_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_Environment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_Environment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.Environment.class, + com.google.cloud.shell.v1.Environment.Builder.class); + } + + /** + * + * + *
+   * Possible execution states for an environment.
+   * 
+ * + * Protobuf enum {@code google.cloud.shell.v1.Environment.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The environment's states is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The environment is not running and can't be connected to. Starting the
+     * environment will transition it to the PENDING state.
+     * 
+ * + * SUSPENDED = 1; + */ + SUSPENDED(1), + /** + * + * + *
+     * The environment is being started but is not yet ready to accept
+     * connections.
+     * 
+ * + * PENDING = 2; + */ + PENDING(2), + /** + * + * + *
+     * The environment is running and ready to accept connections. It will
+     * automatically transition back to DISABLED after a period of inactivity or
+     * if another environment is started.
+     * 
+ * + * RUNNING = 3; + */ + RUNNING(3), + /** + * + * + *
+     * The environment is being deleted and can't be connected to.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The environment's states is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The environment is not running and can't be connected to. Starting the
+     * environment will transition it to the PENDING state.
+     * 
+ * + * SUSPENDED = 1; + */ + public static final int SUSPENDED_VALUE = 1; + /** + * + * + *
+     * The environment is being started but is not yet ready to accept
+     * connections.
+     * 
+ * + * PENDING = 2; + */ + public static final int PENDING_VALUE = 2; + /** + * + * + *
+     * The environment is running and ready to accept connections. It will
+     * automatically transition back to DISABLED after a period of inactivity or
+     * if another environment is started.
+     * 
+ * + * RUNNING = 3; + */ + public static final int RUNNING_VALUE = 3; + /** + * + * + *
+     * The environment is being deleted and can't be connected to.
+     * 
+ * + * DELETING = 4; + */ + public static final int DELETING_VALUE = 4; + + 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 SUSPENDED; + case 2: + return PENDING; + case 3: + return RUNNING; + case 4: + return DELETING; + 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.shell.v1.Environment.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.shell.v1.Environment.State) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Immutable. Full name of this resource, in the format
+   * `users/{owner_email}/environments/{environment_id}`. `{owner_email}` is the
+   * email address of the user to whom this environment belongs, and
+   * `{environment_id}` is the identifier of this environment. For example,
+   * `users/someone@example.com/environments/default`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. Full name of this resource, in the format
+   * `users/{owner_email}/environments/{environment_id}`. `{owner_email}` is the
+   * email address of the user to whom this environment belongs, and
+   * `{environment_id}` is the identifier of this environment. For example,
+   * `users/someone@example.com/environments/default`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ID_FIELD_NUMBER = 2; + private volatile java.lang.Object id_; + /** + * + * + *
+   * Output only. The environment's identifier, unique among the user's
+   * environments.
+   * 
+ * + * string id = 2 [(.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. The environment's identifier, unique among the user's
+   * environments.
+   * 
+ * + * string id = 2 [(.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 DOCKER_IMAGE_FIELD_NUMBER = 3; + private volatile java.lang.Object dockerImage_; + /** + * + * + *
+   * Required. Immutable. Full path to the Docker image used to run this environment, e.g.
+   * "gcr.io/dev-con/cloud-devshell:latest".
+   * 
+ * + * + * string docker_image = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The dockerImage. + */ + @java.lang.Override + public java.lang.String getDockerImage() { + java.lang.Object ref = dockerImage_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dockerImage_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Immutable. Full path to the Docker image used to run this environment, e.g.
+   * "gcr.io/dev-con/cloud-devshell:latest".
+   * 
+ * + * + * string docker_image = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for dockerImage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDockerImageBytes() { + java.lang.Object ref = dockerImage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dockerImage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 4; + private int state_; + /** + * + * + *
+   * Output only. Current execution state of this environment.
+   * 
+ * + * + * .google.cloud.shell.v1.Environment.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. Current execution state of this environment.
+   * 
+ * + * + * .google.cloud.shell.v1.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.shell.v1.Environment.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.shell.v1.Environment.State result = + com.google.cloud.shell.v1.Environment.State.valueOf(state_); + return result == null ? com.google.cloud.shell.v1.Environment.State.UNRECOGNIZED : result; + } + + public static final int WEB_HOST_FIELD_NUMBER = 12; + private volatile java.lang.Object webHost_; + /** + * + * + *
+   * Output only. Host to which clients can connect to initiate HTTPS or WSS
+   * connections with the environment.
+   * 
+ * + * string web_host = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The webHost. + */ + @java.lang.Override + public java.lang.String getWebHost() { + java.lang.Object ref = webHost_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + webHost_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Host to which clients can connect to initiate HTTPS or WSS
+   * connections with the environment.
+   * 
+ * + * string web_host = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for webHost. + */ + @java.lang.Override + public com.google.protobuf.ByteString getWebHostBytes() { + java.lang.Object ref = webHost_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + webHost_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SSH_USERNAME_FIELD_NUMBER = 5; + private volatile java.lang.Object sshUsername_; + /** + * + * + *
+   * Output only. Username that clients should use when initiating SSH sessions
+   * with the environment.
+   * 
+ * + * string ssh_username = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sshUsername. + */ + @java.lang.Override + public java.lang.String getSshUsername() { + java.lang.Object ref = sshUsername_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sshUsername_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Username that clients should use when initiating SSH sessions
+   * with the environment.
+   * 
+ * + * string ssh_username = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for sshUsername. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSshUsernameBytes() { + java.lang.Object ref = sshUsername_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sshUsername_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SSH_HOST_FIELD_NUMBER = 6; + private volatile java.lang.Object sshHost_; + /** + * + * + *
+   * Output only. Host to which clients can connect to initiate SSH sessions
+   * with the environment.
+   * 
+ * + * string ssh_host = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sshHost. + */ + @java.lang.Override + public java.lang.String getSshHost() { + java.lang.Object ref = sshHost_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sshHost_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Host to which clients can connect to initiate SSH sessions
+   * with the environment.
+   * 
+ * + * string ssh_host = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for sshHost. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSshHostBytes() { + java.lang.Object ref = sshHost_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sshHost_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SSH_PORT_FIELD_NUMBER = 7; + private int sshPort_; + /** + * + * + *
+   * Output only. Port to which clients can connect to initiate SSH sessions
+   * with the environment.
+   * 
+ * + * int32 ssh_port = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sshPort. + */ + @java.lang.Override + public int getSshPort() { + return sshPort_; + } + + public static final int PUBLIC_KEYS_FIELD_NUMBER = 8; + private com.google.protobuf.LazyStringList publicKeys_; + /** + * + * + *
+   * Output only. Public keys associated with the environment. Clients can
+   * connect to this environment via SSH only if they possess a private key
+   * corresponding to at least one of these public keys. Keys can be added to or
+   * removed from the environment using the AddPublicKey and RemovePublicKey
+   * methods.
+   * 
+ * + * repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the publicKeys. + */ + public com.google.protobuf.ProtocolStringList getPublicKeysList() { + return publicKeys_; + } + /** + * + * + *
+   * Output only. Public keys associated with the environment. Clients can
+   * connect to this environment via SSH only if they possess a private key
+   * corresponding to at least one of these public keys. Keys can be added to or
+   * removed from the environment using the AddPublicKey and RemovePublicKey
+   * methods.
+   * 
+ * + * repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of publicKeys. + */ + public int getPublicKeysCount() { + return publicKeys_.size(); + } + /** + * + * + *
+   * Output only. Public keys associated with the environment. Clients can
+   * connect to this environment via SSH only if they possess a private key
+   * corresponding to at least one of these public keys. Keys can be added to or
+   * removed from the environment using the AddPublicKey and RemovePublicKey
+   * methods.
+   * 
+ * + * repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the element to return. + * @return The publicKeys at the given index. + */ + public java.lang.String getPublicKeys(int index) { + return publicKeys_.get(index); + } + /** + * + * + *
+   * Output only. Public keys associated with the environment. Clients can
+   * connect to this environment via SSH only if they possess a private key
+   * corresponding to at least one of these public keys. Keys can be added to or
+   * removed from the environment using the AddPublicKey and RemovePublicKey
+   * methods.
+   * 
+ * + * repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the value to return. + * @return The bytes of the publicKeys at the given index. + */ + public com.google.protobuf.ByteString getPublicKeysBytes(int index) { + return publicKeys_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, id_); + } + if (!getDockerImageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, dockerImage_); + } + if (state_ != com.google.cloud.shell.v1.Environment.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, state_); + } + if (!getSshUsernameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, sshUsername_); + } + if (!getSshHostBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, sshHost_); + } + if (sshPort_ != 0) { + output.writeInt32(7, sshPort_); + } + for (int i = 0; i < publicKeys_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, publicKeys_.getRaw(i)); + } + if (!getWebHostBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, webHost_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, id_); + } + if (!getDockerImageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, dockerImage_); + } + if (state_ != com.google.cloud.shell.v1.Environment.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_); + } + if (!getSshUsernameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, sshUsername_); + } + if (!getSshHostBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, sshHost_); + } + if (sshPort_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, sshPort_); + } + { + int dataSize = 0; + for (int i = 0; i < publicKeys_.size(); i++) { + dataSize += computeStringSizeNoTag(publicKeys_.getRaw(i)); + } + size += dataSize; + size += 1 * getPublicKeysList().size(); + } + if (!getWebHostBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, webHost_); + } + 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.shell.v1.Environment)) { + return super.equals(obj); + } + com.google.cloud.shell.v1.Environment other = (com.google.cloud.shell.v1.Environment) obj; + + if (!getName().equals(other.getName())) return false; + if (!getId().equals(other.getId())) return false; + if (!getDockerImage().equals(other.getDockerImage())) return false; + if (state_ != other.state_) return false; + if (!getWebHost().equals(other.getWebHost())) return false; + if (!getSshUsername().equals(other.getSshUsername())) return false; + if (!getSshHost().equals(other.getSshHost())) return false; + if (getSshPort() != other.getSshPort()) return false; + if (!getPublicKeysList().equals(other.getPublicKeysList())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + DOCKER_IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getDockerImage().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + WEB_HOST_FIELD_NUMBER; + hash = (53 * hash) + getWebHost().hashCode(); + hash = (37 * hash) + SSH_USERNAME_FIELD_NUMBER; + hash = (53 * hash) + getSshUsername().hashCode(); + hash = (37 * hash) + SSH_HOST_FIELD_NUMBER; + hash = (53 * hash) + getSshHost().hashCode(); + hash = (37 * hash) + SSH_PORT_FIELD_NUMBER; + hash = (53 * hash) + getSshPort(); + if (getPublicKeysCount() > 0) { + hash = (37 * hash) + PUBLIC_KEYS_FIELD_NUMBER; + hash = (53 * hash) + getPublicKeysList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.shell.v1.Environment parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.Environment parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.shell.v1.Environment parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.Environment parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.shell.v1.Environment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.Environment parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.shell.v1.Environment parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.Environment parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.shell.v1.Environment parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.Environment parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.shell.v1.Environment parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.Environment parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.shell.v1.Environment prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A Cloud Shell environment, which is defined as the combination of a Docker
+   * image specifying what is installed on the environment and a home directory
+   * containing the user's data that will remain across sessions. Each user has
+   * at least an environment with the ID "default".
+   * 
+ * + * Protobuf type {@code google.cloud.shell.v1.Environment} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.shell.v1.Environment) + com.google.cloud.shell.v1.EnvironmentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_Environment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_Environment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.Environment.class, + com.google.cloud.shell.v1.Environment.Builder.class); + } + + // Construct using com.google.cloud.shell.v1.Environment.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + id_ = ""; + + dockerImage_ = ""; + + state_ = 0; + + webHost_ = ""; + + sshUsername_ = ""; + + sshHost_ = ""; + + sshPort_ = 0; + + publicKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_Environment_descriptor; + } + + @java.lang.Override + public com.google.cloud.shell.v1.Environment getDefaultInstanceForType() { + return com.google.cloud.shell.v1.Environment.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.shell.v1.Environment build() { + com.google.cloud.shell.v1.Environment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.shell.v1.Environment buildPartial() { + com.google.cloud.shell.v1.Environment result = + new com.google.cloud.shell.v1.Environment(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.id_ = id_; + result.dockerImage_ = dockerImage_; + result.state_ = state_; + result.webHost_ = webHost_; + result.sshUsername_ = sshUsername_; + result.sshHost_ = sshHost_; + result.sshPort_ = sshPort_; + if (((bitField0_ & 0x00000001) != 0)) { + publicKeys_ = publicKeys_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.publicKeys_ = publicKeys_; + 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.shell.v1.Environment) { + return mergeFrom((com.google.cloud.shell.v1.Environment) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.shell.v1.Environment other) { + if (other == com.google.cloud.shell.v1.Environment.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (!other.getDockerImage().isEmpty()) { + dockerImage_ = other.dockerImage_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getWebHost().isEmpty()) { + webHost_ = other.webHost_; + onChanged(); + } + if (!other.getSshUsername().isEmpty()) { + sshUsername_ = other.sshUsername_; + onChanged(); + } + if (!other.getSshHost().isEmpty()) { + sshHost_ = other.sshHost_; + onChanged(); + } + if (other.getSshPort() != 0) { + setSshPort(other.getSshPort()); + } + if (!other.publicKeys_.isEmpty()) { + if (publicKeys_.isEmpty()) { + publicKeys_ = other.publicKeys_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePublicKeysIsMutable(); + publicKeys_.addAll(other.publicKeys_); + } + 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.shell.v1.Environment parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.shell.v1.Environment) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. Full name of this resource, in the format
+     * `users/{owner_email}/environments/{environment_id}`. `{owner_email}` is the
+     * email address of the user to whom this environment belongs, and
+     * `{environment_id}` is the identifier of this environment. For example,
+     * `users/someone@example.com/environments/default`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. Full name of this resource, in the format
+     * `users/{owner_email}/environments/{environment_id}`. `{owner_email}` is the
+     * email address of the user to whom this environment belongs, and
+     * `{environment_id}` is the identifier of this environment. For example,
+     * `users/someone@example.com/environments/default`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. Full name of this resource, in the format
+     * `users/{owner_email}/environments/{environment_id}`. `{owner_email}` is the
+     * email address of the user to whom this environment belongs, and
+     * `{environment_id}` is the identifier of this environment. For example,
+     * `users/someone@example.com/environments/default`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Full name of this resource, in the format
+     * `users/{owner_email}/environments/{environment_id}`. `{owner_email}` is the
+     * email address of the user to whom this environment belongs, and
+     * `{environment_id}` is the identifier of this environment. For example,
+     * `users/someone@example.com/environments/default`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Full name of this resource, in the format
+     * `users/{owner_email}/environments/{environment_id}`. `{owner_email}` is the
+     * email address of the user to whom this environment belongs, and
+     * `{environment_id}` is the identifier of this environment. For example,
+     * `users/someone@example.com/environments/default`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object id_ = ""; + /** + * + * + *
+     * Output only. The environment's identifier, unique among the user's
+     * environments.
+     * 
+ * + * string id = 2 [(.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. The environment's identifier, unique among the user's
+     * environments.
+     * 
+ * + * string id = 2 [(.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. The environment's identifier, unique among the user's
+     * environments.
+     * 
+ * + * string id = 2 [(.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. The environment's identifier, unique among the user's
+     * environments.
+     * 
+ * + * string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The environment's identifier, unique among the user's
+     * environments.
+     * 
+ * + * string id = 2 [(.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 dockerImage_ = ""; + /** + * + * + *
+     * Required. Immutable. Full path to the Docker image used to run this environment, e.g.
+     * "gcr.io/dev-con/cloud-devshell:latest".
+     * 
+ * + * + * string docker_image = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The dockerImage. + */ + public java.lang.String getDockerImage() { + java.lang.Object ref = dockerImage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dockerImage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Immutable. Full path to the Docker image used to run this environment, e.g.
+     * "gcr.io/dev-con/cloud-devshell:latest".
+     * 
+ * + * + * string docker_image = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for dockerImage. + */ + public com.google.protobuf.ByteString getDockerImageBytes() { + java.lang.Object ref = dockerImage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dockerImage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Immutable. Full path to the Docker image used to run this environment, e.g.
+     * "gcr.io/dev-con/cloud-devshell:latest".
+     * 
+ * + * + * string docker_image = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The dockerImage to set. + * @return This builder for chaining. + */ + public Builder setDockerImage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dockerImage_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Full path to the Docker image used to run this environment, e.g.
+     * "gcr.io/dev-con/cloud-devshell:latest".
+     * 
+ * + * + * string docker_image = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearDockerImage() { + + dockerImage_ = getDefaultInstance().getDockerImage(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Full path to the Docker image used to run this environment, e.g.
+     * "gcr.io/dev-con/cloud-devshell:latest".
+     * 
+ * + * + * string docker_image = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for dockerImage to set. + * @return This builder for chaining. + */ + public Builder setDockerImageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dockerImage_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. Current execution state of this environment.
+     * 
+ * + * + * .google.cloud.shell.v1.Environment.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. Current execution state of this environment.
+     * 
+ * + * + * .google.cloud.shell.v1.Environment.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. Current execution state of this environment.
+     * 
+ * + * + * .google.cloud.shell.v1.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.shell.v1.Environment.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.shell.v1.Environment.State result = + com.google.cloud.shell.v1.Environment.State.valueOf(state_); + return result == null ? com.google.cloud.shell.v1.Environment.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. Current execution state of this environment.
+     * 
+ * + * + * .google.cloud.shell.v1.Environment.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.shell.v1.Environment.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Current execution state of this environment.
+     * 
+ * + * + * .google.cloud.shell.v1.Environment.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 webHost_ = ""; + /** + * + * + *
+     * Output only. Host to which clients can connect to initiate HTTPS or WSS
+     * connections with the environment.
+     * 
+ * + * string web_host = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The webHost. + */ + public java.lang.String getWebHost() { + java.lang.Object ref = webHost_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + webHost_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Host to which clients can connect to initiate HTTPS or WSS
+     * connections with the environment.
+     * 
+ * + * string web_host = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for webHost. + */ + public com.google.protobuf.ByteString getWebHostBytes() { + java.lang.Object ref = webHost_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + webHost_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Host to which clients can connect to initiate HTTPS or WSS
+     * connections with the environment.
+     * 
+ * + * string web_host = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The webHost to set. + * @return This builder for chaining. + */ + public Builder setWebHost(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + webHost_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Host to which clients can connect to initiate HTTPS or WSS
+     * connections with the environment.
+     * 
+ * + * string web_host = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearWebHost() { + + webHost_ = getDefaultInstance().getWebHost(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Host to which clients can connect to initiate HTTPS or WSS
+     * connections with the environment.
+     * 
+ * + * string web_host = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for webHost to set. + * @return This builder for chaining. + */ + public Builder setWebHostBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + webHost_ = value; + onChanged(); + return this; + } + + private java.lang.Object sshUsername_ = ""; + /** + * + * + *
+     * Output only. Username that clients should use when initiating SSH sessions
+     * with the environment.
+     * 
+ * + * string ssh_username = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sshUsername. + */ + public java.lang.String getSshUsername() { + java.lang.Object ref = sshUsername_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sshUsername_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Username that clients should use when initiating SSH sessions
+     * with the environment.
+     * 
+ * + * string ssh_username = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for sshUsername. + */ + public com.google.protobuf.ByteString getSshUsernameBytes() { + java.lang.Object ref = sshUsername_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sshUsername_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Username that clients should use when initiating SSH sessions
+     * with the environment.
+     * 
+ * + * string ssh_username = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The sshUsername to set. + * @return This builder for chaining. + */ + public Builder setSshUsername(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sshUsername_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Username that clients should use when initiating SSH sessions
+     * with the environment.
+     * 
+ * + * string ssh_username = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSshUsername() { + + sshUsername_ = getDefaultInstance().getSshUsername(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Username that clients should use when initiating SSH sessions
+     * with the environment.
+     * 
+ * + * string ssh_username = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for sshUsername to set. + * @return This builder for chaining. + */ + public Builder setSshUsernameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sshUsername_ = value; + onChanged(); + return this; + } + + private java.lang.Object sshHost_ = ""; + /** + * + * + *
+     * Output only. Host to which clients can connect to initiate SSH sessions
+     * with the environment.
+     * 
+ * + * string ssh_host = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sshHost. + */ + public java.lang.String getSshHost() { + java.lang.Object ref = sshHost_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sshHost_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Host to which clients can connect to initiate SSH sessions
+     * with the environment.
+     * 
+ * + * string ssh_host = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for sshHost. + */ + public com.google.protobuf.ByteString getSshHostBytes() { + java.lang.Object ref = sshHost_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sshHost_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Host to which clients can connect to initiate SSH sessions
+     * with the environment.
+     * 
+ * + * string ssh_host = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The sshHost to set. + * @return This builder for chaining. + */ + public Builder setSshHost(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sshHost_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Host to which clients can connect to initiate SSH sessions
+     * with the environment.
+     * 
+ * + * string ssh_host = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSshHost() { + + sshHost_ = getDefaultInstance().getSshHost(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Host to which clients can connect to initiate SSH sessions
+     * with the environment.
+     * 
+ * + * string ssh_host = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for sshHost to set. + * @return This builder for chaining. + */ + public Builder setSshHostBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sshHost_ = value; + onChanged(); + return this; + } + + private int sshPort_; + /** + * + * + *
+     * Output only. Port to which clients can connect to initiate SSH sessions
+     * with the environment.
+     * 
+ * + * int32 ssh_port = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sshPort. + */ + @java.lang.Override + public int getSshPort() { + return sshPort_; + } + /** + * + * + *
+     * Output only. Port to which clients can connect to initiate SSH sessions
+     * with the environment.
+     * 
+ * + * int32 ssh_port = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The sshPort to set. + * @return This builder for chaining. + */ + public Builder setSshPort(int value) { + + sshPort_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Port to which clients can connect to initiate SSH sessions
+     * with the environment.
+     * 
+ * + * int32 ssh_port = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSshPort() { + + sshPort_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList publicKeys_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePublicKeysIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + publicKeys_ = new com.google.protobuf.LazyStringArrayList(publicKeys_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Output only. Public keys associated with the environment. Clients can
+     * connect to this environment via SSH only if they possess a private key
+     * corresponding to at least one of these public keys. Keys can be added to or
+     * removed from the environment using the AddPublicKey and RemovePublicKey
+     * methods.
+     * 
+ * + * repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the publicKeys. + */ + public com.google.protobuf.ProtocolStringList getPublicKeysList() { + return publicKeys_.getUnmodifiableView(); + } + /** + * + * + *
+     * Output only. Public keys associated with the environment. Clients can
+     * connect to this environment via SSH only if they possess a private key
+     * corresponding to at least one of these public keys. Keys can be added to or
+     * removed from the environment using the AddPublicKey and RemovePublicKey
+     * methods.
+     * 
+ * + * repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of publicKeys. + */ + public int getPublicKeysCount() { + return publicKeys_.size(); + } + /** + * + * + *
+     * Output only. Public keys associated with the environment. Clients can
+     * connect to this environment via SSH only if they possess a private key
+     * corresponding to at least one of these public keys. Keys can be added to or
+     * removed from the environment using the AddPublicKey and RemovePublicKey
+     * methods.
+     * 
+ * + * repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the element to return. + * @return The publicKeys at the given index. + */ + public java.lang.String getPublicKeys(int index) { + return publicKeys_.get(index); + } + /** + * + * + *
+     * Output only. Public keys associated with the environment. Clients can
+     * connect to this environment via SSH only if they possess a private key
+     * corresponding to at least one of these public keys. Keys can be added to or
+     * removed from the environment using the AddPublicKey and RemovePublicKey
+     * methods.
+     * 
+ * + * repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the value to return. + * @return The bytes of the publicKeys at the given index. + */ + public com.google.protobuf.ByteString getPublicKeysBytes(int index) { + return publicKeys_.getByteString(index); + } + /** + * + * + *
+     * Output only. Public keys associated with the environment. Clients can
+     * connect to this environment via SSH only if they possess a private key
+     * corresponding to at least one of these public keys. Keys can be added to or
+     * removed from the environment using the AddPublicKey and RemovePublicKey
+     * methods.
+     * 
+ * + * repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index to set the value at. + * @param value The publicKeys to set. + * @return This builder for chaining. + */ + public Builder setPublicKeys(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePublicKeysIsMutable(); + publicKeys_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Public keys associated with the environment. Clients can
+     * connect to this environment via SSH only if they possess a private key
+     * corresponding to at least one of these public keys. Keys can be added to or
+     * removed from the environment using the AddPublicKey and RemovePublicKey
+     * methods.
+     * 
+ * + * repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The publicKeys to add. + * @return This builder for chaining. + */ + public Builder addPublicKeys(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePublicKeysIsMutable(); + publicKeys_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Public keys associated with the environment. Clients can
+     * connect to this environment via SSH only if they possess a private key
+     * corresponding to at least one of these public keys. Keys can be added to or
+     * removed from the environment using the AddPublicKey and RemovePublicKey
+     * methods.
+     * 
+ * + * repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param values The publicKeys to add. + * @return This builder for chaining. + */ + public Builder addAllPublicKeys(java.lang.Iterable values) { + ensurePublicKeysIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, publicKeys_); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Public keys associated with the environment. Clients can
+     * connect to this environment via SSH only if they possess a private key
+     * corresponding to at least one of these public keys. Keys can be added to or
+     * removed from the environment using the AddPublicKey and RemovePublicKey
+     * methods.
+     * 
+ * + * repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearPublicKeys() { + publicKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Public keys associated with the environment. Clients can
+     * connect to this environment via SSH only if they possess a private key
+     * corresponding to at least one of these public keys. Keys can be added to or
+     * removed from the environment using the AddPublicKey and RemovePublicKey
+     * methods.
+     * 
+ * + * repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes of the publicKeys to add. + * @return This builder for chaining. + */ + public Builder addPublicKeysBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePublicKeysIsMutable(); + publicKeys_.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.shell.v1.Environment) + } + + // @@protoc_insertion_point(class_scope:google.cloud.shell.v1.Environment) + private static final com.google.cloud.shell.v1.Environment DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.shell.v1.Environment(); + } + + public static com.google.cloud.shell.v1.Environment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Environment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Environment(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.shell.v1.Environment getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/EnvironmentName.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/EnvironmentName.java new file mode 100644 index 00000000..debf6a33 --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/EnvironmentName.java @@ -0,0 +1,192 @@ +/* + * 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. + */ + +package com.google.cloud.shell.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 EnvironmentName implements ResourceName { + private static final PathTemplate USER_ENVIRONMENT = + PathTemplate.createWithoutUrlEncoding("users/{user}/environments/{environment}"); + private volatile Map fieldValuesMap; + private final String user; + private final String environment; + + @Deprecated + protected EnvironmentName() { + user = null; + environment = null; + } + + private EnvironmentName(Builder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + environment = Preconditions.checkNotNull(builder.getEnvironment()); + } + + public String getUser() { + return user; + } + + public String getEnvironment() { + return environment; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static EnvironmentName of(String user, String environment) { + return newBuilder().setUser(user).setEnvironment(environment).build(); + } + + public static String format(String user, String environment) { + return newBuilder().setUser(user).setEnvironment(environment).build().toString(); + } + + public static EnvironmentName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + USER_ENVIRONMENT.validatedMatch( + formattedString, "EnvironmentName.parse: formattedString not in valid format"); + return of(matchMap.get("user"), matchMap.get("environment")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (EnvironmentName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return USER_ENVIRONMENT.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (user != null) { + fieldMapBuilder.put("user", user); + } + if (environment != null) { + fieldMapBuilder.put("environment", environment); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return USER_ENVIRONMENT.instantiate("user", user, "environment", environment); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + EnvironmentName that = ((EnvironmentName) o); + return Objects.equals(this.user, that.user) + && Objects.equals(this.environment, that.environment); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(user); + h *= 1000003; + h ^= Objects.hashCode(environment); + return h; + } + + /** Builder for users/{user}/environments/{environment}. */ + public static class Builder { + private String user; + private String environment; + + protected Builder() {} + + public String getUser() { + return user; + } + + public String getEnvironment() { + return environment; + } + + public Builder setUser(String user) { + this.user = user; + return this; + } + + public Builder setEnvironment(String environment) { + this.environment = environment; + return this; + } + + private Builder(EnvironmentName environmentName) { + user = environmentName.user; + environment = environmentName.environment; + } + + public EnvironmentName build() { + return new EnvironmentName(this); + } + } +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/EnvironmentOrBuilder.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/EnvironmentOrBuilder.java new file mode 100644 index 00000000..3e446231 --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/EnvironmentOrBuilder.java @@ -0,0 +1,307 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +public interface EnvironmentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.shell.v1.Environment) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. Full name of this resource, in the format
+   * `users/{owner_email}/environments/{environment_id}`. `{owner_email}` is the
+   * email address of the user to whom this environment belongs, and
+   * `{environment_id}` is the identifier of this environment. For example,
+   * `users/someone@example.com/environments/default`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. Full name of this resource, in the format
+   * `users/{owner_email}/environments/{environment_id}`. `{owner_email}` is the
+   * email address of the user to whom this environment belongs, and
+   * `{environment_id}` is the identifier of this environment. For example,
+   * `users/someone@example.com/environments/default`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The environment's identifier, unique among the user's
+   * environments.
+   * 
+ * + * string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+   * Output only. The environment's identifier, unique among the user's
+   * environments.
+   * 
+ * + * string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+   * Required. Immutable. Full path to the Docker image used to run this environment, e.g.
+   * "gcr.io/dev-con/cloud-devshell:latest".
+   * 
+ * + * + * string docker_image = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The dockerImage. + */ + java.lang.String getDockerImage(); + /** + * + * + *
+   * Required. Immutable. Full path to the Docker image used to run this environment, e.g.
+   * "gcr.io/dev-con/cloud-devshell:latest".
+   * 
+ * + * + * string docker_image = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for dockerImage. + */ + com.google.protobuf.ByteString getDockerImageBytes(); + + /** + * + * + *
+   * Output only. Current execution state of this environment.
+   * 
+ * + * + * .google.cloud.shell.v1.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. Current execution state of this environment.
+   * 
+ * + * + * .google.cloud.shell.v1.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.shell.v1.Environment.State getState(); + + /** + * + * + *
+   * Output only. Host to which clients can connect to initiate HTTPS or WSS
+   * connections with the environment.
+   * 
+ * + * string web_host = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The webHost. + */ + java.lang.String getWebHost(); + /** + * + * + *
+   * Output only. Host to which clients can connect to initiate HTTPS or WSS
+   * connections with the environment.
+   * 
+ * + * string web_host = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for webHost. + */ + com.google.protobuf.ByteString getWebHostBytes(); + + /** + * + * + *
+   * Output only. Username that clients should use when initiating SSH sessions
+   * with the environment.
+   * 
+ * + * string ssh_username = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sshUsername. + */ + java.lang.String getSshUsername(); + /** + * + * + *
+   * Output only. Username that clients should use when initiating SSH sessions
+   * with the environment.
+   * 
+ * + * string ssh_username = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for sshUsername. + */ + com.google.protobuf.ByteString getSshUsernameBytes(); + + /** + * + * + *
+   * Output only. Host to which clients can connect to initiate SSH sessions
+   * with the environment.
+   * 
+ * + * string ssh_host = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sshHost. + */ + java.lang.String getSshHost(); + /** + * + * + *
+   * Output only. Host to which clients can connect to initiate SSH sessions
+   * with the environment.
+   * 
+ * + * string ssh_host = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for sshHost. + */ + com.google.protobuf.ByteString getSshHostBytes(); + + /** + * + * + *
+   * Output only. Port to which clients can connect to initiate SSH sessions
+   * with the environment.
+   * 
+ * + * int32 ssh_port = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sshPort. + */ + int getSshPort(); + + /** + * + * + *
+   * Output only. Public keys associated with the environment. Clients can
+   * connect to this environment via SSH only if they possess a private key
+   * corresponding to at least one of these public keys. Keys can be added to or
+   * removed from the environment using the AddPublicKey and RemovePublicKey
+   * methods.
+   * 
+ * + * repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the publicKeys. + */ + java.util.List getPublicKeysList(); + /** + * + * + *
+   * Output only. Public keys associated with the environment. Clients can
+   * connect to this environment via SSH only if they possess a private key
+   * corresponding to at least one of these public keys. Keys can be added to or
+   * removed from the environment using the AddPublicKey and RemovePublicKey
+   * methods.
+   * 
+ * + * repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of publicKeys. + */ + int getPublicKeysCount(); + /** + * + * + *
+   * Output only. Public keys associated with the environment. Clients can
+   * connect to this environment via SSH only if they possess a private key
+   * corresponding to at least one of these public keys. Keys can be added to or
+   * removed from the environment using the AddPublicKey and RemovePublicKey
+   * methods.
+   * 
+ * + * repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the element to return. + * @return The publicKeys at the given index. + */ + java.lang.String getPublicKeys(int index); + /** + * + * + *
+   * Output only. Public keys associated with the environment. Clients can
+   * connect to this environment via SSH only if they possess a private key
+   * corresponding to at least one of these public keys. Keys can be added to or
+   * removed from the environment using the AddPublicKey and RemovePublicKey
+   * methods.
+   * 
+ * + * repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the value to return. + * @return The bytes of the publicKeys at the given index. + */ + com.google.protobuf.ByteString getPublicKeysBytes(int index); +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/GetEnvironmentRequest.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/GetEnvironmentRequest.java new file mode 100644 index 00000000..b84e1d77 --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/GetEnvironmentRequest.java @@ -0,0 +1,658 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +/** + * + * + *
+ * Request message for
+ * [GetEnvironment][google.cloud.shell.v1.CloudShellService.GetEnvironment].
+ * 
+ * + * Protobuf type {@code google.cloud.shell.v1.GetEnvironmentRequest} + */ +public final class GetEnvironmentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.shell.v1.GetEnvironmentRequest) + GetEnvironmentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetEnvironmentRequest.newBuilder() to construct. + private GetEnvironmentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetEnvironmentRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetEnvironmentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetEnvironmentRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_GetEnvironmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_GetEnvironmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.GetEnvironmentRequest.class, + com.google.cloud.shell.v1.GetEnvironmentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the requested resource, for example `users/me/environments/default`
+   * or `users/someone@example.com/environments/default`.
+   * 
+ * + * + * 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 requested resource, for example `users/me/environments/default`
+   * or `users/someone@example.com/environments/default`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.shell.v1.GetEnvironmentRequest)) { + return super.equals(obj); + } + com.google.cloud.shell.v1.GetEnvironmentRequest other = + (com.google.cloud.shell.v1.GetEnvironmentRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.shell.v1.GetEnvironmentRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.GetEnvironmentRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.shell.v1.GetEnvironmentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.GetEnvironmentRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.shell.v1.GetEnvironmentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.GetEnvironmentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.shell.v1.GetEnvironmentRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.GetEnvironmentRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.shell.v1.GetEnvironmentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.GetEnvironmentRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.shell.v1.GetEnvironmentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.GetEnvironmentRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.shell.v1.GetEnvironmentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [GetEnvironment][google.cloud.shell.v1.CloudShellService.GetEnvironment].
+   * 
+ * + * Protobuf type {@code google.cloud.shell.v1.GetEnvironmentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.shell.v1.GetEnvironmentRequest) + com.google.cloud.shell.v1.GetEnvironmentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_GetEnvironmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_GetEnvironmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.GetEnvironmentRequest.class, + com.google.cloud.shell.v1.GetEnvironmentRequest.Builder.class); + } + + // Construct using com.google.cloud.shell.v1.GetEnvironmentRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_GetEnvironmentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.shell.v1.GetEnvironmentRequest getDefaultInstanceForType() { + return com.google.cloud.shell.v1.GetEnvironmentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.shell.v1.GetEnvironmentRequest build() { + com.google.cloud.shell.v1.GetEnvironmentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.shell.v1.GetEnvironmentRequest buildPartial() { + com.google.cloud.shell.v1.GetEnvironmentRequest result = + new com.google.cloud.shell.v1.GetEnvironmentRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.shell.v1.GetEnvironmentRequest) { + return mergeFrom((com.google.cloud.shell.v1.GetEnvironmentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.shell.v1.GetEnvironmentRequest other) { + if (other == com.google.cloud.shell.v1.GetEnvironmentRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.shell.v1.GetEnvironmentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.shell.v1.GetEnvironmentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the requested resource, for example `users/me/environments/default`
+     * or `users/someone@example.com/environments/default`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the requested resource, for example `users/me/environments/default`
+     * or `users/someone@example.com/environments/default`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the requested resource, for example `users/me/environments/default`
+     * or `users/someone@example.com/environments/default`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the requested resource, for example `users/me/environments/default`
+     * or `users/someone@example.com/environments/default`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the requested resource, for example `users/me/environments/default`
+     * or `users/someone@example.com/environments/default`.
+     * 
+ * + * + * 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.shell.v1.GetEnvironmentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.shell.v1.GetEnvironmentRequest) + private static final com.google.cloud.shell.v1.GetEnvironmentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.shell.v1.GetEnvironmentRequest(); + } + + public static com.google.cloud.shell.v1.GetEnvironmentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetEnvironmentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetEnvironmentRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.shell.v1.GetEnvironmentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/GetEnvironmentRequestOrBuilder.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/GetEnvironmentRequestOrBuilder.java new file mode 100644 index 00000000..0976807c --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/GetEnvironmentRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +public interface GetEnvironmentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.shell.v1.GetEnvironmentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the requested resource, for example `users/me/environments/default`
+   * or `users/someone@example.com/environments/default`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the requested resource, for example `users/me/environments/default`
+   * or `users/someone@example.com/environments/default`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyMetadata.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyMetadata.java new file mode 100644 index 00000000..ce223282 --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyMetadata.java @@ -0,0 +1,458 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +/** + * + * + *
+ * Message included in the metadata field of operations returned from
+ * [RemovePublicKey][google.cloud.shell.v1.CloudShellService.RemovePublicKey].
+ * 
+ * + * Protobuf type {@code google.cloud.shell.v1.RemovePublicKeyMetadata} + */ +public final class RemovePublicKeyMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.shell.v1.RemovePublicKeyMetadata) + RemovePublicKeyMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use RemovePublicKeyMetadata.newBuilder() to construct. + private RemovePublicKeyMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RemovePublicKeyMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RemovePublicKeyMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RemovePublicKeyMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_RemovePublicKeyMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_RemovePublicKeyMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.RemovePublicKeyMetadata.class, + com.google.cloud.shell.v1.RemovePublicKeyMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.shell.v1.RemovePublicKeyMetadata)) { + return super.equals(obj); + } + com.google.cloud.shell.v1.RemovePublicKeyMetadata other = + (com.google.cloud.shell.v1.RemovePublicKeyMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.shell.v1.RemovePublicKeyMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyMetadata 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.shell.v1.RemovePublicKeyMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyMetadata 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.shell.v1.RemovePublicKeyMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyMetadata 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.shell.v1.RemovePublicKeyMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyMetadata 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.shell.v1.RemovePublicKeyMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyMetadata 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.shell.v1.RemovePublicKeyMetadata 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 included in the metadata field of operations returned from
+   * [RemovePublicKey][google.cloud.shell.v1.CloudShellService.RemovePublicKey].
+   * 
+ * + * Protobuf type {@code google.cloud.shell.v1.RemovePublicKeyMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.shell.v1.RemovePublicKeyMetadata) + com.google.cloud.shell.v1.RemovePublicKeyMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_RemovePublicKeyMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_RemovePublicKeyMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.RemovePublicKeyMetadata.class, + com.google.cloud.shell.v1.RemovePublicKeyMetadata.Builder.class); + } + + // Construct using com.google.cloud.shell.v1.RemovePublicKeyMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_RemovePublicKeyMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.shell.v1.RemovePublicKeyMetadata getDefaultInstanceForType() { + return com.google.cloud.shell.v1.RemovePublicKeyMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.shell.v1.RemovePublicKeyMetadata build() { + com.google.cloud.shell.v1.RemovePublicKeyMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.shell.v1.RemovePublicKeyMetadata buildPartial() { + com.google.cloud.shell.v1.RemovePublicKeyMetadata result = + new com.google.cloud.shell.v1.RemovePublicKeyMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.shell.v1.RemovePublicKeyMetadata) { + return mergeFrom((com.google.cloud.shell.v1.RemovePublicKeyMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.shell.v1.RemovePublicKeyMetadata other) { + if (other == com.google.cloud.shell.v1.RemovePublicKeyMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.shell.v1.RemovePublicKeyMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.shell.v1.RemovePublicKeyMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.shell.v1.RemovePublicKeyMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.shell.v1.RemovePublicKeyMetadata) + private static final com.google.cloud.shell.v1.RemovePublicKeyMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.shell.v1.RemovePublicKeyMetadata(); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemovePublicKeyMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemovePublicKeyMetadata(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.shell.v1.RemovePublicKeyMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyMetadataOrBuilder.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyMetadataOrBuilder.java new file mode 100644 index 00000000..7f53e700 --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +public interface RemovePublicKeyMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.shell.v1.RemovePublicKeyMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyRequest.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyRequest.java new file mode 100644 index 00000000..522eb047 --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyRequest.java @@ -0,0 +1,823 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +/** + * + * + *
+ * Request message for
+ * [RemovePublicKey][google.cloud.shell.v1.CloudShellService.RemovePublicKey].
+ * 
+ * + * Protobuf type {@code google.cloud.shell.v1.RemovePublicKeyRequest} + */ +public final class RemovePublicKeyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.shell.v1.RemovePublicKeyRequest) + RemovePublicKeyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RemovePublicKeyRequest.newBuilder() to construct. + private RemovePublicKeyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RemovePublicKeyRequest() { + environment_ = ""; + key_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RemovePublicKeyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RemovePublicKeyRequest( + 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(); + + environment_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_RemovePublicKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_RemovePublicKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.RemovePublicKeyRequest.class, + com.google.cloud.shell.v1.RemovePublicKeyRequest.Builder.class); + } + + public static final int ENVIRONMENT_FIELD_NUMBER = 1; + private volatile java.lang.Object environment_; + /** + * + * + *
+   * Environment this key should be removed from, e.g.
+   * `users/me/environments/default`.
+   * 
+ * + * string environment = 1; + * + * @return The environment. + */ + @java.lang.Override + public java.lang.String getEnvironment() { + java.lang.Object ref = environment_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + environment_ = s; + return s; + } + } + /** + * + * + *
+   * Environment this key should be removed from, e.g.
+   * `users/me/environments/default`.
+   * 
+ * + * string environment = 1; + * + * @return The bytes for environment. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEnvironmentBytes() { + java.lang.Object ref = environment_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + environment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KEY_FIELD_NUMBER = 2; + private volatile java.lang.Object key_; + /** + * + * + *
+   * Key that should be removed from the environment.
+   * 
+ * + * string key = 2; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * + * + *
+   * Key that should be removed from the environment.
+   * 
+ * + * string key = 2; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = 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 (!getEnvironmentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, environment_); + } + if (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, key_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getEnvironmentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, environment_); + } + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, key_); + } + 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.shell.v1.RemovePublicKeyRequest)) { + return super.equals(obj); + } + com.google.cloud.shell.v1.RemovePublicKeyRequest other = + (com.google.cloud.shell.v1.RemovePublicKeyRequest) obj; + + if (!getEnvironment().equals(other.getEnvironment())) return false; + if (!getKey().equals(other.getKey())) 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) + ENVIRONMENT_FIELD_NUMBER; + hash = (53 * hash) + getEnvironment().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.shell.v1.RemovePublicKeyRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyRequest 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.shell.v1.RemovePublicKeyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyRequest 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.shell.v1.RemovePublicKeyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyRequest 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.shell.v1.RemovePublicKeyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyRequest 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.shell.v1.RemovePublicKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyRequest 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.shell.v1.RemovePublicKeyRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [RemovePublicKey][google.cloud.shell.v1.CloudShellService.RemovePublicKey].
+   * 
+ * + * Protobuf type {@code google.cloud.shell.v1.RemovePublicKeyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.shell.v1.RemovePublicKeyRequest) + com.google.cloud.shell.v1.RemovePublicKeyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_RemovePublicKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_RemovePublicKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.RemovePublicKeyRequest.class, + com.google.cloud.shell.v1.RemovePublicKeyRequest.Builder.class); + } + + // Construct using com.google.cloud.shell.v1.RemovePublicKeyRequest.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(); + environment_ = ""; + + key_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_RemovePublicKeyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.shell.v1.RemovePublicKeyRequest getDefaultInstanceForType() { + return com.google.cloud.shell.v1.RemovePublicKeyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.shell.v1.RemovePublicKeyRequest build() { + com.google.cloud.shell.v1.RemovePublicKeyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.shell.v1.RemovePublicKeyRequest buildPartial() { + com.google.cloud.shell.v1.RemovePublicKeyRequest result = + new com.google.cloud.shell.v1.RemovePublicKeyRequest(this); + result.environment_ = environment_; + result.key_ = key_; + 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.shell.v1.RemovePublicKeyRequest) { + return mergeFrom((com.google.cloud.shell.v1.RemovePublicKeyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.shell.v1.RemovePublicKeyRequest other) { + if (other == com.google.cloud.shell.v1.RemovePublicKeyRequest.getDefaultInstance()) + return this; + if (!other.getEnvironment().isEmpty()) { + environment_ = other.environment_; + onChanged(); + } + if (!other.getKey().isEmpty()) { + key_ = other.key_; + 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.shell.v1.RemovePublicKeyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.shell.v1.RemovePublicKeyRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object environment_ = ""; + /** + * + * + *
+     * Environment this key should be removed from, e.g.
+     * `users/me/environments/default`.
+     * 
+ * + * string environment = 1; + * + * @return The environment. + */ + public java.lang.String getEnvironment() { + java.lang.Object ref = environment_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + environment_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Environment this key should be removed from, e.g.
+     * `users/me/environments/default`.
+     * 
+ * + * string environment = 1; + * + * @return The bytes for environment. + */ + public com.google.protobuf.ByteString getEnvironmentBytes() { + java.lang.Object ref = environment_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + environment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Environment this key should be removed from, e.g.
+     * `users/me/environments/default`.
+     * 
+ * + * string environment = 1; + * + * @param value The environment to set. + * @return This builder for chaining. + */ + public Builder setEnvironment(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + environment_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Environment this key should be removed from, e.g.
+     * `users/me/environments/default`.
+     * 
+ * + * string environment = 1; + * + * @return This builder for chaining. + */ + public Builder clearEnvironment() { + + environment_ = getDefaultInstance().getEnvironment(); + onChanged(); + return this; + } + /** + * + * + *
+     * Environment this key should be removed from, e.g.
+     * `users/me/environments/default`.
+     * 
+ * + * string environment = 1; + * + * @param value The bytes for environment to set. + * @return This builder for chaining. + */ + public Builder setEnvironmentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + environment_ = value; + onChanged(); + return this; + } + + private java.lang.Object key_ = ""; + /** + * + * + *
+     * Key that should be removed from the environment.
+     * 
+ * + * string key = 2; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Key that should be removed from the environment.
+     * 
+ * + * string key = 2; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Key that should be removed from the environment.
+     * 
+ * + * string key = 2; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Key that should be removed from the environment.
+     * 
+ * + * string key = 2; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * + * + *
+     * Key that should be removed from the environment.
+     * 
+ * + * string key = 2; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = 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.shell.v1.RemovePublicKeyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.shell.v1.RemovePublicKeyRequest) + private static final com.google.cloud.shell.v1.RemovePublicKeyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.shell.v1.RemovePublicKeyRequest(); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemovePublicKeyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemovePublicKeyRequest(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.shell.v1.RemovePublicKeyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyRequestOrBuilder.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyRequestOrBuilder.java new file mode 100644 index 00000000..af48506a --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyRequestOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +public interface RemovePublicKeyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.shell.v1.RemovePublicKeyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Environment this key should be removed from, e.g.
+   * `users/me/environments/default`.
+   * 
+ * + * string environment = 1; + * + * @return The environment. + */ + java.lang.String getEnvironment(); + /** + * + * + *
+   * Environment this key should be removed from, e.g.
+   * `users/me/environments/default`.
+   * 
+ * + * string environment = 1; + * + * @return The bytes for environment. + */ + com.google.protobuf.ByteString getEnvironmentBytes(); + + /** + * + * + *
+   * Key that should be removed from the environment.
+   * 
+ * + * string key = 2; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+   * Key that should be removed from the environment.
+   * 
+ * + * string key = 2; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyResponse.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyResponse.java new file mode 100644 index 00000000..847e24a6 --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyResponse.java @@ -0,0 +1,458 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +/** + * + * + *
+ * Response message for
+ * [RemovePublicKey][google.cloud.shell.v1.CloudShellService.RemovePublicKey].
+ * 
+ * + * Protobuf type {@code google.cloud.shell.v1.RemovePublicKeyResponse} + */ +public final class RemovePublicKeyResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.shell.v1.RemovePublicKeyResponse) + RemovePublicKeyResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use RemovePublicKeyResponse.newBuilder() to construct. + private RemovePublicKeyResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RemovePublicKeyResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RemovePublicKeyResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RemovePublicKeyResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_RemovePublicKeyResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_RemovePublicKeyResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.RemovePublicKeyResponse.class, + com.google.cloud.shell.v1.RemovePublicKeyResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.shell.v1.RemovePublicKeyResponse)) { + return super.equals(obj); + } + com.google.cloud.shell.v1.RemovePublicKeyResponse other = + (com.google.cloud.shell.v1.RemovePublicKeyResponse) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.shell.v1.RemovePublicKeyResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyResponse 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.shell.v1.RemovePublicKeyResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyResponse 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.shell.v1.RemovePublicKeyResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyResponse 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.shell.v1.RemovePublicKeyResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyResponse 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.shell.v1.RemovePublicKeyResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyResponse 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.shell.v1.RemovePublicKeyResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for
+   * [RemovePublicKey][google.cloud.shell.v1.CloudShellService.RemovePublicKey].
+   * 
+ * + * Protobuf type {@code google.cloud.shell.v1.RemovePublicKeyResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.shell.v1.RemovePublicKeyResponse) + com.google.cloud.shell.v1.RemovePublicKeyResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_RemovePublicKeyResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_RemovePublicKeyResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.RemovePublicKeyResponse.class, + com.google.cloud.shell.v1.RemovePublicKeyResponse.Builder.class); + } + + // Construct using com.google.cloud.shell.v1.RemovePublicKeyResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_RemovePublicKeyResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.shell.v1.RemovePublicKeyResponse getDefaultInstanceForType() { + return com.google.cloud.shell.v1.RemovePublicKeyResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.shell.v1.RemovePublicKeyResponse build() { + com.google.cloud.shell.v1.RemovePublicKeyResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.shell.v1.RemovePublicKeyResponse buildPartial() { + com.google.cloud.shell.v1.RemovePublicKeyResponse result = + new com.google.cloud.shell.v1.RemovePublicKeyResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.shell.v1.RemovePublicKeyResponse) { + return mergeFrom((com.google.cloud.shell.v1.RemovePublicKeyResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.shell.v1.RemovePublicKeyResponse other) { + if (other == com.google.cloud.shell.v1.RemovePublicKeyResponse.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.shell.v1.RemovePublicKeyResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.shell.v1.RemovePublicKeyResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.shell.v1.RemovePublicKeyResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.shell.v1.RemovePublicKeyResponse) + private static final com.google.cloud.shell.v1.RemovePublicKeyResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.shell.v1.RemovePublicKeyResponse(); + } + + public static com.google.cloud.shell.v1.RemovePublicKeyResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemovePublicKeyResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemovePublicKeyResponse(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.shell.v1.RemovePublicKeyResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyResponseOrBuilder.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyResponseOrBuilder.java new file mode 100644 index 00000000..0c4daa2f --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/RemovePublicKeyResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +public interface RemovePublicKeyResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.shell.v1.RemovePublicKeyResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentMetadata.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentMetadata.java new file mode 100644 index 00000000..5ce88ab7 --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentMetadata.java @@ -0,0 +1,838 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +/** + * + * + *
+ * Message included in the metadata field of operations returned from
+ * [StartEnvironment][google.cloud.shell.v1.CloudShellService.StartEnvironment].
+ * 
+ * + * Protobuf type {@code google.cloud.shell.v1.StartEnvironmentMetadata} + */ +public final class StartEnvironmentMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.shell.v1.StartEnvironmentMetadata) + StartEnvironmentMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use StartEnvironmentMetadata.newBuilder() to construct. + private StartEnvironmentMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StartEnvironmentMetadata() { + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StartEnvironmentMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StartEnvironmentMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_StartEnvironmentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_StartEnvironmentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.StartEnvironmentMetadata.class, + com.google.cloud.shell.v1.StartEnvironmentMetadata.Builder.class); + } + + /** + * + * + *
+   * Possible states an environment might transition between during startup.
+   * These states are not normally actionable by clients, but may be used to
+   * show a progress message to the user. An environment won't necessarily go
+   * through all of these states when starting. More states are likely to be
+   * added in the future.
+   * 
+ * + * Protobuf enum {@code google.cloud.shell.v1.StartEnvironmentMetadata.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The environment's start state is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The environment is in the process of being started, but no additional
+     * details are available.
+     * 
+ * + * STARTING = 1; + */ + STARTING(1), + /** + * + * + *
+     * Startup is waiting for the user's disk to be unarchived. This can happen
+     * when the user returns to Cloud Shell after not having used it for a
+     * while, and suggests that startup will take longer than normal.
+     * 
+ * + * UNARCHIVING_DISK = 2; + */ + UNARCHIVING_DISK(2), + /** + * + * + *
+     * Startup is waiting for compute resources to be assigned to the
+     * environment. This should normally happen very quickly, but an environment
+     * might stay in this state for an extended period of time if the system is
+     * experiencing heavy load.
+     * 
+ * + * AWAITING_COMPUTE_RESOURCES = 4; + */ + AWAITING_COMPUTE_RESOURCES(4), + /** + * + * + *
+     * Startup has completed. If the start operation was successful, the user
+     * should be able to establish an SSH connection to their environment.
+     * Otherwise, the operation will contain details of the failure.
+     * 
+ * + * FINISHED = 3; + */ + FINISHED(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The environment's start state is unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The environment is in the process of being started, but no additional
+     * details are available.
+     * 
+ * + * STARTING = 1; + */ + public static final int STARTING_VALUE = 1; + /** + * + * + *
+     * Startup is waiting for the user's disk to be unarchived. This can happen
+     * when the user returns to Cloud Shell after not having used it for a
+     * while, and suggests that startup will take longer than normal.
+     * 
+ * + * UNARCHIVING_DISK = 2; + */ + public static final int UNARCHIVING_DISK_VALUE = 2; + /** + * + * + *
+     * Startup is waiting for compute resources to be assigned to the
+     * environment. This should normally happen very quickly, but an environment
+     * might stay in this state for an extended period of time if the system is
+     * experiencing heavy load.
+     * 
+ * + * AWAITING_COMPUTE_RESOURCES = 4; + */ + public static final int AWAITING_COMPUTE_RESOURCES_VALUE = 4; + /** + * + * + *
+     * Startup has completed. If the start operation was successful, the user
+     * should be able to establish an SSH connection to their environment.
+     * Otherwise, the operation will contain details of the failure.
+     * 
+ * + * FINISHED = 3; + */ + public static final int FINISHED_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return STARTING; + case 2: + return UNARCHIVING_DISK; + case 4: + return AWAITING_COMPUTE_RESOURCES; + case 3: + return FINISHED; + 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.shell.v1.StartEnvironmentMetadata.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.shell.v1.StartEnvironmentMetadata.State) + } + + public static final int STATE_FIELD_NUMBER = 1; + private int state_; + /** + * + * + *
+   * Current state of the environment being started.
+   * 
+ * + * .google.cloud.shell.v1.StartEnvironmentMetadata.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Current state of the environment being started.
+   * 
+ * + * .google.cloud.shell.v1.StartEnvironmentMetadata.State state = 1; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.shell.v1.StartEnvironmentMetadata.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.shell.v1.StartEnvironmentMetadata.State result = + com.google.cloud.shell.v1.StartEnvironmentMetadata.State.valueOf(state_); + return result == null + ? com.google.cloud.shell.v1.StartEnvironmentMetadata.State.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (state_ + != com.google.cloud.shell.v1.StartEnvironmentMetadata.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, state_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (state_ + != com.google.cloud.shell.v1.StartEnvironmentMetadata.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, state_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.shell.v1.StartEnvironmentMetadata)) { + return super.equals(obj); + } + com.google.cloud.shell.v1.StartEnvironmentMetadata other = + (com.google.cloud.shell.v1.StartEnvironmentMetadata) obj; + + if (state_ != other.state_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.shell.v1.StartEnvironmentMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.StartEnvironmentMetadata 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.shell.v1.StartEnvironmentMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.StartEnvironmentMetadata 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.shell.v1.StartEnvironmentMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.StartEnvironmentMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.shell.v1.StartEnvironmentMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.StartEnvironmentMetadata 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.shell.v1.StartEnvironmentMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.StartEnvironmentMetadata 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.shell.v1.StartEnvironmentMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.StartEnvironmentMetadata 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.shell.v1.StartEnvironmentMetadata 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 included in the metadata field of operations returned from
+   * [StartEnvironment][google.cloud.shell.v1.CloudShellService.StartEnvironment].
+   * 
+ * + * Protobuf type {@code google.cloud.shell.v1.StartEnvironmentMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.shell.v1.StartEnvironmentMetadata) + com.google.cloud.shell.v1.StartEnvironmentMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_StartEnvironmentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_StartEnvironmentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.StartEnvironmentMetadata.class, + com.google.cloud.shell.v1.StartEnvironmentMetadata.Builder.class); + } + + // Construct using com.google.cloud.shell.v1.StartEnvironmentMetadata.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(); + state_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_StartEnvironmentMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.shell.v1.StartEnvironmentMetadata getDefaultInstanceForType() { + return com.google.cloud.shell.v1.StartEnvironmentMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.shell.v1.StartEnvironmentMetadata build() { + com.google.cloud.shell.v1.StartEnvironmentMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.shell.v1.StartEnvironmentMetadata buildPartial() { + com.google.cloud.shell.v1.StartEnvironmentMetadata result = + new com.google.cloud.shell.v1.StartEnvironmentMetadata(this); + result.state_ = state_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.shell.v1.StartEnvironmentMetadata) { + return mergeFrom((com.google.cloud.shell.v1.StartEnvironmentMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.shell.v1.StartEnvironmentMetadata other) { + if (other == com.google.cloud.shell.v1.StartEnvironmentMetadata.getDefaultInstance()) + return this; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.shell.v1.StartEnvironmentMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.shell.v1.StartEnvironmentMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Current state of the environment being started.
+     * 
+ * + * .google.cloud.shell.v1.StartEnvironmentMetadata.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Current state of the environment being started.
+     * 
+ * + * .google.cloud.shell.v1.StartEnvironmentMetadata.State state = 1; + * + * @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; + } + /** + * + * + *
+     * Current state of the environment being started.
+     * 
+ * + * .google.cloud.shell.v1.StartEnvironmentMetadata.State state = 1; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.shell.v1.StartEnvironmentMetadata.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.shell.v1.StartEnvironmentMetadata.State result = + com.google.cloud.shell.v1.StartEnvironmentMetadata.State.valueOf(state_); + return result == null + ? com.google.cloud.shell.v1.StartEnvironmentMetadata.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Current state of the environment being started.
+     * 
+ * + * .google.cloud.shell.v1.StartEnvironmentMetadata.State state = 1; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.shell.v1.StartEnvironmentMetadata.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Current state of the environment being started.
+     * 
+ * + * .google.cloud.shell.v1.StartEnvironmentMetadata.State state = 1; + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.shell.v1.StartEnvironmentMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.shell.v1.StartEnvironmentMetadata) + private static final com.google.cloud.shell.v1.StartEnvironmentMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.shell.v1.StartEnvironmentMetadata(); + } + + public static com.google.cloud.shell.v1.StartEnvironmentMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StartEnvironmentMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StartEnvironmentMetadata(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.shell.v1.StartEnvironmentMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentMetadataOrBuilder.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentMetadataOrBuilder.java new file mode 100644 index 00000000..289efb7a --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentMetadataOrBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +public interface StartEnvironmentMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.shell.v1.StartEnvironmentMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Current state of the environment being started.
+   * 
+ * + * .google.cloud.shell.v1.StartEnvironmentMetadata.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Current state of the environment being started.
+   * 
+ * + * .google.cloud.shell.v1.StartEnvironmentMetadata.State state = 1; + * + * @return The state. + */ + com.google.cloud.shell.v1.StartEnvironmentMetadata.State getState(); +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentRequest.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentRequest.java new file mode 100644 index 00000000..902b66f1 --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentRequest.java @@ -0,0 +1,1132 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +/** + * + * + *
+ * Request message for
+ * [StartEnvironment][google.cloud.shell.v1.CloudShellService.StartEnvironment].
+ * 
+ * + * Protobuf type {@code google.cloud.shell.v1.StartEnvironmentRequest} + */ +public final class StartEnvironmentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.shell.v1.StartEnvironmentRequest) + StartEnvironmentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StartEnvironmentRequest.newBuilder() to construct. + private StartEnvironmentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StartEnvironmentRequest() { + name_ = ""; + accessToken_ = ""; + publicKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StartEnvironmentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StartEnvironmentRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + accessToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + publicKeys_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + publicKeys_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + publicKeys_ = publicKeys_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_StartEnvironmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_StartEnvironmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.StartEnvironmentRequest.class, + com.google.cloud.shell.v1.StartEnvironmentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Name of the resource that should be started, for example
+   * `users/me/environments/default` or
+   * `users/someone@example.com/environments/default`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the resource that should be started, for example
+   * `users/me/environments/default` or
+   * `users/someone@example.com/environments/default`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACCESS_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object accessToken_; + /** + * + * + *
+   * The initial access token passed to the environment. If this is present and
+   * valid, the environment will be pre-authenticated with gcloud so that the
+   * user can run gcloud commands in Cloud Shell without having to log in. This
+   * code can be updated later by calling AuthorizeEnvironment.
+   * 
+ * + * string access_token = 2; + * + * @return The accessToken. + */ + @java.lang.Override + public java.lang.String getAccessToken() { + java.lang.Object ref = accessToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + accessToken_ = s; + return s; + } + } + /** + * + * + *
+   * The initial access token passed to the environment. If this is present and
+   * valid, the environment will be pre-authenticated with gcloud so that the
+   * user can run gcloud commands in Cloud Shell without having to log in. This
+   * code can be updated later by calling AuthorizeEnvironment.
+   * 
+ * + * string access_token = 2; + * + * @return The bytes for accessToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAccessTokenBytes() { + java.lang.Object ref = accessToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + accessToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PUBLIC_KEYS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList publicKeys_; + /** + * + * + *
+   * Public keys that should be added to the environment before it is started.
+   * 
+ * + * repeated string public_keys = 3; + * + * @return A list containing the publicKeys. + */ + public com.google.protobuf.ProtocolStringList getPublicKeysList() { + return publicKeys_; + } + /** + * + * + *
+   * Public keys that should be added to the environment before it is started.
+   * 
+ * + * repeated string public_keys = 3; + * + * @return The count of publicKeys. + */ + public int getPublicKeysCount() { + return publicKeys_.size(); + } + /** + * + * + *
+   * Public keys that should be added to the environment before it is started.
+   * 
+ * + * repeated string public_keys = 3; + * + * @param index The index of the element to return. + * @return The publicKeys at the given index. + */ + public java.lang.String getPublicKeys(int index) { + return publicKeys_.get(index); + } + /** + * + * + *
+   * Public keys that should be added to the environment before it is started.
+   * 
+ * + * repeated string public_keys = 3; + * + * @param index The index of the value to return. + * @return The bytes of the publicKeys at the given index. + */ + public com.google.protobuf.ByteString getPublicKeysBytes(int index) { + return publicKeys_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getAccessTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, accessToken_); + } + for (int i = 0; i < publicKeys_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, publicKeys_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getAccessTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, accessToken_); + } + { + int dataSize = 0; + for (int i = 0; i < publicKeys_.size(); i++) { + dataSize += computeStringSizeNoTag(publicKeys_.getRaw(i)); + } + size += dataSize; + size += 1 * getPublicKeysList().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.shell.v1.StartEnvironmentRequest)) { + return super.equals(obj); + } + com.google.cloud.shell.v1.StartEnvironmentRequest other = + (com.google.cloud.shell.v1.StartEnvironmentRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getAccessToken().equals(other.getAccessToken())) return false; + if (!getPublicKeysList().equals(other.getPublicKeysList())) 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) + ACCESS_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getAccessToken().hashCode(); + if (getPublicKeysCount() > 0) { + hash = (37 * hash) + PUBLIC_KEYS_FIELD_NUMBER; + hash = (53 * hash) + getPublicKeysList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.shell.v1.StartEnvironmentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.StartEnvironmentRequest 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.shell.v1.StartEnvironmentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.StartEnvironmentRequest 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.shell.v1.StartEnvironmentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.StartEnvironmentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.shell.v1.StartEnvironmentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.StartEnvironmentRequest 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.shell.v1.StartEnvironmentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.StartEnvironmentRequest 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.shell.v1.StartEnvironmentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.StartEnvironmentRequest 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.shell.v1.StartEnvironmentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [StartEnvironment][google.cloud.shell.v1.CloudShellService.StartEnvironment].
+   * 
+ * + * Protobuf type {@code google.cloud.shell.v1.StartEnvironmentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.shell.v1.StartEnvironmentRequest) + com.google.cloud.shell.v1.StartEnvironmentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_StartEnvironmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_StartEnvironmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.StartEnvironmentRequest.class, + com.google.cloud.shell.v1.StartEnvironmentRequest.Builder.class); + } + + // Construct using com.google.cloud.shell.v1.StartEnvironmentRequest.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_ = ""; + + accessToken_ = ""; + + publicKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_StartEnvironmentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.shell.v1.StartEnvironmentRequest getDefaultInstanceForType() { + return com.google.cloud.shell.v1.StartEnvironmentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.shell.v1.StartEnvironmentRequest build() { + com.google.cloud.shell.v1.StartEnvironmentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.shell.v1.StartEnvironmentRequest buildPartial() { + com.google.cloud.shell.v1.StartEnvironmentRequest result = + new com.google.cloud.shell.v1.StartEnvironmentRequest(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.accessToken_ = accessToken_; + if (((bitField0_ & 0x00000001) != 0)) { + publicKeys_ = publicKeys_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.publicKeys_ = publicKeys_; + 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.shell.v1.StartEnvironmentRequest) { + return mergeFrom((com.google.cloud.shell.v1.StartEnvironmentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.shell.v1.StartEnvironmentRequest other) { + if (other == com.google.cloud.shell.v1.StartEnvironmentRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getAccessToken().isEmpty()) { + accessToken_ = other.accessToken_; + onChanged(); + } + if (!other.publicKeys_.isEmpty()) { + if (publicKeys_.isEmpty()) { + publicKeys_ = other.publicKeys_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePublicKeysIsMutable(); + publicKeys_.addAll(other.publicKeys_); + } + 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.shell.v1.StartEnvironmentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.shell.v1.StartEnvironmentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Name of the resource that should be started, for example
+     * `users/me/environments/default` or
+     * `users/someone@example.com/environments/default`.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the resource that should be started, for example
+     * `users/me/environments/default` or
+     * `users/someone@example.com/environments/default`.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the resource that should be started, for example
+     * `users/me/environments/default` or
+     * `users/someone@example.com/environments/default`.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the resource that should be started, for example
+     * `users/me/environments/default` or
+     * `users/someone@example.com/environments/default`.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the resource that should be started, for example
+     * `users/me/environments/default` or
+     * `users/someone@example.com/environments/default`.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object accessToken_ = ""; + /** + * + * + *
+     * The initial access token passed to the environment. If this is present and
+     * valid, the environment will be pre-authenticated with gcloud so that the
+     * user can run gcloud commands in Cloud Shell without having to log in. This
+     * code can be updated later by calling AuthorizeEnvironment.
+     * 
+ * + * string access_token = 2; + * + * @return The accessToken. + */ + public java.lang.String getAccessToken() { + java.lang.Object ref = accessToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + accessToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The initial access token passed to the environment. If this is present and
+     * valid, the environment will be pre-authenticated with gcloud so that the
+     * user can run gcloud commands in Cloud Shell without having to log in. This
+     * code can be updated later by calling AuthorizeEnvironment.
+     * 
+ * + * string access_token = 2; + * + * @return The bytes for accessToken. + */ + public com.google.protobuf.ByteString getAccessTokenBytes() { + java.lang.Object ref = accessToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + accessToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The initial access token passed to the environment. If this is present and
+     * valid, the environment will be pre-authenticated with gcloud so that the
+     * user can run gcloud commands in Cloud Shell without having to log in. This
+     * code can be updated later by calling AuthorizeEnvironment.
+     * 
+ * + * string access_token = 2; + * + * @param value The accessToken to set. + * @return This builder for chaining. + */ + public Builder setAccessToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + accessToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The initial access token passed to the environment. If this is present and
+     * valid, the environment will be pre-authenticated with gcloud so that the
+     * user can run gcloud commands in Cloud Shell without having to log in. This
+     * code can be updated later by calling AuthorizeEnvironment.
+     * 
+ * + * string access_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearAccessToken() { + + accessToken_ = getDefaultInstance().getAccessToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The initial access token passed to the environment. If this is present and
+     * valid, the environment will be pre-authenticated with gcloud so that the
+     * user can run gcloud commands in Cloud Shell without having to log in. This
+     * code can be updated later by calling AuthorizeEnvironment.
+     * 
+ * + * string access_token = 2; + * + * @param value The bytes for accessToken to set. + * @return This builder for chaining. + */ + public Builder setAccessTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + accessToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList publicKeys_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePublicKeysIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + publicKeys_ = new com.google.protobuf.LazyStringArrayList(publicKeys_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Public keys that should be added to the environment before it is started.
+     * 
+ * + * repeated string public_keys = 3; + * + * @return A list containing the publicKeys. + */ + public com.google.protobuf.ProtocolStringList getPublicKeysList() { + return publicKeys_.getUnmodifiableView(); + } + /** + * + * + *
+     * Public keys that should be added to the environment before it is started.
+     * 
+ * + * repeated string public_keys = 3; + * + * @return The count of publicKeys. + */ + public int getPublicKeysCount() { + return publicKeys_.size(); + } + /** + * + * + *
+     * Public keys that should be added to the environment before it is started.
+     * 
+ * + * repeated string public_keys = 3; + * + * @param index The index of the element to return. + * @return The publicKeys at the given index. + */ + public java.lang.String getPublicKeys(int index) { + return publicKeys_.get(index); + } + /** + * + * + *
+     * Public keys that should be added to the environment before it is started.
+     * 
+ * + * repeated string public_keys = 3; + * + * @param index The index of the value to return. + * @return The bytes of the publicKeys at the given index. + */ + public com.google.protobuf.ByteString getPublicKeysBytes(int index) { + return publicKeys_.getByteString(index); + } + /** + * + * + *
+     * Public keys that should be added to the environment before it is started.
+     * 
+ * + * repeated string public_keys = 3; + * + * @param index The index to set the value at. + * @param value The publicKeys to set. + * @return This builder for chaining. + */ + public Builder setPublicKeys(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePublicKeysIsMutable(); + publicKeys_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Public keys that should be added to the environment before it is started.
+     * 
+ * + * repeated string public_keys = 3; + * + * @param value The publicKeys to add. + * @return This builder for chaining. + */ + public Builder addPublicKeys(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePublicKeysIsMutable(); + publicKeys_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Public keys that should be added to the environment before it is started.
+     * 
+ * + * repeated string public_keys = 3; + * + * @param values The publicKeys to add. + * @return This builder for chaining. + */ + public Builder addAllPublicKeys(java.lang.Iterable values) { + ensurePublicKeysIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, publicKeys_); + onChanged(); + return this; + } + /** + * + * + *
+     * Public keys that should be added to the environment before it is started.
+     * 
+ * + * repeated string public_keys = 3; + * + * @return This builder for chaining. + */ + public Builder clearPublicKeys() { + publicKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Public keys that should be added to the environment before it is started.
+     * 
+ * + * repeated string public_keys = 3; + * + * @param value The bytes of the publicKeys to add. + * @return This builder for chaining. + */ + public Builder addPublicKeysBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePublicKeysIsMutable(); + publicKeys_.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.shell.v1.StartEnvironmentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.shell.v1.StartEnvironmentRequest) + private static final com.google.cloud.shell.v1.StartEnvironmentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.shell.v1.StartEnvironmentRequest(); + } + + public static com.google.cloud.shell.v1.StartEnvironmentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StartEnvironmentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StartEnvironmentRequest(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.shell.v1.StartEnvironmentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentRequestOrBuilder.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentRequestOrBuilder.java new file mode 100644 index 00000000..d6ab22c1 --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentRequestOrBuilder.java @@ -0,0 +1,136 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +public interface StartEnvironmentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.shell.v1.StartEnvironmentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the resource that should be started, for example
+   * `users/me/environments/default` or
+   * `users/someone@example.com/environments/default`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Name of the resource that should be started, for example
+   * `users/me/environments/default` or
+   * `users/someone@example.com/environments/default`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The initial access token passed to the environment. If this is present and
+   * valid, the environment will be pre-authenticated with gcloud so that the
+   * user can run gcloud commands in Cloud Shell without having to log in. This
+   * code can be updated later by calling AuthorizeEnvironment.
+   * 
+ * + * string access_token = 2; + * + * @return The accessToken. + */ + java.lang.String getAccessToken(); + /** + * + * + *
+   * The initial access token passed to the environment. If this is present and
+   * valid, the environment will be pre-authenticated with gcloud so that the
+   * user can run gcloud commands in Cloud Shell without having to log in. This
+   * code can be updated later by calling AuthorizeEnvironment.
+   * 
+ * + * string access_token = 2; + * + * @return The bytes for accessToken. + */ + com.google.protobuf.ByteString getAccessTokenBytes(); + + /** + * + * + *
+   * Public keys that should be added to the environment before it is started.
+   * 
+ * + * repeated string public_keys = 3; + * + * @return A list containing the publicKeys. + */ + java.util.List getPublicKeysList(); + /** + * + * + *
+   * Public keys that should be added to the environment before it is started.
+   * 
+ * + * repeated string public_keys = 3; + * + * @return The count of publicKeys. + */ + int getPublicKeysCount(); + /** + * + * + *
+   * Public keys that should be added to the environment before it is started.
+   * 
+ * + * repeated string public_keys = 3; + * + * @param index The index of the element to return. + * @return The publicKeys at the given index. + */ + java.lang.String getPublicKeys(int index); + /** + * + * + *
+   * Public keys that should be added to the environment before it is started.
+   * 
+ * + * repeated string public_keys = 3; + * + * @param index The index of the value to return. + * @return The bytes of the publicKeys at the given index. + */ + com.google.protobuf.ByteString getPublicKeysBytes(int index); +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentResponse.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentResponse.java new file mode 100644 index 00000000..9e45a998 --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentResponse.java @@ -0,0 +1,737 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +/** + * + * + *
+ * Message included in the response field of operations returned from
+ * [StartEnvironment][google.cloud.shell.v1.CloudShellService.StartEnvironment]
+ * once the operation is complete.
+ * 
+ * + * Protobuf type {@code google.cloud.shell.v1.StartEnvironmentResponse} + */ +public final class StartEnvironmentResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.shell.v1.StartEnvironmentResponse) + StartEnvironmentResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use StartEnvironmentResponse.newBuilder() to construct. + private StartEnvironmentResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StartEnvironmentResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StartEnvironmentResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StartEnvironmentResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.shell.v1.Environment.Builder subBuilder = null; + if (environment_ != null) { + subBuilder = environment_.toBuilder(); + } + environment_ = + input.readMessage( + com.google.cloud.shell.v1.Environment.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(environment_); + environment_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_StartEnvironmentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_StartEnvironmentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.StartEnvironmentResponse.class, + com.google.cloud.shell.v1.StartEnvironmentResponse.Builder.class); + } + + public static final int ENVIRONMENT_FIELD_NUMBER = 1; + private com.google.cloud.shell.v1.Environment environment_; + /** + * + * + *
+   * Environment that was started.
+   * 
+ * + * .google.cloud.shell.v1.Environment environment = 1; + * + * @return Whether the environment field is set. + */ + @java.lang.Override + public boolean hasEnvironment() { + return environment_ != null; + } + /** + * + * + *
+   * Environment that was started.
+   * 
+ * + * .google.cloud.shell.v1.Environment environment = 1; + * + * @return The environment. + */ + @java.lang.Override + public com.google.cloud.shell.v1.Environment getEnvironment() { + return environment_ == null + ? com.google.cloud.shell.v1.Environment.getDefaultInstance() + : environment_; + } + /** + * + * + *
+   * Environment that was started.
+   * 
+ * + * .google.cloud.shell.v1.Environment environment = 1; + */ + @java.lang.Override + public com.google.cloud.shell.v1.EnvironmentOrBuilder getEnvironmentOrBuilder() { + return getEnvironment(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (environment_ != null) { + output.writeMessage(1, getEnvironment()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (environment_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getEnvironment()); + } + 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.shell.v1.StartEnvironmentResponse)) { + return super.equals(obj); + } + com.google.cloud.shell.v1.StartEnvironmentResponse other = + (com.google.cloud.shell.v1.StartEnvironmentResponse) obj; + + if (hasEnvironment() != other.hasEnvironment()) return false; + if (hasEnvironment()) { + if (!getEnvironment().equals(other.getEnvironment())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEnvironment()) { + hash = (37 * hash) + ENVIRONMENT_FIELD_NUMBER; + hash = (53 * hash) + getEnvironment().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.shell.v1.StartEnvironmentResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.StartEnvironmentResponse 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.shell.v1.StartEnvironmentResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.StartEnvironmentResponse 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.shell.v1.StartEnvironmentResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.shell.v1.StartEnvironmentResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.shell.v1.StartEnvironmentResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.StartEnvironmentResponse 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.shell.v1.StartEnvironmentResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.StartEnvironmentResponse 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.shell.v1.StartEnvironmentResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.shell.v1.StartEnvironmentResponse 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.shell.v1.StartEnvironmentResponse 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 included in the response field of operations returned from
+   * [StartEnvironment][google.cloud.shell.v1.CloudShellService.StartEnvironment]
+   * once the operation is complete.
+   * 
+ * + * Protobuf type {@code google.cloud.shell.v1.StartEnvironmentResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.shell.v1.StartEnvironmentResponse) + com.google.cloud.shell.v1.StartEnvironmentResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_StartEnvironmentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_StartEnvironmentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.shell.v1.StartEnvironmentResponse.class, + com.google.cloud.shell.v1.StartEnvironmentResponse.Builder.class); + } + + // Construct using com.google.cloud.shell.v1.StartEnvironmentResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (environmentBuilder_ == null) { + environment_ = null; + } else { + environment_ = null; + environmentBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.shell.v1.CloudShellProto + .internal_static_google_cloud_shell_v1_StartEnvironmentResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.shell.v1.StartEnvironmentResponse getDefaultInstanceForType() { + return com.google.cloud.shell.v1.StartEnvironmentResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.shell.v1.StartEnvironmentResponse build() { + com.google.cloud.shell.v1.StartEnvironmentResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.shell.v1.StartEnvironmentResponse buildPartial() { + com.google.cloud.shell.v1.StartEnvironmentResponse result = + new com.google.cloud.shell.v1.StartEnvironmentResponse(this); + if (environmentBuilder_ == null) { + result.environment_ = environment_; + } else { + result.environment_ = environmentBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.shell.v1.StartEnvironmentResponse) { + return mergeFrom((com.google.cloud.shell.v1.StartEnvironmentResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.shell.v1.StartEnvironmentResponse other) { + if (other == com.google.cloud.shell.v1.StartEnvironmentResponse.getDefaultInstance()) + return this; + if (other.hasEnvironment()) { + mergeEnvironment(other.getEnvironment()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.shell.v1.StartEnvironmentResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.shell.v1.StartEnvironmentResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.shell.v1.Environment environment_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.shell.v1.Environment, + com.google.cloud.shell.v1.Environment.Builder, + com.google.cloud.shell.v1.EnvironmentOrBuilder> + environmentBuilder_; + /** + * + * + *
+     * Environment that was started.
+     * 
+ * + * .google.cloud.shell.v1.Environment environment = 1; + * + * @return Whether the environment field is set. + */ + public boolean hasEnvironment() { + return environmentBuilder_ != null || environment_ != null; + } + /** + * + * + *
+     * Environment that was started.
+     * 
+ * + * .google.cloud.shell.v1.Environment environment = 1; + * + * @return The environment. + */ + public com.google.cloud.shell.v1.Environment getEnvironment() { + if (environmentBuilder_ == null) { + return environment_ == null + ? com.google.cloud.shell.v1.Environment.getDefaultInstance() + : environment_; + } else { + return environmentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Environment that was started.
+     * 
+ * + * .google.cloud.shell.v1.Environment environment = 1; + */ + public Builder setEnvironment(com.google.cloud.shell.v1.Environment value) { + if (environmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + environment_ = value; + onChanged(); + } else { + environmentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Environment that was started.
+     * 
+ * + * .google.cloud.shell.v1.Environment environment = 1; + */ + public Builder setEnvironment(com.google.cloud.shell.v1.Environment.Builder builderForValue) { + if (environmentBuilder_ == null) { + environment_ = builderForValue.build(); + onChanged(); + } else { + environmentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Environment that was started.
+     * 
+ * + * .google.cloud.shell.v1.Environment environment = 1; + */ + public Builder mergeEnvironment(com.google.cloud.shell.v1.Environment value) { + if (environmentBuilder_ == null) { + if (environment_ != null) { + environment_ = + com.google.cloud.shell.v1.Environment.newBuilder(environment_) + .mergeFrom(value) + .buildPartial(); + } else { + environment_ = value; + } + onChanged(); + } else { + environmentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Environment that was started.
+     * 
+ * + * .google.cloud.shell.v1.Environment environment = 1; + */ + public Builder clearEnvironment() { + if (environmentBuilder_ == null) { + environment_ = null; + onChanged(); + } else { + environment_ = null; + environmentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Environment that was started.
+     * 
+ * + * .google.cloud.shell.v1.Environment environment = 1; + */ + public com.google.cloud.shell.v1.Environment.Builder getEnvironmentBuilder() { + + onChanged(); + return getEnvironmentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Environment that was started.
+     * 
+ * + * .google.cloud.shell.v1.Environment environment = 1; + */ + public com.google.cloud.shell.v1.EnvironmentOrBuilder getEnvironmentOrBuilder() { + if (environmentBuilder_ != null) { + return environmentBuilder_.getMessageOrBuilder(); + } else { + return environment_ == null + ? com.google.cloud.shell.v1.Environment.getDefaultInstance() + : environment_; + } + } + /** + * + * + *
+     * Environment that was started.
+     * 
+ * + * .google.cloud.shell.v1.Environment environment = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.shell.v1.Environment, + com.google.cloud.shell.v1.Environment.Builder, + com.google.cloud.shell.v1.EnvironmentOrBuilder> + getEnvironmentFieldBuilder() { + if (environmentBuilder_ == null) { + environmentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.shell.v1.Environment, + com.google.cloud.shell.v1.Environment.Builder, + com.google.cloud.shell.v1.EnvironmentOrBuilder>( + getEnvironment(), getParentForChildren(), isClean()); + environment_ = null; + } + return environmentBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.shell.v1.StartEnvironmentResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.shell.v1.StartEnvironmentResponse) + private static final com.google.cloud.shell.v1.StartEnvironmentResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.shell.v1.StartEnvironmentResponse(); + } + + public static com.google.cloud.shell.v1.StartEnvironmentResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StartEnvironmentResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StartEnvironmentResponse(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.shell.v1.StartEnvironmentResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentResponseOrBuilder.java b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentResponseOrBuilder.java new file mode 100644 index 00000000..53f35e7b --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/java/com/google/cloud/shell/v1/StartEnvironmentResponseOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/shell/v1/cloudshell.proto + +package com.google.cloud.shell.v1; + +public interface StartEnvironmentResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.shell.v1.StartEnvironmentResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Environment that was started.
+   * 
+ * + * .google.cloud.shell.v1.Environment environment = 1; + * + * @return Whether the environment field is set. + */ + boolean hasEnvironment(); + /** + * + * + *
+   * Environment that was started.
+   * 
+ * + * .google.cloud.shell.v1.Environment environment = 1; + * + * @return The environment. + */ + com.google.cloud.shell.v1.Environment getEnvironment(); + /** + * + * + *
+   * Environment that was started.
+   * 
+ * + * .google.cloud.shell.v1.Environment environment = 1; + */ + com.google.cloud.shell.v1.EnvironmentOrBuilder getEnvironmentOrBuilder(); +} diff --git a/proto-google-cloud-shell-v1/src/main/proto/google/cloud/shell/v1/cloudshell.proto b/proto-google-cloud-shell-v1/src/main/proto/google/cloud/shell/v1/cloudshell.proto new file mode 100644 index 00000000..f4b35b17 --- /dev/null +++ b/proto-google-cloud-shell-v1/src/main/proto/google/cloud/shell/v1/cloudshell.proto @@ -0,0 +1,388 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.shell.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/shell/v1;shell"; +option java_multiple_files = true; +option java_outer_classname = "CloudShellProto"; +option java_package = "com.google.cloud.shell.v1"; + +// API for interacting with Google Cloud Shell. Each user of Cloud Shell has at +// least one environment, which has the ID "default". Environment consists of a +// Docker image defining what is installed on the environment and a home +// directory containing the user's data that will remain across sessions. +// Clients use this API to start and fetch information about their environment, +// which can then be used to connect to that environment via a separate SSH +// client. +service CloudShellService { + option (google.api.default_host) = "cloudshell.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Gets an environment. Returns NOT_FOUND if the environment does not exist. + rpc GetEnvironment(GetEnvironmentRequest) returns (Environment) { + option (google.api.http) = { + get: "/v1/{name=users/*/environments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Starts an existing environment, allowing clients to connect to it. The + // returned operation will contain an instance of StartEnvironmentMetadata in + // its metadata field. Users can wait for the environment to start by polling + // this operation via GetOperation. Once the environment has finished starting + // and is ready to accept connections, the operation will contain a + // StartEnvironmentResponse in its response field. + rpc StartEnvironment(StartEnvironmentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=users/*/environments/*}:start" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "StartEnvironmentResponse" + metadata_type: "StartEnvironmentMetadata" + }; + } + + // Sends OAuth credentials to a running environment on behalf of a user. When + // this completes, the environment will be authorized to run various Google + // Cloud command line tools without requiring the user to manually + // authenticate. + rpc AuthorizeEnvironment(AuthorizeEnvironmentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=users/*/environments/*}:authorize" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "AuthorizeEnvironmentResponse" + metadata_type: "AuthorizeEnvironmentMetadata" + }; + } + + // Adds a public SSH key to an environment, allowing clients with the + // corresponding private key to connect to that environment via SSH. If a key + // with the same content already exists, this will error with ALREADY_EXISTS. + rpc AddPublicKey(AddPublicKeyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{environment=users/*/environments/*}:addPublicKey" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "AddPublicKeyResponse" + metadata_type: "AddPublicKeyMetadata" + }; + } + + // Removes a public SSH key from an environment. Clients will no longer be + // able to connect to the environment using the corresponding private key. + // If a key with the same content is not present, this will error with + // NOT_FOUND. + rpc RemovePublicKey(RemovePublicKeyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{environment=users/*/environments/*}:removePublicKey" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "RemovePublicKeyResponse" + metadata_type: "RemovePublicKeyMetadata" + }; + } +} + +// A Cloud Shell environment, which is defined as the combination of a Docker +// image specifying what is installed on the environment and a home directory +// containing the user's data that will remain across sessions. Each user has +// at least an environment with the ID "default". +message Environment { + option (google.api.resource) = { + type: "cloudshell.googleapis.com/Environment" + pattern: "users/{user}/environments/{environment}" + }; + + // Possible execution states for an environment. + enum State { + // The environment's states is unknown. + STATE_UNSPECIFIED = 0; + + // The environment is not running and can't be connected to. Starting the + // environment will transition it to the PENDING state. + SUSPENDED = 1; + + // The environment is being started but is not yet ready to accept + // connections. + PENDING = 2; + + // The environment is running and ready to accept connections. It will + // automatically transition back to DISABLED after a period of inactivity or + // if another environment is started. + RUNNING = 3; + + // The environment is being deleted and can't be connected to. + DELETING = 4; + } + + // Immutable. Full name of this resource, in the format + // `users/{owner_email}/environments/{environment_id}`. `{owner_email}` is the + // email address of the user to whom this environment belongs, and + // `{environment_id}` is the identifier of this environment. For example, + // `users/someone@example.com/environments/default`. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The environment's identifier, unique among the user's + // environments. + string id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Immutable. Full path to the Docker image used to run this environment, e.g. + // "gcr.io/dev-con/cloud-devshell:latest". + string docker_image = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Current execution state of this environment. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Host to which clients can connect to initiate HTTPS or WSS + // connections with the environment. + string web_host = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Username that clients should use when initiating SSH sessions + // with the environment. + string ssh_username = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Host to which clients can connect to initiate SSH sessions + // with the environment. + string ssh_host = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Port to which clients can connect to initiate SSH sessions + // with the environment. + int32 ssh_port = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Public keys associated with the environment. Clients can + // connect to this environment via SSH only if they possess a private key + // corresponding to at least one of these public keys. Keys can be added to or + // removed from the environment using the AddPublicKey and RemovePublicKey + // methods. + repeated string public_keys = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for +// [GetEnvironment][google.cloud.shell.v1.CloudShellService.GetEnvironment]. +message GetEnvironmentRequest { + // Required. Name of the requested resource, for example `users/me/environments/default` + // or `users/someone@example.com/environments/default`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudshell.googleapis.com/Environment" + } + ]; +} + +// Message included in the metadata field of operations returned from +// [CreateEnvironment][google.cloud.shell.v1.CloudShellService.CreateEnvironment]. +message CreateEnvironmentMetadata { + +} + +// Message included in the metadata field of operations returned from +// [DeleteEnvironment][google.cloud.shell.v1.CloudShellService.DeleteEnvironment]. +message DeleteEnvironmentMetadata { + +} + +// Request message for +// [StartEnvironment][google.cloud.shell.v1.CloudShellService.StartEnvironment]. +message StartEnvironmentRequest { + // Name of the resource that should be started, for example + // `users/me/environments/default` or + // `users/someone@example.com/environments/default`. + string name = 1; + + // The initial access token passed to the environment. If this is present and + // valid, the environment will be pre-authenticated with gcloud so that the + // user can run gcloud commands in Cloud Shell without having to log in. This + // code can be updated later by calling AuthorizeEnvironment. + string access_token = 2; + + // Public keys that should be added to the environment before it is started. + repeated string public_keys = 3; +} + +// Request message for +// [AuthorizeEnvironment][google.cloud.shell.v1.CloudShellService.AuthorizeEnvironment]. +message AuthorizeEnvironmentRequest { + // Name of the resource that should receive the credentials, for example + // `users/me/environments/default` or + // `users/someone@example.com/environments/default`. + string name = 1; + + // The OAuth access token that should be sent to the environment. + string access_token = 2; + + // The OAuth ID token that should be sent to the environment. + string id_token = 4; + + // The time when the credentials expire. If not set, defaults to one hour from + // when the server received the request. + google.protobuf.Timestamp expire_time = 3; +} + +// Response message for +// [AuthorizeEnvironment][google.cloud.shell.v1.CloudShellService.AuthorizeEnvironment]. +message AuthorizeEnvironmentResponse { + +} + +// Message included in the metadata field of operations returned from +// [AuthorizeEnvironment][google.cloud.shell.v1.CloudShellService.AuthorizeEnvironment]. +message AuthorizeEnvironmentMetadata { + +} + +// Message included in the metadata field of operations returned from +// [StartEnvironment][google.cloud.shell.v1.CloudShellService.StartEnvironment]. +message StartEnvironmentMetadata { + // Possible states an environment might transition between during startup. + // These states are not normally actionable by clients, but may be used to + // show a progress message to the user. An environment won't necessarily go + // through all of these states when starting. More states are likely to be + // added in the future. + enum State { + // The environment's start state is unknown. + STATE_UNSPECIFIED = 0; + + // The environment is in the process of being started, but no additional + // details are available. + STARTING = 1; + + // Startup is waiting for the user's disk to be unarchived. This can happen + // when the user returns to Cloud Shell after not having used it for a + // while, and suggests that startup will take longer than normal. + UNARCHIVING_DISK = 2; + + // Startup is waiting for compute resources to be assigned to the + // environment. This should normally happen very quickly, but an environment + // might stay in this state for an extended period of time if the system is + // experiencing heavy load. + AWAITING_COMPUTE_RESOURCES = 4; + + // Startup has completed. If the start operation was successful, the user + // should be able to establish an SSH connection to their environment. + // Otherwise, the operation will contain details of the failure. + FINISHED = 3; + } + + // Current state of the environment being started. + State state = 1; +} + +// Message included in the response field of operations returned from +// [StartEnvironment][google.cloud.shell.v1.CloudShellService.StartEnvironment] +// once the operation is complete. +message StartEnvironmentResponse { + // Environment that was started. + Environment environment = 1; +} + +// Request message for +// [AddPublicKey][google.cloud.shell.v1.CloudShellService.AddPublicKey]. +message AddPublicKeyRequest { + // Environment this key should be added to, e.g. + // `users/me/environments/default`. + string environment = 1; + + // Key that should be added to the environment. Supported formats are + // `ssh-dss` (see RFC4253), `ssh-rsa` (see RFC4253), `ecdsa-sha2-nistp256` + // (see RFC5656), `ecdsa-sha2-nistp384` (see RFC5656) and + // `ecdsa-sha2-nistp521` (see RFC5656). It should be structured as + // <format> <content>, where <content> part is encoded with + // Base64. + string key = 2; +} + +// Response message for +// [AddPublicKey][google.cloud.shell.v1.CloudShellService.AddPublicKey]. +message AddPublicKeyResponse { + // Key that was added to the environment. + string key = 1; +} + +// Message included in the metadata field of operations returned from +// [AddPublicKey][google.cloud.shell.v1.CloudShellService.AddPublicKey]. +message AddPublicKeyMetadata { + +} + +// Request message for +// [RemovePublicKey][google.cloud.shell.v1.CloudShellService.RemovePublicKey]. +message RemovePublicKeyRequest { + // Environment this key should be removed from, e.g. + // `users/me/environments/default`. + string environment = 1; + + // Key that should be removed from the environment. + string key = 2; +} + +// Response message for +// [RemovePublicKey][google.cloud.shell.v1.CloudShellService.RemovePublicKey]. +message RemovePublicKeyResponse { + +} + +// Message included in the metadata field of operations returned from +// [RemovePublicKey][google.cloud.shell.v1.CloudShellService.RemovePublicKey]. +message RemovePublicKeyMetadata { + +} + +// Cloud-shell specific information that will be included as details in failure +// responses. +message CloudShellErrorDetails { + // Set of possible errors returned from API calls. + enum CloudShellErrorCode { + // An unknown error occurred. + CLOUD_SHELL_ERROR_CODE_UNSPECIFIED = 0; + + // The image used by the Cloud Shell environment either does not exist or + // the user does not have access to it. + IMAGE_UNAVAILABLE = 1; + + // Cloud Shell has been disabled by an administrator for the user making the + // request. + CLOUD_SHELL_DISABLED = 2; + + // Cloud Shell has been permanently disabled due to a Terms of Service + // violation by the user. + TOS_VIOLATION = 4; + + // The user has exhausted their weekly Cloud Shell quota, and Cloud Shell + // will be disabled until the quota resets. + QUOTA_EXCEEDED = 5; + } + + // Code indicating the specific error the occurred. + CloudShellErrorCode code = 1; +} diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..ef630520 --- /dev/null +++ b/renovate.json @@ -0,0 +1,73 @@ +{ + "extends": [ + ":separateMajorReleases", + ":combinePatchMinorReleases", + ":ignoreUnstable", + ":prImmediately", + ":updateNotScheduled", + ":automergeDisabled", + ":ignoreModulesAndTests", + ":maintainLockFilesDisabled", + ":autodetectPinVersions" + ], + "packageRules": [ + { + "packagePatterns": [ + "^com.google.guava:" + ], + "versionScheme": "docker" + }, + { + "packagePatterns": [ + "*" + ], + "semanticCommitType": "deps", + "semanticCommitScope": null + }, + { + "packagePatterns": [ + "^org.apache.maven", + "^org.jacoco:", + "^org.codehaus.mojo:", + "^org.sonatype.plugins:", + "^com.coveo:", + "^com.google.cloud:google-cloud-shared-config" + ], + "semanticCommitType": "build", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-shell", + "^com.google.cloud:libraries-bom", + "^com.google.cloud.samples:shared-configuration" + ], + "semanticCommitType": "chore", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^junit:junit", + "^com.google.truth:truth", + "^org.mockito:mockito-core", + "^org.objenesis:objenesis" + ], + "semanticCommitType": "test", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-" + ], + "ignoreUnstable": false + }, + { + "packagePatterns": [ + "^com.fasterxml.jackson.core" + ], + "groupName": "jackson dependencies" + } + ], + "semanticCommits": true, + "masterIssue": true +} diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml new file mode 100644 index 00000000..eed98b2d --- /dev/null +++ b/samples/install-without-bom/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + com.google.cloud + shell-install-without-bom + jar + Google Cloud Shell Install Without Bom + https://github.com/googleapis/java-shell + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + google-cloud-shell + 0.0.0 + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.1.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/samples/pom.xml b/samples/pom.xml new file mode 100644 index 00000000..29641bc8 --- /dev/null +++ b/samples/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud-shell-samples + 0.0.1-SNAPSHOT + pom + Google Cloud Shell Samples Parent + https://github.com/googleapis/java-shell + + Java idiomatic client for Google Cloud Platform services. + + + + + com.google.cloud.samples + shared-configuration + 1.0.18 + + + + 1.8 + 1.8 + UTF-8 + + + + install-without-bom + snapshot + snippets + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.8 + + true + + + + + diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml new file mode 100644 index 00000000..466c9cb8 --- /dev/null +++ b/samples/snapshot/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + com.google.cloud + shell-snapshot + jar + Google Cloud Shell Snapshot Samples + https://github.com/googleapis/java-shell + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-shell + 0.0.0 + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.1.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + \ No newline at end of file diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml new file mode 100644 index 00000000..56da98ab --- /dev/null +++ b/samples/snippets/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + com.google.cloud + shell-snippets + jar + Google Cloud Shell Snippets + https://github.com/googleapis/java-shell + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-shell + 0.0.0 + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + diff --git a/versions.txt b/versions.txt new file mode 100644 index 00000000..e5c1c801 --- /dev/null +++ b/versions.txt @@ -0,0 +1,6 @@ +# Format: +# module:released-version:current-version + +google-cloud-shell:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-shell-v1:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-shell-v1:0.0.0:0.0.1-SNAPSHOT