From e70855d9c5d23d7423299ae3d6a1b4136c73378e Mon Sep 17 00:00:00 2001 From: Neenu1995 Date: Thu, 27 May 2021 19:00:15 -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-tpu-bom/pom.xml | 85 + google-cloud-tpu/pom.xml | 111 + .../com/google/cloud/tpu/v1/TpuClient.java | 1615 +++++ .../com/google/cloud/tpu/v1/TpuSettings.java | 369 ++ .../google/cloud/tpu/v1/gapic_metadata.json | 51 + .../com/google/cloud/tpu/v1/package-info.java | 38 + .../tpu/v1/stub/GrpcTpuCallableFactory.java | 113 + .../google/cloud/tpu/v1/stub/GrpcTpuStub.java | 610 ++ .../com/google/cloud/tpu/v1/stub/TpuStub.java | 148 + .../cloud/tpu/v1/stub/TpuStubSettings.java | 964 +++ .../java/com/google/cloud/tpu/v1/MockTpu.java | 59 + .../com/google/cloud/tpu/v1/MockTpuImpl.java | 288 + .../google/cloud/tpu/v1/TpuClientTest.java | 1083 +++ grpc-google-cloud-tpu-v1/pom.xml | 69 + .../java/com/google/cloud/tpu/v1/TpuGrpc.java | 1462 +++++ java.header | 15 + license-checks.xml | 10 + owlbot.py | 24 + pom.xml | 179 + .../clirr-ignored-differences.xml | 19 + proto-google-cloud-tpu-v1/pom.xml | 46 + .../google/cloud/tpu/v1/AcceleratorType.java | 812 +++ .../cloud/tpu/v1/AcceleratorTypeName.java | 227 + .../tpu/v1/AcceleratorTypeOrBuilder.java | 75 + .../google/cloud/tpu/v1/CloudTpuProto.java | 513 ++ .../cloud/tpu/v1/CreateNodeRequest.java | 1093 ++++ .../tpu/v1/CreateNodeRequestOrBuilder.java | 114 + .../cloud/tpu/v1/DeleteNodeRequest.java | 648 ++ .../tpu/v1/DeleteNodeRequestOrBuilder.java | 54 + .../tpu/v1/GetAcceleratorTypeRequest.java | 650 ++ .../GetAcceleratorTypeRequestOrBuilder.java | 54 + .../google/cloud/tpu/v1/GetNodeRequest.java | 647 ++ .../cloud/tpu/v1/GetNodeRequestOrBuilder.java | 54 + .../tpu/v1/GetTensorFlowVersionRequest.java | 650 ++ .../GetTensorFlowVersionRequestOrBuilder.java | 54 + .../tpu/v1/ListAcceleratorTypesRequest.java | 1277 ++++ .../ListAcceleratorTypesRequestOrBuilder.java | 142 + .../tpu/v1/ListAcceleratorTypesResponse.java | 1411 ++++ ...ListAcceleratorTypesResponseOrBuilder.java | 153 + .../google/cloud/tpu/v1/ListNodesRequest.java | 916 +++ .../tpu/v1/ListNodesRequestOrBuilder.java | 92 + .../cloud/tpu/v1/ListNodesResponse.java | 1393 ++++ .../tpu/v1/ListNodesResponseOrBuilder.java | 152 + .../tpu/v1/ListTensorFlowVersionsRequest.java | 1278 ++++ ...istTensorFlowVersionsRequestOrBuilder.java | 142 + .../v1/ListTensorFlowVersionsResponse.java | 1419 ++++ ...stTensorFlowVersionsResponseOrBuilder.java | 153 + .../com/google/cloud/tpu/v1/LocationName.java | 192 + .../google/cloud/tpu/v1/NetworkEndpoint.java | 723 ++ .../tpu/v1/NetworkEndpointOrBuilder.java | 63 + .../java/com/google/cloud/tpu/v1/Node.java | 5800 +++++++++++++++++ .../com/google/cloud/tpu/v1/NodeName.java | 217 + .../google/cloud/tpu/v1/NodeOrBuilder.java | 673 ++ .../cloud/tpu/v1/OperationMetadata.java | 1808 +++++ .../tpu/v1/OperationMetadataOrBuilder.java | 210 + .../cloud/tpu/v1/ReimageNodeRequest.java | 813 +++ .../tpu/v1/ReimageNodeRequestOrBuilder.java | 75 + .../google/cloud/tpu/v1/SchedulingConfig.java | 633 ++ .../tpu/v1/SchedulingConfigOrBuilder.java | 51 + .../google/cloud/tpu/v1/StartNodeRequest.java | 633 ++ .../tpu/v1/StartNodeRequestOrBuilder.java | 50 + .../google/cloud/tpu/v1/StopNodeRequest.java | 633 ++ .../tpu/v1/StopNodeRequestOrBuilder.java | 50 + .../java/com/google/cloud/tpu/v1/Symptom.java | 1480 +++++ .../google/cloud/tpu/v1/SymptomOrBuilder.java | 135 + .../cloud/tpu/v1/TensorFlowVersion.java | 813 +++ .../cloud/tpu/v1/TensorFlowVersionName.java | 231 + .../tpu/v1/TensorFlowVersionOrBuilder.java | 75 + .../proto/google/cloud/tpu/v1/cloud_tpu.proto | 622 ++ 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 + 146 files changed, 40138 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-tpu-bom/pom.xml create mode 100644 google-cloud-tpu/pom.xml create mode 100644 google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuClient.java create mode 100644 google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuSettings.java create mode 100644 google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/gapic_metadata.json create mode 100644 google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/package-info.java create mode 100644 google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/GrpcTpuCallableFactory.java create mode 100644 google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/GrpcTpuStub.java create mode 100644 google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStub.java create mode 100644 google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStubSettings.java create mode 100644 google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/MockTpu.java create mode 100644 google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/MockTpuImpl.java create mode 100644 google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/TpuClientTest.java create mode 100644 grpc-google-cloud-tpu-v1/pom.xml create mode 100644 grpc-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TpuGrpc.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-tpu-v1/clirr-ignored-differences.xml create mode 100644 proto-google-cloud-tpu-v1/pom.xml create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorType.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorTypeName.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorTypeOrBuilder.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CloudTpuProto.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CreateNodeRequest.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CreateNodeRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/DeleteNodeRequest.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/DeleteNodeRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetAcceleratorTypeRequest.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetAcceleratorTypeRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetNodeRequest.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetNodeRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetTensorFlowVersionRequest.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetTensorFlowVersionRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesRequest.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesResponse.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesResponseOrBuilder.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesRequest.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesResponse.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesResponseOrBuilder.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsRequest.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsResponse.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsResponseOrBuilder.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/LocationName.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NetworkEndpoint.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NetworkEndpointOrBuilder.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/Node.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NodeName.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NodeOrBuilder.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/OperationMetadata.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/OperationMetadataOrBuilder.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ReimageNodeRequest.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ReimageNodeRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SchedulingConfig.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SchedulingConfigOrBuilder.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StartNodeRequest.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StartNodeRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StopNodeRequest.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StopNodeRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/Symptom.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SymptomOrBuilder.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersion.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersionName.java create mode 100644 proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersionOrBuilder.java create mode 100644 proto-google-cloud-tpu-v1/src/main/proto/google/cloud/tpu/v1/cloud_tpu.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..b110e266 --- /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/tpu/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/$1/proto-google-cloud-tpu-$1/src" +- source: "/google/cloud/tpu/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/$1/grpc-google-cloud-tpu-$1/src" +- source: "/google/cloud/tpu/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/$1/google-cloud-tpu/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..76443088 --- /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-tpu/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. tpu 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..77184f3b --- /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-tpu/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..da353b85 --- /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-tpu +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..b4baf266 --- /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-tpu/.kokoro/trampoline.sh" + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-tpu/.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..517d2351 --- /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-tpu/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-tpu/.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..7325ab53 --- /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-tpu/.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..517d2351 --- /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-tpu/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-tpu/.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..14192aa5 --- /dev/null +++ b/.kokoro/nightly/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-tpu/.kokoro/build.sh" diff --git a/.kokoro/nightly/java8-win.cfg b/.kokoro/nightly/java8-win.cfg new file mode 100644 index 00000000..fbe1537b --- /dev/null +++ b/.kokoro/nightly/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-tpu/.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..493620e8 --- /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-tpu/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-tpu/.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..54270bc6 --- /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-tpu/.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..14192aa5 --- /dev/null +++ b/.kokoro/presubmit/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-tpu/.kokoro/build.sh" diff --git a/.kokoro/presubmit/java8-win.cfg b/.kokoro/presubmit/java8-win.cfg new file mode 100644 index 00000000..fbe1537b --- /dev/null +++ b/.kokoro/presubmit/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-tpu/.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..beac28cc --- /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-tpu/.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..687c2ebf --- /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-tpu + +# 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-tpu \ + --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..2beae0d9 --- /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-tpu/.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-tpu/.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..88b4d18e --- /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-tpu/.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..eca7bf44 --- /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-tpu/.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..f0619f32 --- /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-tpu/.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..ca24c04e --- /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-tpu/.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..42abc010 --- /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-tpu +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..246ba36f --- /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-tpu/.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..4f5b1c09 --- /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-tpu +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..e074cf12 --- /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-tpu/.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..53cdd6a8 --- /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-tpu/.kokoro/release/stage.sh" +} + +# Need to save the properties file +action { + define_artifacts { + regex: "github/java-tpu/target/nexus-staging/staging/*.properties" + strip_prefix: "github/java-tpu" + } +} + +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..afded5b2 --- /dev/null +++ b/.repo-metadata.json @@ -0,0 +1,15 @@ +{ + "name": "tpu", + "name_pretty": "Cloud TPU", + "product_documentation": "https://cloud.google.com/tpu/docs", + "api_description": "are Google's custom-developed application-specific integrated circuits (ASICs) used to accelerate machine learning workloads.", + "client_documentation": "https://googleapis.dev/java/google-cloud-tpu/latest/index.html", + "release_level": "ga", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-tpu", + "repo_short": "java-tpu", + "distribution_name": "com.google.cloud:google-cloud-tpu", + "api_id": "tpu.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-tpu-bom/pom.xml b/google-cloud-tpu-bom/pom.xml new file mode 100644 index 00000000..227ade46 --- /dev/null +++ b/google-cloud-tpu-bom/pom.xml @@ -0,0 +1,85 @@ + + + 4.0.0 + com.google.cloud + google-cloud-tpu-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-shared-config + 0.11.0 + + + Google Cloud TPU BOM + https://github.com/googleapis/java-tpu + + BOM for Cloud TPU + + + + Google LLC + + + + + chingor13 + Jeff Ching + chingor@google.com + Google LLC + + Developer + + + + + + scm:git:https://github.com/googleapis/java-tpu.git + scm:git:git@github.com:googleapis/java-tpu.git + https://github.com/googleapis/java-tpu + + + + true + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + + com.google.cloud + google-cloud-tpu + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-tpu-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-tpu-v1 + 0.0.1-SNAPSHOT + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + diff --git a/google-cloud-tpu/pom.xml b/google-cloud-tpu/pom.xml new file mode 100644 index 00000000..c1bc8b04 --- /dev/null +++ b/google-cloud-tpu/pom.xml @@ -0,0 +1,111 @@ + + + 4.0.0 + com.google.cloud + google-cloud-tpu + 0.0.1-SNAPSHOT + jar + Google Cloud TPU + https://github.com/googleapis/java-tpu + Cloud TPU are Google's custom-developed application-specific integrated circuits (ASICs) used to accelerate machine learning workloads. + + com.google.cloud + google-cloud-tpu-parent + 0.0.1-SNAPSHOT + + + google-cloud-tpu + + + + 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-tpu-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-tpu-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-tpu/src/main/java/com/google/cloud/tpu/v1/TpuClient.java b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuClient.java new file mode 100644 index 00000000..880b0bec --- /dev/null +++ b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuClient.java @@ -0,0 +1,1615 @@ +/* + * 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.tpu.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.tpu.v1.stub.TpuStub; +import com.google.cloud.tpu.v1.stub.TpuStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Manages TPU nodes and other resources + * + *

TPU API v1 + * + *

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 (TpuClient tpuClient = TpuClient.create()) {
+ *   NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]");
+ *   Node response = tpuClient.getNode(name);
+ * }
+ * }
+ * + *

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

To customize credentials: + * + *

{@code
+ * TpuSettings tpuSettings =
+ *     TpuSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * TpuClient tpuClient = TpuClient.create(tpuSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * TpuSettings tpuSettings = TpuSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * TpuClient tpuClient = TpuClient.create(tpuSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class TpuClient implements BackgroundResource { + private final TpuSettings settings; + private final TpuStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of TpuClient with default settings. */ + public static final TpuClient create() throws IOException { + return create(TpuSettings.newBuilder().build()); + } + + /** + * Constructs an instance of TpuClient, 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 TpuClient create(TpuSettings settings) throws IOException { + return new TpuClient(settings); + } + + /** + * Constructs an instance of TpuClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(TpuSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final TpuClient create(TpuStub stub) { + return new TpuClient(stub); + } + + /** + * Constructs an instance of TpuClient, 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 TpuClient(TpuSettings settings) throws IOException { + this.settings = settings; + this.stub = ((TpuStubSettings) 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 TpuClient(TpuStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final TpuSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TpuStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists nodes. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Node element : tpuClient.listNodes(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListNodesPagedResponse listNodes(LocationName parent) { + ListNodesRequest request = + ListNodesRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listNodes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists nodes. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   String parent = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString();
+   *   for (Node element : tpuClient.listNodes(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListNodesPagedResponse listNodes(String parent) { + ListNodesRequest request = ListNodesRequest.newBuilder().setParent(parent).build(); + return listNodes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists nodes. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   ListNodesRequest request =
+   *       ListNodesRequest.newBuilder()
+   *           .setParent(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Node element : tpuClient.listNodes(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListNodesPagedResponse listNodes(ListNodesRequest request) { + return listNodesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists nodes. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   ListNodesRequest request =
+   *       ListNodesRequest.newBuilder()
+   *           .setParent(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = tpuClient.listNodesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Node element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listNodesPagedCallable() { + return stub.listNodesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists nodes. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   ListNodesRequest request =
+   *       ListNodesRequest.newBuilder()
+   *           .setParent(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListNodesResponse response = tpuClient.listNodesCallable().call(request);
+   *     for (Node element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listNodesCallable() { + return stub.listNodesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]");
+   *   Node response = tpuClient.getNode(name);
+   * }
+   * }
+ * + * @param name Required. The resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Node getNode(NodeName name) { + GetNodeRequest request = + GetNodeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getNode(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   String name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString();
+   *   Node response = tpuClient.getNode(name);
+   * }
+   * }
+ * + * @param name Required. The resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Node getNode(String name) { + GetNodeRequest request = GetNodeRequest.newBuilder().setName(name).build(); + return getNode(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   GetNodeRequest request =
+   *       GetNodeRequest.newBuilder()
+   *           .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
+   *           .build();
+   *   Node response = tpuClient.getNode(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 Node getNode(GetNodeRequest request) { + return getNodeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   GetNodeRequest request =
+   *       GetNodeRequest.newBuilder()
+   *           .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
+   *           .build();
+   *   ApiFuture future = tpuClient.getNodeCallable().futureCall(request);
+   *   // Do something.
+   *   Node response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getNodeCallable() { + return stub.getNodeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Node node = Node.newBuilder().build();
+   *   String nodeId = "nodeId-1040171331";
+   *   Node response = tpuClient.createNodeAsync(parent, node, nodeId).get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource name. + * @param node Required. The node. + * @param nodeId The unqualified resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createNodeAsync( + LocationName parent, Node node, String nodeId) { + CreateNodeRequest request = + CreateNodeRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setNode(node) + .setNodeId(nodeId) + .build(); + return createNodeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   String parent = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString();
+   *   Node node = Node.newBuilder().build();
+   *   String nodeId = "nodeId-1040171331";
+   *   Node response = tpuClient.createNodeAsync(parent, node, nodeId).get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource name. + * @param node Required. The node. + * @param nodeId The unqualified resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createNodeAsync( + String parent, Node node, String nodeId) { + CreateNodeRequest request = + CreateNodeRequest.newBuilder().setParent(parent).setNode(node).setNodeId(nodeId).build(); + return createNodeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   CreateNodeRequest request =
+   *       CreateNodeRequest.newBuilder()
+   *           .setParent(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
+   *           .setNodeId("nodeId-1040171331")
+   *           .setNode(Node.newBuilder().build())
+   *           .build();
+   *   Node response = tpuClient.createNodeAsync(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 createNodeAsync(CreateNodeRequest request) { + return createNodeOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   CreateNodeRequest request =
+   *       CreateNodeRequest.newBuilder()
+   *           .setParent(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
+   *           .setNodeId("nodeId-1040171331")
+   *           .setNode(Node.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       tpuClient.createNodeOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Node response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createNodeOperationCallable() { + return stub.createNodeOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   CreateNodeRequest request =
+   *       CreateNodeRequest.newBuilder()
+   *           .setParent(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
+   *           .setNodeId("nodeId-1040171331")
+   *           .setNode(Node.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = tpuClient.createNodeCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createNodeCallable() { + return stub.createNodeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]");
+   *   Node response = tpuClient.deleteNodeAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteNodeAsync(NodeName name) { + DeleteNodeRequest request = + DeleteNodeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteNodeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   String name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString();
+   *   Node response = tpuClient.deleteNodeAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteNodeAsync(String name) { + DeleteNodeRequest request = DeleteNodeRequest.newBuilder().setName(name).build(); + return deleteNodeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   DeleteNodeRequest request =
+   *       DeleteNodeRequest.newBuilder()
+   *           .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
+   *           .build();
+   *   Node response = tpuClient.deleteNodeAsync(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 deleteNodeAsync(DeleteNodeRequest request) { + return deleteNodeOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   DeleteNodeRequest request =
+   *       DeleteNodeRequest.newBuilder()
+   *           .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       tpuClient.deleteNodeOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Node response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteNodeOperationCallable() { + return stub.deleteNodeOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   DeleteNodeRequest request =
+   *       DeleteNodeRequest.newBuilder()
+   *           .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
+   *           .build();
+   *   ApiFuture future = tpuClient.deleteNodeCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteNodeCallable() { + return stub.deleteNodeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reimages a node's OS. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   ReimageNodeRequest request =
+   *       ReimageNodeRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setTensorflowVersion("tensorflowVersion-470125103")
+   *           .build();
+   *   Node response = tpuClient.reimageNodeAsync(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 reimageNodeAsync( + ReimageNodeRequest request) { + return reimageNodeOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reimages a node's OS. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   ReimageNodeRequest request =
+   *       ReimageNodeRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setTensorflowVersion("tensorflowVersion-470125103")
+   *           .build();
+   *   OperationFuture future =
+   *       tpuClient.reimageNodeOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Node response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + reimageNodeOperationCallable() { + return stub.reimageNodeOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reimages a node's OS. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   ReimageNodeRequest request =
+   *       ReimageNodeRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setTensorflowVersion("tensorflowVersion-470125103")
+   *           .build();
+   *   ApiFuture future = tpuClient.reimageNodeCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable reimageNodeCallable() { + return stub.reimageNodeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Stops a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   StopNodeRequest request = StopNodeRequest.newBuilder().setName("name3373707").build();
+   *   Node response = tpuClient.stopNodeAsync(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 stopNodeAsync(StopNodeRequest request) { + return stopNodeOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Stops a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   StopNodeRequest request = StopNodeRequest.newBuilder().setName("name3373707").build();
+   *   OperationFuture future =
+   *       tpuClient.stopNodeOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Node response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + stopNodeOperationCallable() { + return stub.stopNodeOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Stops a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   StopNodeRequest request = StopNodeRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = tpuClient.stopNodeCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable stopNodeCallable() { + return stub.stopNodeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Starts a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   StartNodeRequest request = StartNodeRequest.newBuilder().setName("name3373707").build();
+   *   Node response = tpuClient.startNodeAsync(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 startNodeAsync(StartNodeRequest request) { + return startNodeOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Starts a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   StartNodeRequest request = StartNodeRequest.newBuilder().setName("name3373707").build();
+   *   OperationFuture future =
+   *       tpuClient.startNodeOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Node response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + startNodeOperationCallable() { + return stub.startNodeOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Starts a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   StartNodeRequest request = StartNodeRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = tpuClient.startNodeCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable startNodeCallable() { + return stub.startNodeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List TensorFlow versions supported by this API. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   TensorFlowVersionName parent =
+   *       TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]");
+   *   for (TensorFlowVersion element : tpuClient.listTensorFlowVersions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTensorFlowVersionsPagedResponse listTensorFlowVersions( + TensorFlowVersionName parent) { + ListTensorFlowVersionsRequest request = + ListTensorFlowVersionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listTensorFlowVersions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List TensorFlow versions supported by this API. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   String parent =
+   *       TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]").toString();
+   *   for (TensorFlowVersion element : tpuClient.listTensorFlowVersions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTensorFlowVersionsPagedResponse listTensorFlowVersions(String parent) { + ListTensorFlowVersionsRequest request = + ListTensorFlowVersionsRequest.newBuilder().setParent(parent).build(); + return listTensorFlowVersions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List TensorFlow versions supported by this API. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   ListTensorFlowVersionsRequest request =
+   *       ListTensorFlowVersionsRequest.newBuilder()
+   *           .setParent(
+   *               TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (TensorFlowVersion element : tpuClient.listTensorFlowVersions(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTensorFlowVersionsPagedResponse listTensorFlowVersions( + ListTensorFlowVersionsRequest request) { + return listTensorFlowVersionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List TensorFlow versions supported by this API. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   ListTensorFlowVersionsRequest request =
+   *       ListTensorFlowVersionsRequest.newBuilder()
+   *           .setParent(
+   *               TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       tpuClient.listTensorFlowVersionsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (TensorFlowVersion element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listTensorFlowVersionsPagedCallable() { + return stub.listTensorFlowVersionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List TensorFlow versions supported by this API. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   ListTensorFlowVersionsRequest request =
+   *       ListTensorFlowVersionsRequest.newBuilder()
+   *           .setParent(
+   *               TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListTensorFlowVersionsResponse response =
+   *         tpuClient.listTensorFlowVersionsCallable().call(request);
+   *     for (TensorFlowVersion element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listTensorFlowVersionsCallable() { + return stub.listTensorFlowVersionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets TensorFlow Version. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   TensorFlowVersionName name =
+   *       TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]");
+   *   TensorFlowVersion response = tpuClient.getTensorFlowVersion(name);
+   * }
+   * }
+ * + * @param name Required. The resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TensorFlowVersion getTensorFlowVersion(TensorFlowVersionName name) { + GetTensorFlowVersionRequest request = + GetTensorFlowVersionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getTensorFlowVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets TensorFlow Version. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   String name =
+   *       TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]").toString();
+   *   TensorFlowVersion response = tpuClient.getTensorFlowVersion(name);
+   * }
+   * }
+ * + * @param name Required. The resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TensorFlowVersion getTensorFlowVersion(String name) { + GetTensorFlowVersionRequest request = + GetTensorFlowVersionRequest.newBuilder().setName(name).build(); + return getTensorFlowVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets TensorFlow Version. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   GetTensorFlowVersionRequest request =
+   *       GetTensorFlowVersionRequest.newBuilder()
+   *           .setName(
+   *               TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   TensorFlowVersion response = tpuClient.getTensorFlowVersion(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 TensorFlowVersion getTensorFlowVersion(GetTensorFlowVersionRequest request) { + return getTensorFlowVersionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets TensorFlow Version. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   GetTensorFlowVersionRequest request =
+   *       GetTensorFlowVersionRequest.newBuilder()
+   *           .setName(
+   *               TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       tpuClient.getTensorFlowVersionCallable().futureCall(request);
+   *   // Do something.
+   *   TensorFlowVersion response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getTensorFlowVersionCallable() { + return stub.getTensorFlowVersionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists accelerator types supported by this API. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   AcceleratorTypeName parent =
+   *       AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]");
+   *   for (AcceleratorType element : tpuClient.listAcceleratorTypes(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(AcceleratorTypeName parent) { + ListAcceleratorTypesRequest request = + ListAcceleratorTypesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listAcceleratorTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists accelerator types supported by this API. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   String parent =
+   *       AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]").toString();
+   *   for (AcceleratorType element : tpuClient.listAcceleratorTypes(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(String parent) { + ListAcceleratorTypesRequest request = + ListAcceleratorTypesRequest.newBuilder().setParent(parent).build(); + return listAcceleratorTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists accelerator types supported by this API. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   ListAcceleratorTypesRequest request =
+   *       ListAcceleratorTypesRequest.newBuilder()
+   *           .setParent(
+   *               AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (AcceleratorType element : tpuClient.listAcceleratorTypes(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAcceleratorTypesPagedResponse listAcceleratorTypes( + ListAcceleratorTypesRequest request) { + return listAcceleratorTypesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists accelerator types supported by this API. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   ListAcceleratorTypesRequest request =
+   *       ListAcceleratorTypesRequest.newBuilder()
+   *           .setParent(
+   *               AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       tpuClient.listAcceleratorTypesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (AcceleratorType element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listAcceleratorTypesPagedCallable() { + return stub.listAcceleratorTypesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists accelerator types supported by this API. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   ListAcceleratorTypesRequest request =
+   *       ListAcceleratorTypesRequest.newBuilder()
+   *           .setParent(
+   *               AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListAcceleratorTypesResponse response =
+   *         tpuClient.listAcceleratorTypesCallable().call(request);
+   *     for (AcceleratorType element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listAcceleratorTypesCallable() { + return stub.listAcceleratorTypesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets AcceleratorType. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   AcceleratorTypeName name =
+   *       AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]");
+   *   AcceleratorType response = tpuClient.getAcceleratorType(name);
+   * }
+   * }
+ * + * @param name Required. The resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AcceleratorType getAcceleratorType(AcceleratorTypeName name) { + GetAcceleratorTypeRequest request = + GetAcceleratorTypeRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getAcceleratorType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets AcceleratorType. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   String name =
+   *       AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]").toString();
+   *   AcceleratorType response = tpuClient.getAcceleratorType(name);
+   * }
+   * }
+ * + * @param name Required. The resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AcceleratorType getAcceleratorType(String name) { + GetAcceleratorTypeRequest request = + GetAcceleratorTypeRequest.newBuilder().setName(name).build(); + return getAcceleratorType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets AcceleratorType. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   GetAcceleratorTypeRequest request =
+   *       GetAcceleratorTypeRequest.newBuilder()
+   *           .setName(
+   *               AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]")
+   *                   .toString())
+   *           .build();
+   *   AcceleratorType response = tpuClient.getAcceleratorType(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 AcceleratorType getAcceleratorType(GetAcceleratorTypeRequest request) { + return getAcceleratorTypeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets AcceleratorType. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   GetAcceleratorTypeRequest request =
+   *       GetAcceleratorTypeRequest.newBuilder()
+   *           .setName(
+   *               AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       tpuClient.getAcceleratorTypeCallable().futureCall(request);
+   *   // Do something.
+   *   AcceleratorType response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getAcceleratorTypeCallable() { + return stub.getAcceleratorTypeCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListNodesPagedResponse + extends AbstractPagedListResponse< + ListNodesRequest, ListNodesResponse, Node, ListNodesPage, ListNodesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListNodesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListNodesPagedResponse apply(ListNodesPage input) { + return new ListNodesPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListNodesPagedResponse(ListNodesPage page) { + super(page, ListNodesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListNodesPage + extends AbstractPage { + + private ListNodesPage( + PageContext context, + ListNodesResponse response) { + super(context, response); + } + + private static ListNodesPage createEmptyPage() { + return new ListNodesPage(null, null); + } + + @Override + protected ListNodesPage createPage( + PageContext context, + ListNodesResponse response) { + return new ListNodesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListNodesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListNodesRequest, ListNodesResponse, Node, ListNodesPage, ListNodesFixedSizeCollection> { + + private ListNodesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListNodesFixedSizeCollection createEmptyCollection() { + return new ListNodesFixedSizeCollection(null, 0); + } + + @Override + protected ListNodesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListNodesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListTensorFlowVersionsPagedResponse + extends AbstractPagedListResponse< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + TensorFlowVersion, + ListTensorFlowVersionsPage, + ListTensorFlowVersionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListTensorFlowVersionsRequest, ListTensorFlowVersionsResponse, TensorFlowVersion> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListTensorFlowVersionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListTensorFlowVersionsPagedResponse apply(ListTensorFlowVersionsPage input) { + return new ListTensorFlowVersionsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListTensorFlowVersionsPagedResponse(ListTensorFlowVersionsPage page) { + super(page, ListTensorFlowVersionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListTensorFlowVersionsPage + extends AbstractPage< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + TensorFlowVersion, + ListTensorFlowVersionsPage> { + + private ListTensorFlowVersionsPage( + PageContext< + ListTensorFlowVersionsRequest, ListTensorFlowVersionsResponse, TensorFlowVersion> + context, + ListTensorFlowVersionsResponse response) { + super(context, response); + } + + private static ListTensorFlowVersionsPage createEmptyPage() { + return new ListTensorFlowVersionsPage(null, null); + } + + @Override + protected ListTensorFlowVersionsPage createPage( + PageContext< + ListTensorFlowVersionsRequest, ListTensorFlowVersionsResponse, TensorFlowVersion> + context, + ListTensorFlowVersionsResponse response) { + return new ListTensorFlowVersionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListTensorFlowVersionsRequest, ListTensorFlowVersionsResponse, TensorFlowVersion> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListTensorFlowVersionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + TensorFlowVersion, + ListTensorFlowVersionsPage, + ListTensorFlowVersionsFixedSizeCollection> { + + private ListTensorFlowVersionsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListTensorFlowVersionsFixedSizeCollection createEmptyCollection() { + return new ListTensorFlowVersionsFixedSizeCollection(null, 0); + } + + @Override + protected ListTensorFlowVersionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListTensorFlowVersionsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListAcceleratorTypesPagedResponse + extends AbstractPagedListResponse< + ListAcceleratorTypesRequest, + ListAcceleratorTypesResponse, + AcceleratorType, + ListAcceleratorTypesPage, + ListAcceleratorTypesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListAcceleratorTypesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListAcceleratorTypesPagedResponse apply(ListAcceleratorTypesPage input) { + return new ListAcceleratorTypesPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListAcceleratorTypesPagedResponse(ListAcceleratorTypesPage page) { + super(page, ListAcceleratorTypesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListAcceleratorTypesPage + extends AbstractPage< + ListAcceleratorTypesRequest, + ListAcceleratorTypesResponse, + AcceleratorType, + ListAcceleratorTypesPage> { + + private ListAcceleratorTypesPage( + PageContext + context, + ListAcceleratorTypesResponse response) { + super(context, response); + } + + private static ListAcceleratorTypesPage createEmptyPage() { + return new ListAcceleratorTypesPage(null, null); + } + + @Override + protected ListAcceleratorTypesPage createPage( + PageContext + context, + ListAcceleratorTypesResponse response) { + return new ListAcceleratorTypesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListAcceleratorTypesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListAcceleratorTypesRequest, + ListAcceleratorTypesResponse, + AcceleratorType, + ListAcceleratorTypesPage, + ListAcceleratorTypesFixedSizeCollection> { + + private ListAcceleratorTypesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListAcceleratorTypesFixedSizeCollection createEmptyCollection() { + return new ListAcceleratorTypesFixedSizeCollection(null, 0); + } + + @Override + protected ListAcceleratorTypesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListAcceleratorTypesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuSettings.java b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuSettings.java new file mode 100644 index 00000000..5b652300 --- /dev/null +++ b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuSettings.java @@ -0,0 +1,369 @@ +/* + * 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.tpu.v1; + +import static com.google.cloud.tpu.v1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListTensorFlowVersionsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.tpu.v1.stub.TpuStubSettings; +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 TpuClient}. + * + *

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

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

{@code
+ * TpuSettings.Builder tpuSettingsBuilder = TpuSettings.newBuilder();
+ * tpuSettingsBuilder
+ *     .getNodeSettings()
+ *     .setRetrySettings(
+ *         tpuSettingsBuilder
+ *             .getNodeSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * TpuSettings tpuSettings = tpuSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class TpuSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listNodes. */ + public PagedCallSettings + listNodesSettings() { + return ((TpuStubSettings) getStubSettings()).listNodesSettings(); + } + + /** Returns the object with the settings used for calls to getNode. */ + public UnaryCallSettings getNodeSettings() { + return ((TpuStubSettings) getStubSettings()).getNodeSettings(); + } + + /** Returns the object with the settings used for calls to createNode. */ + public UnaryCallSettings createNodeSettings() { + return ((TpuStubSettings) getStubSettings()).createNodeSettings(); + } + + /** Returns the object with the settings used for calls to createNode. */ + public OperationCallSettings + createNodeOperationSettings() { + return ((TpuStubSettings) getStubSettings()).createNodeOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteNode. */ + public UnaryCallSettings deleteNodeSettings() { + return ((TpuStubSettings) getStubSettings()).deleteNodeSettings(); + } + + /** Returns the object with the settings used for calls to deleteNode. */ + public OperationCallSettings + deleteNodeOperationSettings() { + return ((TpuStubSettings) getStubSettings()).deleteNodeOperationSettings(); + } + + /** Returns the object with the settings used for calls to reimageNode. */ + public UnaryCallSettings reimageNodeSettings() { + return ((TpuStubSettings) getStubSettings()).reimageNodeSettings(); + } + + /** Returns the object with the settings used for calls to reimageNode. */ + public OperationCallSettings + reimageNodeOperationSettings() { + return ((TpuStubSettings) getStubSettings()).reimageNodeOperationSettings(); + } + + /** Returns the object with the settings used for calls to stopNode. */ + public UnaryCallSettings stopNodeSettings() { + return ((TpuStubSettings) getStubSettings()).stopNodeSettings(); + } + + /** Returns the object with the settings used for calls to stopNode. */ + public OperationCallSettings + stopNodeOperationSettings() { + return ((TpuStubSettings) getStubSettings()).stopNodeOperationSettings(); + } + + /** Returns the object with the settings used for calls to startNode. */ + public UnaryCallSettings startNodeSettings() { + return ((TpuStubSettings) getStubSettings()).startNodeSettings(); + } + + /** Returns the object with the settings used for calls to startNode. */ + public OperationCallSettings + startNodeOperationSettings() { + return ((TpuStubSettings) getStubSettings()).startNodeOperationSettings(); + } + + /** Returns the object with the settings used for calls to listTensorFlowVersions. */ + public PagedCallSettings< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + ListTensorFlowVersionsPagedResponse> + listTensorFlowVersionsSettings() { + return ((TpuStubSettings) getStubSettings()).listTensorFlowVersionsSettings(); + } + + /** Returns the object with the settings used for calls to getTensorFlowVersion. */ + public UnaryCallSettings + getTensorFlowVersionSettings() { + return ((TpuStubSettings) getStubSettings()).getTensorFlowVersionSettings(); + } + + /** Returns the object with the settings used for calls to listAcceleratorTypes. */ + public PagedCallSettings< + ListAcceleratorTypesRequest, + ListAcceleratorTypesResponse, + ListAcceleratorTypesPagedResponse> + listAcceleratorTypesSettings() { + return ((TpuStubSettings) getStubSettings()).listAcceleratorTypesSettings(); + } + + /** Returns the object with the settings used for calls to getAcceleratorType. */ + public UnaryCallSettings + getAcceleratorTypeSettings() { + return ((TpuStubSettings) getStubSettings()).getAcceleratorTypeSettings(); + } + + public static final TpuSettings create(TpuStubSettings stub) throws IOException { + return new TpuSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return TpuStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return TpuStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return TpuStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return TpuStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return TpuStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return TpuStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TpuStubSettings.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 TpuSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for TpuSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(TpuStubSettings.newBuilder(clientContext)); + } + + protected Builder(TpuSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(TpuStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(TpuStubSettings.newBuilder()); + } + + public TpuStubSettings.Builder getStubSettingsBuilder() { + return ((TpuStubSettings.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 listNodes. */ + public PagedCallSettings.Builder + listNodesSettings() { + return getStubSettingsBuilder().listNodesSettings(); + } + + /** Returns the builder for the settings used for calls to getNode. */ + public UnaryCallSettings.Builder getNodeSettings() { + return getStubSettingsBuilder().getNodeSettings(); + } + + /** Returns the builder for the settings used for calls to createNode. */ + public UnaryCallSettings.Builder createNodeSettings() { + return getStubSettingsBuilder().createNodeSettings(); + } + + /** Returns the builder for the settings used for calls to createNode. */ + public OperationCallSettings.Builder + createNodeOperationSettings() { + return getStubSettingsBuilder().createNodeOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteNode. */ + public UnaryCallSettings.Builder deleteNodeSettings() { + return getStubSettingsBuilder().deleteNodeSettings(); + } + + /** Returns the builder for the settings used for calls to deleteNode. */ + public OperationCallSettings.Builder + deleteNodeOperationSettings() { + return getStubSettingsBuilder().deleteNodeOperationSettings(); + } + + /** Returns the builder for the settings used for calls to reimageNode. */ + public UnaryCallSettings.Builder reimageNodeSettings() { + return getStubSettingsBuilder().reimageNodeSettings(); + } + + /** Returns the builder for the settings used for calls to reimageNode. */ + public OperationCallSettings.Builder + reimageNodeOperationSettings() { + return getStubSettingsBuilder().reimageNodeOperationSettings(); + } + + /** Returns the builder for the settings used for calls to stopNode. */ + public UnaryCallSettings.Builder stopNodeSettings() { + return getStubSettingsBuilder().stopNodeSettings(); + } + + /** Returns the builder for the settings used for calls to stopNode. */ + public OperationCallSettings.Builder + stopNodeOperationSettings() { + return getStubSettingsBuilder().stopNodeOperationSettings(); + } + + /** Returns the builder for the settings used for calls to startNode. */ + public UnaryCallSettings.Builder startNodeSettings() { + return getStubSettingsBuilder().startNodeSettings(); + } + + /** Returns the builder for the settings used for calls to startNode. */ + public OperationCallSettings.Builder + startNodeOperationSettings() { + return getStubSettingsBuilder().startNodeOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listTensorFlowVersions. */ + public PagedCallSettings.Builder< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + ListTensorFlowVersionsPagedResponse> + listTensorFlowVersionsSettings() { + return getStubSettingsBuilder().listTensorFlowVersionsSettings(); + } + + /** Returns the builder for the settings used for calls to getTensorFlowVersion. */ + public UnaryCallSettings.Builder + getTensorFlowVersionSettings() { + return getStubSettingsBuilder().getTensorFlowVersionSettings(); + } + + /** Returns the builder for the settings used for calls to listAcceleratorTypes. */ + public PagedCallSettings.Builder< + ListAcceleratorTypesRequest, + ListAcceleratorTypesResponse, + ListAcceleratorTypesPagedResponse> + listAcceleratorTypesSettings() { + return getStubSettingsBuilder().listAcceleratorTypesSettings(); + } + + /** Returns the builder for the settings used for calls to getAcceleratorType. */ + public UnaryCallSettings.Builder + getAcceleratorTypeSettings() { + return getStubSettingsBuilder().getAcceleratorTypeSettings(); + } + + @Override + public TpuSettings build() throws IOException { + return new TpuSettings(this); + } + } +} diff --git a/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/gapic_metadata.json b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/gapic_metadata.json new file mode 100644 index 00000000..6226bd98 --- /dev/null +++ b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/gapic_metadata.json @@ -0,0 +1,51 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.tpu.v1", + "libraryPackage": "com.google.cloud.tpu.v1", + "services": { + "Tpu": { + "clients": { + "grpc": { + "libraryClient": "TpuClient", + "rpcs": { + "CreateNode": { + "methods": ["createNodeAsync", "createNodeAsync", "createNodeAsync", "createNodeOperationCallable", "createNodeCallable"] + }, + "DeleteNode": { + "methods": ["deleteNodeAsync", "deleteNodeAsync", "deleteNodeAsync", "deleteNodeOperationCallable", "deleteNodeCallable"] + }, + "GetAcceleratorType": { + "methods": ["getAcceleratorType", "getAcceleratorType", "getAcceleratorType", "getAcceleratorTypeCallable"] + }, + "GetNode": { + "methods": ["getNode", "getNode", "getNode", "getNodeCallable"] + }, + "GetTensorFlowVersion": { + "methods": ["getTensorFlowVersion", "getTensorFlowVersion", "getTensorFlowVersion", "getTensorFlowVersionCallable"] + }, + "ListAcceleratorTypes": { + "methods": ["listAcceleratorTypes", "listAcceleratorTypes", "listAcceleratorTypes", "listAcceleratorTypesPagedCallable", "listAcceleratorTypesCallable"] + }, + "ListNodes": { + "methods": ["listNodes", "listNodes", "listNodes", "listNodesPagedCallable", "listNodesCallable"] + }, + "ListTensorFlowVersions": { + "methods": ["listTensorFlowVersions", "listTensorFlowVersions", "listTensorFlowVersions", "listTensorFlowVersionsPagedCallable", "listTensorFlowVersionsCallable"] + }, + "ReimageNode": { + "methods": ["reimageNodeAsync", "reimageNodeOperationCallable", "reimageNodeCallable"] + }, + "StartNode": { + "methods": ["startNodeAsync", "startNodeOperationCallable", "startNodeCallable"] + }, + "StopNode": { + "methods": ["stopNodeAsync", "stopNodeOperationCallable", "stopNodeCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/package-info.java b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/package-info.java new file mode 100644 index 00000000..24d18ba5 --- /dev/null +++ b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/package-info.java @@ -0,0 +1,38 @@ +/* + * 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. + * + *

======================= TpuClient ======================= + * + *

Service Description: Manages TPU nodes and other resources + * + *

TPU API v1 + * + *

Sample for TpuClient: + * + *

{@code
+ * try (TpuClient tpuClient = TpuClient.create()) {
+ *   NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]");
+ *   Node response = tpuClient.getNode(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.tpu.v1; + +import javax.annotation.Generated; diff --git a/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/GrpcTpuCallableFactory.java b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/GrpcTpuCallableFactory.java new file mode 100644 index 00000000..e1a067a0 --- /dev/null +++ b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/GrpcTpuCallableFactory.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.tpu.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 Tpu service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcTpuCallableFactory 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-tpu/src/main/java/com/google/cloud/tpu/v1/stub/GrpcTpuStub.java b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/GrpcTpuStub.java new file mode 100644 index 00000000..f1b76d64 --- /dev/null +++ b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/GrpcTpuStub.java @@ -0,0 +1,610 @@ +/* + * 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.tpu.v1.stub; + +import static com.google.cloud.tpu.v1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListTensorFlowVersionsPagedResponse; + +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.tpu.v1.AcceleratorType; +import com.google.cloud.tpu.v1.CreateNodeRequest; +import com.google.cloud.tpu.v1.DeleteNodeRequest; +import com.google.cloud.tpu.v1.GetAcceleratorTypeRequest; +import com.google.cloud.tpu.v1.GetNodeRequest; +import com.google.cloud.tpu.v1.GetTensorFlowVersionRequest; +import com.google.cloud.tpu.v1.ListAcceleratorTypesRequest; +import com.google.cloud.tpu.v1.ListAcceleratorTypesResponse; +import com.google.cloud.tpu.v1.ListNodesRequest; +import com.google.cloud.tpu.v1.ListNodesResponse; +import com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest; +import com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse; +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.OperationMetadata; +import com.google.cloud.tpu.v1.ReimageNodeRequest; +import com.google.cloud.tpu.v1.StartNodeRequest; +import com.google.cloud.tpu.v1.StopNodeRequest; +import com.google.cloud.tpu.v1.TensorFlowVersion; +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 Tpu service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcTpuStub extends TpuStub { + private static final MethodDescriptor + listNodesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v1.Tpu/ListNodes") + .setRequestMarshaller(ProtoUtils.marshaller(ListNodesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListNodesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getNodeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v1.Tpu/GetNode") + .setRequestMarshaller(ProtoUtils.marshaller(GetNodeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Node.getDefaultInstance())) + .build(); + + private static final MethodDescriptor createNodeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v1.Tpu/CreateNode") + .setRequestMarshaller(ProtoUtils.marshaller(CreateNodeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteNodeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v1.Tpu/DeleteNode") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteNodeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor reimageNodeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v1.Tpu/ReimageNode") + .setRequestMarshaller(ProtoUtils.marshaller(ReimageNodeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor stopNodeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v1.Tpu/StopNode") + .setRequestMarshaller(ProtoUtils.marshaller(StopNodeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor startNodeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v1.Tpu/StartNode") + .setRequestMarshaller(ProtoUtils.marshaller(StartNodeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + ListTensorFlowVersionsRequest, ListTensorFlowVersionsResponse> + listTensorFlowVersionsMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v1.Tpu/ListTensorFlowVersions") + .setRequestMarshaller( + ProtoUtils.marshaller(ListTensorFlowVersionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListTensorFlowVersionsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getTensorFlowVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v1.Tpu/GetTensorFlowVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(GetTensorFlowVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(TensorFlowVersion.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listAcceleratorTypesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v1.Tpu/ListAcceleratorTypes") + .setRequestMarshaller( + ProtoUtils.marshaller(ListAcceleratorTypesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListAcceleratorTypesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getAcceleratorTypeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v1.Tpu/GetAcceleratorType") + .setRequestMarshaller( + ProtoUtils.marshaller(GetAcceleratorTypeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(AcceleratorType.getDefaultInstance())) + .build(); + + private final UnaryCallable listNodesCallable; + private final UnaryCallable listNodesPagedCallable; + private final UnaryCallable getNodeCallable; + private final UnaryCallable createNodeCallable; + private final OperationCallable + createNodeOperationCallable; + private final UnaryCallable deleteNodeCallable; + private final OperationCallable + deleteNodeOperationCallable; + private final UnaryCallable reimageNodeCallable; + private final OperationCallable + reimageNodeOperationCallable; + private final UnaryCallable stopNodeCallable; + private final OperationCallable + stopNodeOperationCallable; + private final UnaryCallable startNodeCallable; + private final OperationCallable + startNodeOperationCallable; + private final UnaryCallable + listTensorFlowVersionsCallable; + private final UnaryCallable + listTensorFlowVersionsPagedCallable; + private final UnaryCallable + getTensorFlowVersionCallable; + private final UnaryCallable + listAcceleratorTypesCallable; + private final UnaryCallable + listAcceleratorTypesPagedCallable; + private final UnaryCallable + getAcceleratorTypeCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcTpuStub create(TpuStubSettings settings) throws IOException { + return new GrpcTpuStub(settings, ClientContext.create(settings)); + } + + public static final GrpcTpuStub create(ClientContext clientContext) throws IOException { + return new GrpcTpuStub(TpuStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcTpuStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcTpuStub(TpuStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcTpuStub, 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 GrpcTpuStub(TpuStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcTpuCallableFactory()); + } + + /** + * Constructs an instance of GrpcTpuStub, 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 GrpcTpuStub( + TpuStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listNodesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listNodesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListNodesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getNodeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getNodeMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetNodeRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createNodeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createNodeMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateNodeRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteNodeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteNodeMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteNodeRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings reimageNodeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(reimageNodeMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ReimageNodeRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings stopNodeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(stopNodeMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(StopNodeRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings startNodeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(startNodeMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(StartNodeRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + listTensorFlowVersionsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listTensorFlowVersionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListTensorFlowVersionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + getTensorFlowVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getTensorFlowVersionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetTensorFlowVersionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + listAcceleratorTypesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listAcceleratorTypesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListAcceleratorTypesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + getAcceleratorTypeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getAcceleratorTypeMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetAcceleratorTypeRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.listNodesCallable = + callableFactory.createUnaryCallable( + listNodesTransportSettings, settings.listNodesSettings(), clientContext); + this.listNodesPagedCallable = + callableFactory.createPagedCallable( + listNodesTransportSettings, settings.listNodesSettings(), clientContext); + this.getNodeCallable = + callableFactory.createUnaryCallable( + getNodeTransportSettings, settings.getNodeSettings(), clientContext); + this.createNodeCallable = + callableFactory.createUnaryCallable( + createNodeTransportSettings, settings.createNodeSettings(), clientContext); + this.createNodeOperationCallable = + callableFactory.createOperationCallable( + createNodeTransportSettings, + settings.createNodeOperationSettings(), + clientContext, + operationsStub); + this.deleteNodeCallable = + callableFactory.createUnaryCallable( + deleteNodeTransportSettings, settings.deleteNodeSettings(), clientContext); + this.deleteNodeOperationCallable = + callableFactory.createOperationCallable( + deleteNodeTransportSettings, + settings.deleteNodeOperationSettings(), + clientContext, + operationsStub); + this.reimageNodeCallable = + callableFactory.createUnaryCallable( + reimageNodeTransportSettings, settings.reimageNodeSettings(), clientContext); + this.reimageNodeOperationCallable = + callableFactory.createOperationCallable( + reimageNodeTransportSettings, + settings.reimageNodeOperationSettings(), + clientContext, + operationsStub); + this.stopNodeCallable = + callableFactory.createUnaryCallable( + stopNodeTransportSettings, settings.stopNodeSettings(), clientContext); + this.stopNodeOperationCallable = + callableFactory.createOperationCallable( + stopNodeTransportSettings, + settings.stopNodeOperationSettings(), + clientContext, + operationsStub); + this.startNodeCallable = + callableFactory.createUnaryCallable( + startNodeTransportSettings, settings.startNodeSettings(), clientContext); + this.startNodeOperationCallable = + callableFactory.createOperationCallable( + startNodeTransportSettings, + settings.startNodeOperationSettings(), + clientContext, + operationsStub); + this.listTensorFlowVersionsCallable = + callableFactory.createUnaryCallable( + listTensorFlowVersionsTransportSettings, + settings.listTensorFlowVersionsSettings(), + clientContext); + this.listTensorFlowVersionsPagedCallable = + callableFactory.createPagedCallable( + listTensorFlowVersionsTransportSettings, + settings.listTensorFlowVersionsSettings(), + clientContext); + this.getTensorFlowVersionCallable = + callableFactory.createUnaryCallable( + getTensorFlowVersionTransportSettings, + settings.getTensorFlowVersionSettings(), + clientContext); + this.listAcceleratorTypesCallable = + callableFactory.createUnaryCallable( + listAcceleratorTypesTransportSettings, + settings.listAcceleratorTypesSettings(), + clientContext); + this.listAcceleratorTypesPagedCallable = + callableFactory.createPagedCallable( + listAcceleratorTypesTransportSettings, + settings.listAcceleratorTypesSettings(), + clientContext); + this.getAcceleratorTypeCallable = + callableFactory.createUnaryCallable( + getAcceleratorTypeTransportSettings, + settings.getAcceleratorTypeSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listNodesCallable() { + return listNodesCallable; + } + + @Override + public UnaryCallable listNodesPagedCallable() { + return listNodesPagedCallable; + } + + @Override + public UnaryCallable getNodeCallable() { + return getNodeCallable; + } + + @Override + public UnaryCallable createNodeCallable() { + return createNodeCallable; + } + + @Override + public OperationCallable + createNodeOperationCallable() { + return createNodeOperationCallable; + } + + @Override + public UnaryCallable deleteNodeCallable() { + return deleteNodeCallable; + } + + @Override + public OperationCallable + deleteNodeOperationCallable() { + return deleteNodeOperationCallable; + } + + @Override + public UnaryCallable reimageNodeCallable() { + return reimageNodeCallable; + } + + @Override + public OperationCallable + reimageNodeOperationCallable() { + return reimageNodeOperationCallable; + } + + @Override + public UnaryCallable stopNodeCallable() { + return stopNodeCallable; + } + + @Override + public OperationCallable stopNodeOperationCallable() { + return stopNodeOperationCallable; + } + + @Override + public UnaryCallable startNodeCallable() { + return startNodeCallable; + } + + @Override + public OperationCallable startNodeOperationCallable() { + return startNodeOperationCallable; + } + + @Override + public UnaryCallable + listTensorFlowVersionsCallable() { + return listTensorFlowVersionsCallable; + } + + @Override + public UnaryCallable + listTensorFlowVersionsPagedCallable() { + return listTensorFlowVersionsPagedCallable; + } + + @Override + public UnaryCallable + getTensorFlowVersionCallable() { + return getTensorFlowVersionCallable; + } + + @Override + public UnaryCallable + listAcceleratorTypesCallable() { + return listAcceleratorTypesCallable; + } + + @Override + public UnaryCallable + listAcceleratorTypesPagedCallable() { + return listAcceleratorTypesPagedCallable; + } + + @Override + public UnaryCallable getAcceleratorTypeCallable() { + return getAcceleratorTypeCallable; + } + + @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-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStub.java b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStub.java new file mode 100644 index 00000000..c2ad02da --- /dev/null +++ b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStub.java @@ -0,0 +1,148 @@ +/* + * 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.tpu.v1.stub; + +import static com.google.cloud.tpu.v1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListTensorFlowVersionsPagedResponse; + +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.tpu.v1.AcceleratorType; +import com.google.cloud.tpu.v1.CreateNodeRequest; +import com.google.cloud.tpu.v1.DeleteNodeRequest; +import com.google.cloud.tpu.v1.GetAcceleratorTypeRequest; +import com.google.cloud.tpu.v1.GetNodeRequest; +import com.google.cloud.tpu.v1.GetTensorFlowVersionRequest; +import com.google.cloud.tpu.v1.ListAcceleratorTypesRequest; +import com.google.cloud.tpu.v1.ListAcceleratorTypesResponse; +import com.google.cloud.tpu.v1.ListNodesRequest; +import com.google.cloud.tpu.v1.ListNodesResponse; +import com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest; +import com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse; +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.OperationMetadata; +import com.google.cloud.tpu.v1.ReimageNodeRequest; +import com.google.cloud.tpu.v1.StartNodeRequest; +import com.google.cloud.tpu.v1.StopNodeRequest; +import com.google.cloud.tpu.v1.TensorFlowVersion; +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 Tpu service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class TpuStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable listNodesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listNodesPagedCallable()"); + } + + public UnaryCallable listNodesCallable() { + throw new UnsupportedOperationException("Not implemented: listNodesCallable()"); + } + + public UnaryCallable getNodeCallable() { + throw new UnsupportedOperationException("Not implemented: getNodeCallable()"); + } + + public OperationCallable + createNodeOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createNodeOperationCallable()"); + } + + public UnaryCallable createNodeCallable() { + throw new UnsupportedOperationException("Not implemented: createNodeCallable()"); + } + + public OperationCallable + deleteNodeOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteNodeOperationCallable()"); + } + + public UnaryCallable deleteNodeCallable() { + throw new UnsupportedOperationException("Not implemented: deleteNodeCallable()"); + } + + public OperationCallable + reimageNodeOperationCallable() { + throw new UnsupportedOperationException("Not implemented: reimageNodeOperationCallable()"); + } + + public UnaryCallable reimageNodeCallable() { + throw new UnsupportedOperationException("Not implemented: reimageNodeCallable()"); + } + + public OperationCallable stopNodeOperationCallable() { + throw new UnsupportedOperationException("Not implemented: stopNodeOperationCallable()"); + } + + public UnaryCallable stopNodeCallable() { + throw new UnsupportedOperationException("Not implemented: stopNodeCallable()"); + } + + public OperationCallable startNodeOperationCallable() { + throw new UnsupportedOperationException("Not implemented: startNodeOperationCallable()"); + } + + public UnaryCallable startNodeCallable() { + throw new UnsupportedOperationException("Not implemented: startNodeCallable()"); + } + + public UnaryCallable + listTensorFlowVersionsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listTensorFlowVersionsPagedCallable()"); + } + + public UnaryCallable + listTensorFlowVersionsCallable() { + throw new UnsupportedOperationException("Not implemented: listTensorFlowVersionsCallable()"); + } + + public UnaryCallable + getTensorFlowVersionCallable() { + throw new UnsupportedOperationException("Not implemented: getTensorFlowVersionCallable()"); + } + + public UnaryCallable + listAcceleratorTypesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listAcceleratorTypesPagedCallable()"); + } + + public UnaryCallable + listAcceleratorTypesCallable() { + throw new UnsupportedOperationException("Not implemented: listAcceleratorTypesCallable()"); + } + + public UnaryCallable getAcceleratorTypeCallable() { + throw new UnsupportedOperationException("Not implemented: getAcceleratorTypeCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStubSettings.java b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStubSettings.java new file mode 100644 index 00000000..66d0b8d3 --- /dev/null +++ b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStubSettings.java @@ -0,0 +1,964 @@ +/* + * 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.tpu.v1.stub; + +import static com.google.cloud.tpu.v1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListTensorFlowVersionsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.tpu.v1.AcceleratorType; +import com.google.cloud.tpu.v1.CreateNodeRequest; +import com.google.cloud.tpu.v1.DeleteNodeRequest; +import com.google.cloud.tpu.v1.GetAcceleratorTypeRequest; +import com.google.cloud.tpu.v1.GetNodeRequest; +import com.google.cloud.tpu.v1.GetTensorFlowVersionRequest; +import com.google.cloud.tpu.v1.ListAcceleratorTypesRequest; +import com.google.cloud.tpu.v1.ListAcceleratorTypesResponse; +import com.google.cloud.tpu.v1.ListNodesRequest; +import com.google.cloud.tpu.v1.ListNodesResponse; +import com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest; +import com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse; +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.OperationMetadata; +import com.google.cloud.tpu.v1.ReimageNodeRequest; +import com.google.cloud.tpu.v1.StartNodeRequest; +import com.google.cloud.tpu.v1.StopNodeRequest; +import com.google.cloud.tpu.v1.TensorFlowVersion; +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 TpuStub}. + * + *

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

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

{@code
+ * TpuStubSettings.Builder tpuSettingsBuilder = TpuStubSettings.newBuilder();
+ * tpuSettingsBuilder
+ *     .getNodeSettings()
+ *     .setRetrySettings(
+ *         tpuSettingsBuilder
+ *             .getNodeSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * TpuStubSettings tpuSettings = tpuSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class TpuStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final PagedCallSettings + listNodesSettings; + private final UnaryCallSettings getNodeSettings; + private final UnaryCallSettings createNodeSettings; + private final OperationCallSettings + createNodeOperationSettings; + private final UnaryCallSettings deleteNodeSettings; + private final OperationCallSettings + deleteNodeOperationSettings; + private final UnaryCallSettings reimageNodeSettings; + private final OperationCallSettings + reimageNodeOperationSettings; + private final UnaryCallSettings stopNodeSettings; + private final OperationCallSettings + stopNodeOperationSettings; + private final UnaryCallSettings startNodeSettings; + private final OperationCallSettings + startNodeOperationSettings; + private final PagedCallSettings< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + ListTensorFlowVersionsPagedResponse> + listTensorFlowVersionsSettings; + private final UnaryCallSettings + getTensorFlowVersionSettings; + private final PagedCallSettings< + ListAcceleratorTypesRequest, + ListAcceleratorTypesResponse, + ListAcceleratorTypesPagedResponse> + listAcceleratorTypesSettings; + private final UnaryCallSettings + getAcceleratorTypeSettings; + + private static final PagedListDescriptor + LIST_NODES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListNodesRequest injectToken(ListNodesRequest payload, String token) { + return ListNodesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListNodesRequest injectPageSize(ListNodesRequest payload, int pageSize) { + return ListNodesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListNodesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListNodesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListNodesResponse payload) { + return payload.getNodesList() == null + ? ImmutableList.of() + : payload.getNodesList(); + } + }; + + private static final PagedListDescriptor< + ListTensorFlowVersionsRequest, ListTensorFlowVersionsResponse, TensorFlowVersion> + LIST_TENSOR_FLOW_VERSIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListTensorFlowVersionsRequest, ListTensorFlowVersionsResponse, TensorFlowVersion>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListTensorFlowVersionsRequest injectToken( + ListTensorFlowVersionsRequest payload, String token) { + return ListTensorFlowVersionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListTensorFlowVersionsRequest injectPageSize( + ListTensorFlowVersionsRequest payload, int pageSize) { + return ListTensorFlowVersionsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListTensorFlowVersionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListTensorFlowVersionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListTensorFlowVersionsResponse payload) { + return payload.getTensorflowVersionsList() == null + ? ImmutableList.of() + : payload.getTensorflowVersionsList(); + } + }; + + private static final PagedListDescriptor< + ListAcceleratorTypesRequest, ListAcceleratorTypesResponse, AcceleratorType> + LIST_ACCELERATOR_TYPES_PAGE_STR_DESC = + new PagedListDescriptor< + ListAcceleratorTypesRequest, ListAcceleratorTypesResponse, AcceleratorType>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListAcceleratorTypesRequest injectToken( + ListAcceleratorTypesRequest payload, String token) { + return ListAcceleratorTypesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListAcceleratorTypesRequest injectPageSize( + ListAcceleratorTypesRequest payload, int pageSize) { + return ListAcceleratorTypesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListAcceleratorTypesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListAcceleratorTypesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListAcceleratorTypesResponse payload) { + return payload.getAcceleratorTypesList() == null + ? ImmutableList.of() + : payload.getAcceleratorTypesList(); + } + }; + + private static final PagedListResponseFactory< + ListNodesRequest, ListNodesResponse, ListNodesPagedResponse> + LIST_NODES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListNodesRequest, ListNodesResponse, ListNodesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListNodesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_NODES_PAGE_STR_DESC, request, context); + return ListNodesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + ListTensorFlowVersionsPagedResponse> + LIST_TENSOR_FLOW_VERSIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + ListTensorFlowVersionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListTensorFlowVersionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + TensorFlowVersion> + pageContext = + PageContext.create( + callable, LIST_TENSOR_FLOW_VERSIONS_PAGE_STR_DESC, request, context); + return ListTensorFlowVersionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListAcceleratorTypesRequest, + ListAcceleratorTypesResponse, + ListAcceleratorTypesPagedResponse> + LIST_ACCELERATOR_TYPES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListAcceleratorTypesRequest, + ListAcceleratorTypesResponse, + ListAcceleratorTypesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListAcceleratorTypesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListAcceleratorTypesRequest, ListAcceleratorTypesResponse, AcceleratorType> + pageContext = + PageContext.create( + callable, LIST_ACCELERATOR_TYPES_PAGE_STR_DESC, request, context); + return ListAcceleratorTypesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listNodes. */ + public PagedCallSettings + listNodesSettings() { + return listNodesSettings; + } + + /** Returns the object with the settings used for calls to getNode. */ + public UnaryCallSettings getNodeSettings() { + return getNodeSettings; + } + + /** Returns the object with the settings used for calls to createNode. */ + public UnaryCallSettings createNodeSettings() { + return createNodeSettings; + } + + /** Returns the object with the settings used for calls to createNode. */ + public OperationCallSettings + createNodeOperationSettings() { + return createNodeOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteNode. */ + public UnaryCallSettings deleteNodeSettings() { + return deleteNodeSettings; + } + + /** Returns the object with the settings used for calls to deleteNode. */ + public OperationCallSettings + deleteNodeOperationSettings() { + return deleteNodeOperationSettings; + } + + /** Returns the object with the settings used for calls to reimageNode. */ + public UnaryCallSettings reimageNodeSettings() { + return reimageNodeSettings; + } + + /** Returns the object with the settings used for calls to reimageNode. */ + public OperationCallSettings + reimageNodeOperationSettings() { + return reimageNodeOperationSettings; + } + + /** Returns the object with the settings used for calls to stopNode. */ + public UnaryCallSettings stopNodeSettings() { + return stopNodeSettings; + } + + /** Returns the object with the settings used for calls to stopNode. */ + public OperationCallSettings + stopNodeOperationSettings() { + return stopNodeOperationSettings; + } + + /** Returns the object with the settings used for calls to startNode. */ + public UnaryCallSettings startNodeSettings() { + return startNodeSettings; + } + + /** Returns the object with the settings used for calls to startNode. */ + public OperationCallSettings + startNodeOperationSettings() { + return startNodeOperationSettings; + } + + /** Returns the object with the settings used for calls to listTensorFlowVersions. */ + public PagedCallSettings< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + ListTensorFlowVersionsPagedResponse> + listTensorFlowVersionsSettings() { + return listTensorFlowVersionsSettings; + } + + /** Returns the object with the settings used for calls to getTensorFlowVersion. */ + public UnaryCallSettings + getTensorFlowVersionSettings() { + return getTensorFlowVersionSettings; + } + + /** Returns the object with the settings used for calls to listAcceleratorTypes. */ + public PagedCallSettings< + ListAcceleratorTypesRequest, + ListAcceleratorTypesResponse, + ListAcceleratorTypesPagedResponse> + listAcceleratorTypesSettings() { + return listAcceleratorTypesSettings; + } + + /** Returns the object with the settings used for calls to getAcceleratorType. */ + public UnaryCallSettings + getAcceleratorTypeSettings() { + return getAcceleratorTypeSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TpuStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcTpuStub.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 "tpu.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(TpuStubSettings.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 TpuStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listNodesSettings = settingsBuilder.listNodesSettings().build(); + getNodeSettings = settingsBuilder.getNodeSettings().build(); + createNodeSettings = settingsBuilder.createNodeSettings().build(); + createNodeOperationSettings = settingsBuilder.createNodeOperationSettings().build(); + deleteNodeSettings = settingsBuilder.deleteNodeSettings().build(); + deleteNodeOperationSettings = settingsBuilder.deleteNodeOperationSettings().build(); + reimageNodeSettings = settingsBuilder.reimageNodeSettings().build(); + reimageNodeOperationSettings = settingsBuilder.reimageNodeOperationSettings().build(); + stopNodeSettings = settingsBuilder.stopNodeSettings().build(); + stopNodeOperationSettings = settingsBuilder.stopNodeOperationSettings().build(); + startNodeSettings = settingsBuilder.startNodeSettings().build(); + startNodeOperationSettings = settingsBuilder.startNodeOperationSettings().build(); + listTensorFlowVersionsSettings = settingsBuilder.listTensorFlowVersionsSettings().build(); + getTensorFlowVersionSettings = settingsBuilder.getTensorFlowVersionSettings().build(); + listAcceleratorTypesSettings = settingsBuilder.listAcceleratorTypesSettings().build(); + getAcceleratorTypeSettings = settingsBuilder.getAcceleratorTypeSettings().build(); + } + + /** Builder for TpuStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListNodesRequest, ListNodesResponse, ListNodesPagedResponse> + listNodesSettings; + private final UnaryCallSettings.Builder getNodeSettings; + private final UnaryCallSettings.Builder createNodeSettings; + private final OperationCallSettings.Builder + createNodeOperationSettings; + private final UnaryCallSettings.Builder deleteNodeSettings; + private final OperationCallSettings.Builder + deleteNodeOperationSettings; + private final UnaryCallSettings.Builder reimageNodeSettings; + private final OperationCallSettings.Builder + reimageNodeOperationSettings; + private final UnaryCallSettings.Builder stopNodeSettings; + private final OperationCallSettings.Builder + stopNodeOperationSettings; + private final UnaryCallSettings.Builder startNodeSettings; + private final OperationCallSettings.Builder + startNodeOperationSettings; + private final PagedCallSettings.Builder< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + ListTensorFlowVersionsPagedResponse> + listTensorFlowVersionsSettings; + private final UnaryCallSettings.Builder + getTensorFlowVersionSettings; + private final PagedCallSettings.Builder< + ListAcceleratorTypesRequest, + ListAcceleratorTypesResponse, + ListAcceleratorTypesPagedResponse> + listAcceleratorTypesSettings; + private final UnaryCallSettings.Builder + getAcceleratorTypeSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_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() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listNodesSettings = PagedCallSettings.newBuilder(LIST_NODES_PAGE_STR_FACT); + getNodeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createNodeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createNodeOperationSettings = OperationCallSettings.newBuilder(); + deleteNodeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteNodeOperationSettings = OperationCallSettings.newBuilder(); + reimageNodeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + reimageNodeOperationSettings = OperationCallSettings.newBuilder(); + stopNodeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + stopNodeOperationSettings = OperationCallSettings.newBuilder(); + startNodeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + startNodeOperationSettings = OperationCallSettings.newBuilder(); + listTensorFlowVersionsSettings = + PagedCallSettings.newBuilder(LIST_TENSOR_FLOW_VERSIONS_PAGE_STR_FACT); + getTensorFlowVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listAcceleratorTypesSettings = + PagedCallSettings.newBuilder(LIST_ACCELERATOR_TYPES_PAGE_STR_FACT); + getAcceleratorTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listNodesSettings, + getNodeSettings, + createNodeSettings, + deleteNodeSettings, + reimageNodeSettings, + stopNodeSettings, + startNodeSettings, + listTensorFlowVersionsSettings, + getTensorFlowVersionSettings, + listAcceleratorTypesSettings, + getAcceleratorTypeSettings); + initDefaults(this); + } + + protected Builder(TpuStubSettings settings) { + super(settings); + + listNodesSettings = settings.listNodesSettings.toBuilder(); + getNodeSettings = settings.getNodeSettings.toBuilder(); + createNodeSettings = settings.createNodeSettings.toBuilder(); + createNodeOperationSettings = settings.createNodeOperationSettings.toBuilder(); + deleteNodeSettings = settings.deleteNodeSettings.toBuilder(); + deleteNodeOperationSettings = settings.deleteNodeOperationSettings.toBuilder(); + reimageNodeSettings = settings.reimageNodeSettings.toBuilder(); + reimageNodeOperationSettings = settings.reimageNodeOperationSettings.toBuilder(); + stopNodeSettings = settings.stopNodeSettings.toBuilder(); + stopNodeOperationSettings = settings.stopNodeOperationSettings.toBuilder(); + startNodeSettings = settings.startNodeSettings.toBuilder(); + startNodeOperationSettings = settings.startNodeOperationSettings.toBuilder(); + listTensorFlowVersionsSettings = settings.listTensorFlowVersionsSettings.toBuilder(); + getTensorFlowVersionSettings = settings.getTensorFlowVersionSettings.toBuilder(); + listAcceleratorTypesSettings = settings.listAcceleratorTypesSettings.toBuilder(); + getAcceleratorTypeSettings = settings.getAcceleratorTypeSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listNodesSettings, + getNodeSettings, + createNodeSettings, + deleteNodeSettings, + reimageNodeSettings, + stopNodeSettings, + startNodeSettings, + listTensorFlowVersionsSettings, + getTensorFlowVersionSettings, + listAcceleratorTypesSettings, + getAcceleratorTypeSettings); + } + + 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 + .listNodesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getNodeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .createNodeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .deleteNodeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .reimageNodeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .stopNodeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .startNodeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listTensorFlowVersionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getTensorFlowVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listAcceleratorTypesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getAcceleratorTypeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .createNodeOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Node.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteNodeOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Node.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .reimageNodeOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Node.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .stopNodeOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Node.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .startNodeOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Node.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listNodes. */ + public PagedCallSettings.Builder + listNodesSettings() { + return listNodesSettings; + } + + /** Returns the builder for the settings used for calls to getNode. */ + public UnaryCallSettings.Builder getNodeSettings() { + return getNodeSettings; + } + + /** Returns the builder for the settings used for calls to createNode. */ + public UnaryCallSettings.Builder createNodeSettings() { + return createNodeSettings; + } + + /** Returns the builder for the settings used for calls to createNode. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createNodeOperationSettings() { + return createNodeOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteNode. */ + public UnaryCallSettings.Builder deleteNodeSettings() { + return deleteNodeSettings; + } + + /** Returns the builder for the settings used for calls to deleteNode. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteNodeOperationSettings() { + return deleteNodeOperationSettings; + } + + /** Returns the builder for the settings used for calls to reimageNode. */ + public UnaryCallSettings.Builder reimageNodeSettings() { + return reimageNodeSettings; + } + + /** Returns the builder for the settings used for calls to reimageNode. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + reimageNodeOperationSettings() { + return reimageNodeOperationSettings; + } + + /** Returns the builder for the settings used for calls to stopNode. */ + public UnaryCallSettings.Builder stopNodeSettings() { + return stopNodeSettings; + } + + /** Returns the builder for the settings used for calls to stopNode. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + stopNodeOperationSettings() { + return stopNodeOperationSettings; + } + + /** Returns the builder for the settings used for calls to startNode. */ + public UnaryCallSettings.Builder startNodeSettings() { + return startNodeSettings; + } + + /** Returns the builder for the settings used for calls to startNode. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + startNodeOperationSettings() { + return startNodeOperationSettings; + } + + /** Returns the builder for the settings used for calls to listTensorFlowVersions. */ + public PagedCallSettings.Builder< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + ListTensorFlowVersionsPagedResponse> + listTensorFlowVersionsSettings() { + return listTensorFlowVersionsSettings; + } + + /** Returns the builder for the settings used for calls to getTensorFlowVersion. */ + public UnaryCallSettings.Builder + getTensorFlowVersionSettings() { + return getTensorFlowVersionSettings; + } + + /** Returns the builder for the settings used for calls to listAcceleratorTypes. */ + public PagedCallSettings.Builder< + ListAcceleratorTypesRequest, + ListAcceleratorTypesResponse, + ListAcceleratorTypesPagedResponse> + listAcceleratorTypesSettings() { + return listAcceleratorTypesSettings; + } + + /** Returns the builder for the settings used for calls to getAcceleratorType. */ + public UnaryCallSettings.Builder + getAcceleratorTypeSettings() { + return getAcceleratorTypeSettings; + } + + @Override + public TpuStubSettings build() throws IOException { + return new TpuStubSettings(this); + } + } +} diff --git a/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/MockTpu.java b/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/MockTpu.java new file mode 100644 index 00000000..0e669cb9 --- /dev/null +++ b/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/MockTpu.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.tpu.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 MockTpu implements MockGrpcService { + private final MockTpuImpl serviceImpl; + + public MockTpu() { + serviceImpl = new MockTpuImpl(); + } + + @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-tpu/src/test/java/com/google/cloud/tpu/v1/MockTpuImpl.java b/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/MockTpuImpl.java new file mode 100644 index 00000000..a2ef14ba --- /dev/null +++ b/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/MockTpuImpl.java @@ -0,0 +1,288 @@ +/* + * 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.tpu.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.tpu.v1.TpuGrpc.TpuImplBase; +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 MockTpuImpl extends TpuImplBase { + private List requests; + private Queue responses; + + public MockTpuImpl() { + 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 listNodes( + ListNodesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListNodesResponse) { + requests.add(request); + responseObserver.onNext(((ListNodesResponse) 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 ListNodes, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListNodesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getNode(GetNodeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Node) { + requests.add(request); + responseObserver.onNext(((Node) 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 GetNode, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Node.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createNode(CreateNodeRequest 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 CreateNode, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteNode(DeleteNodeRequest 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 DeleteNode, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void reimageNode(ReimageNodeRequest 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 ReimageNode, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void stopNode(StopNodeRequest 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 StopNode, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void startNode(StartNodeRequest 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 StartNode, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listTensorFlowVersions( + ListTensorFlowVersionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListTensorFlowVersionsResponse) { + requests.add(request); + responseObserver.onNext(((ListTensorFlowVersionsResponse) 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 ListTensorFlowVersions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListTensorFlowVersionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getTensorFlowVersion( + GetTensorFlowVersionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TensorFlowVersion) { + requests.add(request); + responseObserver.onNext(((TensorFlowVersion) 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 GetTensorFlowVersion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TensorFlowVersion.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listAcceleratorTypes( + ListAcceleratorTypesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListAcceleratorTypesResponse) { + requests.add(request); + responseObserver.onNext(((ListAcceleratorTypesResponse) 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 ListAcceleratorTypes, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListAcceleratorTypesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getAcceleratorType( + GetAcceleratorTypeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AcceleratorType) { + requests.add(request); + responseObserver.onNext(((AcceleratorType) 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 GetAcceleratorType, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AcceleratorType.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/TpuClientTest.java b/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/TpuClientTest.java new file mode 100644 index 00000000..0047c609 --- /dev/null +++ b/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/TpuClientTest.java @@ -0,0 +1,1083 @@ +/* + * 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.tpu.v1; + +import static com.google.cloud.tpu.v1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListTensorFlowVersionsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class TpuClientTest { + private static MockServiceHelper mockServiceHelper; + private static MockTpu mockTpu; + private TpuClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockTpu = new MockTpu(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockTpu)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + TpuSettings settings = + TpuSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = TpuClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listNodesTest() throws Exception { + Node responsesElement = Node.newBuilder().build(); + ListNodesResponse expectedResponse = + ListNodesResponse.newBuilder() + .setNextPageToken("") + .addAllNodes(Arrays.asList(responsesElement)) + .build(); + mockTpu.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListNodesPagedResponse pagedListResponse = client.listNodes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getNodesList().get(0), resources.get(0)); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListNodesRequest actualRequest = ((ListNodesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listNodesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listNodes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listNodesTest2() throws Exception { + Node responsesElement = Node.newBuilder().build(); + ListNodesResponse expectedResponse = + ListNodesResponse.newBuilder() + .setNextPageToken("") + .addAllNodes(Arrays.asList(responsesElement)) + .build(); + mockTpu.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListNodesPagedResponse pagedListResponse = client.listNodes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getNodesList().get(0), resources.get(0)); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListNodesRequest actualRequest = ((ListNodesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listNodesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + String parent = "parent-995424086"; + client.listNodes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getNodeTest() throws Exception { + Node expectedResponse = + Node.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setDescription("description-1724546052") + .setAcceleratorType("acceleratorType-82462651") + .setIpAddress("ipAddress1634032845") + .setPort("port3446913") + .setHealthDescription("healthDescription1231837184") + .setTensorflowVersion("tensorflowVersion-470125103") + .setNetwork("network1843485230") + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount("serviceAccount1079137720") + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .setUseServiceNetworking(true) + .addAllSymptoms(new ArrayList()) + .build(); + mockTpu.addResponse(expectedResponse); + + NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); + + Node actualResponse = client.getNode(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetNodeRequest actualRequest = ((GetNodeRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getNodeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); + client.getNode(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getNodeTest2() throws Exception { + Node expectedResponse = + Node.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setDescription("description-1724546052") + .setAcceleratorType("acceleratorType-82462651") + .setIpAddress("ipAddress1634032845") + .setPort("port3446913") + .setHealthDescription("healthDescription1231837184") + .setTensorflowVersion("tensorflowVersion-470125103") + .setNetwork("network1843485230") + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount("serviceAccount1079137720") + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .setUseServiceNetworking(true) + .addAllSymptoms(new ArrayList()) + .build(); + mockTpu.addResponse(expectedResponse); + + String name = "name3373707"; + + Node actualResponse = client.getNode(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetNodeRequest actualRequest = ((GetNodeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getNodeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + String name = "name3373707"; + client.getNode(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createNodeTest() throws Exception { + Node expectedResponse = + Node.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setDescription("description-1724546052") + .setAcceleratorType("acceleratorType-82462651") + .setIpAddress("ipAddress1634032845") + .setPort("port3446913") + .setHealthDescription("healthDescription1231837184") + .setTensorflowVersion("tensorflowVersion-470125103") + .setNetwork("network1843485230") + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount("serviceAccount1079137720") + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .setUseServiceNetworking(true) + .addAllSymptoms(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createNodeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTpu.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Node node = Node.newBuilder().build(); + String nodeId = "nodeId-1040171331"; + + Node actualResponse = client.createNodeAsync(parent, node, nodeId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateNodeRequest actualRequest = ((CreateNodeRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(node, actualRequest.getNode()); + Assert.assertEquals(nodeId, actualRequest.getNodeId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createNodeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Node node = Node.newBuilder().build(); + String nodeId = "nodeId-1040171331"; + client.createNodeAsync(parent, node, nodeId).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 createNodeTest2() throws Exception { + Node expectedResponse = + Node.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setDescription("description-1724546052") + .setAcceleratorType("acceleratorType-82462651") + .setIpAddress("ipAddress1634032845") + .setPort("port3446913") + .setHealthDescription("healthDescription1231837184") + .setTensorflowVersion("tensorflowVersion-470125103") + .setNetwork("network1843485230") + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount("serviceAccount1079137720") + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .setUseServiceNetworking(true) + .addAllSymptoms(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createNodeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTpu.addResponse(resultOperation); + + String parent = "parent-995424086"; + Node node = Node.newBuilder().build(); + String nodeId = "nodeId-1040171331"; + + Node actualResponse = client.createNodeAsync(parent, node, nodeId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateNodeRequest actualRequest = ((CreateNodeRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(node, actualRequest.getNode()); + Assert.assertEquals(nodeId, actualRequest.getNodeId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createNodeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + String parent = "parent-995424086"; + Node node = Node.newBuilder().build(); + String nodeId = "nodeId-1040171331"; + client.createNodeAsync(parent, node, nodeId).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 deleteNodeTest() throws Exception { + Node expectedResponse = + Node.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setDescription("description-1724546052") + .setAcceleratorType("acceleratorType-82462651") + .setIpAddress("ipAddress1634032845") + .setPort("port3446913") + .setHealthDescription("healthDescription1231837184") + .setTensorflowVersion("tensorflowVersion-470125103") + .setNetwork("network1843485230") + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount("serviceAccount1079137720") + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .setUseServiceNetworking(true) + .addAllSymptoms(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteNodeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTpu.addResponse(resultOperation); + + NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); + + Node actualResponse = client.deleteNodeAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteNodeRequest actualRequest = ((DeleteNodeRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteNodeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); + client.deleteNodeAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteNodeTest2() throws Exception { + Node expectedResponse = + Node.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setDescription("description-1724546052") + .setAcceleratorType("acceleratorType-82462651") + .setIpAddress("ipAddress1634032845") + .setPort("port3446913") + .setHealthDescription("healthDescription1231837184") + .setTensorflowVersion("tensorflowVersion-470125103") + .setNetwork("network1843485230") + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount("serviceAccount1079137720") + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .setUseServiceNetworking(true) + .addAllSymptoms(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteNodeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTpu.addResponse(resultOperation); + + String name = "name3373707"; + + Node actualResponse = client.deleteNodeAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteNodeRequest actualRequest = ((DeleteNodeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteNodeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + String name = "name3373707"; + client.deleteNodeAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void reimageNodeTest() throws Exception { + Node expectedResponse = + Node.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setDescription("description-1724546052") + .setAcceleratorType("acceleratorType-82462651") + .setIpAddress("ipAddress1634032845") + .setPort("port3446913") + .setHealthDescription("healthDescription1231837184") + .setTensorflowVersion("tensorflowVersion-470125103") + .setNetwork("network1843485230") + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount("serviceAccount1079137720") + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .setUseServiceNetworking(true) + .addAllSymptoms(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("reimageNodeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTpu.addResponse(resultOperation); + + ReimageNodeRequest request = + ReimageNodeRequest.newBuilder() + .setName("name3373707") + .setTensorflowVersion("tensorflowVersion-470125103") + .build(); + + Node actualResponse = client.reimageNodeAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ReimageNodeRequest actualRequest = ((ReimageNodeRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getTensorflowVersion(), actualRequest.getTensorflowVersion()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void reimageNodeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + ReimageNodeRequest request = + ReimageNodeRequest.newBuilder() + .setName("name3373707") + .setTensorflowVersion("tensorflowVersion-470125103") + .build(); + client.reimageNodeAsync(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 stopNodeTest() throws Exception { + Node expectedResponse = + Node.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setDescription("description-1724546052") + .setAcceleratorType("acceleratorType-82462651") + .setIpAddress("ipAddress1634032845") + .setPort("port3446913") + .setHealthDescription("healthDescription1231837184") + .setTensorflowVersion("tensorflowVersion-470125103") + .setNetwork("network1843485230") + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount("serviceAccount1079137720") + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .setUseServiceNetworking(true) + .addAllSymptoms(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("stopNodeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTpu.addResponse(resultOperation); + + StopNodeRequest request = StopNodeRequest.newBuilder().setName("name3373707").build(); + + Node actualResponse = client.stopNodeAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + StopNodeRequest actualRequest = ((StopNodeRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void stopNodeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + StopNodeRequest request = StopNodeRequest.newBuilder().setName("name3373707").build(); + client.stopNodeAsync(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 startNodeTest() throws Exception { + Node expectedResponse = + Node.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setDescription("description-1724546052") + .setAcceleratorType("acceleratorType-82462651") + .setIpAddress("ipAddress1634032845") + .setPort("port3446913") + .setHealthDescription("healthDescription1231837184") + .setTensorflowVersion("tensorflowVersion-470125103") + .setNetwork("network1843485230") + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount("serviceAccount1079137720") + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .setUseServiceNetworking(true) + .addAllSymptoms(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("startNodeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTpu.addResponse(resultOperation); + + StartNodeRequest request = StartNodeRequest.newBuilder().setName("name3373707").build(); + + Node actualResponse = client.startNodeAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + StartNodeRequest actualRequest = ((StartNodeRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void startNodeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + StartNodeRequest request = StartNodeRequest.newBuilder().setName("name3373707").build(); + client.startNodeAsync(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 listTensorFlowVersionsTest() throws Exception { + TensorFlowVersion responsesElement = TensorFlowVersion.newBuilder().build(); + ListTensorFlowVersionsResponse expectedResponse = + ListTensorFlowVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllTensorflowVersions(Arrays.asList(responsesElement)) + .build(); + mockTpu.addResponse(expectedResponse); + + TensorFlowVersionName parent = + TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]"); + + ListTensorFlowVersionsPagedResponse pagedListResponse = client.listTensorFlowVersions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTensorflowVersionsList().get(0), resources.get(0)); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTensorFlowVersionsRequest actualRequest = + ((ListTensorFlowVersionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listTensorFlowVersionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + TensorFlowVersionName parent = + TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]"); + client.listTensorFlowVersions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTensorFlowVersionsTest2() throws Exception { + TensorFlowVersion responsesElement = TensorFlowVersion.newBuilder().build(); + ListTensorFlowVersionsResponse expectedResponse = + ListTensorFlowVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllTensorflowVersions(Arrays.asList(responsesElement)) + .build(); + mockTpu.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListTensorFlowVersionsPagedResponse pagedListResponse = client.listTensorFlowVersions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTensorflowVersionsList().get(0), resources.get(0)); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTensorFlowVersionsRequest actualRequest = + ((ListTensorFlowVersionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listTensorFlowVersionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + String parent = "parent-995424086"; + client.listTensorFlowVersions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTensorFlowVersionTest() throws Exception { + TensorFlowVersion expectedResponse = + TensorFlowVersion.newBuilder() + .setName( + TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]") + .toString()) + .setVersion("version351608024") + .build(); + mockTpu.addResponse(expectedResponse); + + TensorFlowVersionName name = + TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]"); + + TensorFlowVersion actualResponse = client.getTensorFlowVersion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetTensorFlowVersionRequest actualRequest = + ((GetTensorFlowVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getTensorFlowVersionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + TensorFlowVersionName name = + TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]"); + client.getTensorFlowVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTensorFlowVersionTest2() throws Exception { + TensorFlowVersion expectedResponse = + TensorFlowVersion.newBuilder() + .setName( + TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]") + .toString()) + .setVersion("version351608024") + .build(); + mockTpu.addResponse(expectedResponse); + + String name = "name3373707"; + + TensorFlowVersion actualResponse = client.getTensorFlowVersion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetTensorFlowVersionRequest actualRequest = + ((GetTensorFlowVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getTensorFlowVersionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + String name = "name3373707"; + client.getTensorFlowVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAcceleratorTypesTest() throws Exception { + AcceleratorType responsesElement = AcceleratorType.newBuilder().build(); + ListAcceleratorTypesResponse expectedResponse = + ListAcceleratorTypesResponse.newBuilder() + .setNextPageToken("") + .addAllAcceleratorTypes(Arrays.asList(responsesElement)) + .build(); + mockTpu.addResponse(expectedResponse); + + AcceleratorTypeName parent = + AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]"); + + ListAcceleratorTypesPagedResponse pagedListResponse = client.listAcceleratorTypes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAcceleratorTypesList().get(0), resources.get(0)); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAcceleratorTypesRequest actualRequest = + ((ListAcceleratorTypesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAcceleratorTypesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + AcceleratorTypeName parent = + AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]"); + client.listAcceleratorTypes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAcceleratorTypesTest2() throws Exception { + AcceleratorType responsesElement = AcceleratorType.newBuilder().build(); + ListAcceleratorTypesResponse expectedResponse = + ListAcceleratorTypesResponse.newBuilder() + .setNextPageToken("") + .addAllAcceleratorTypes(Arrays.asList(responsesElement)) + .build(); + mockTpu.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListAcceleratorTypesPagedResponse pagedListResponse = client.listAcceleratorTypes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAcceleratorTypesList().get(0), resources.get(0)); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAcceleratorTypesRequest actualRequest = + ((ListAcceleratorTypesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAcceleratorTypesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + String parent = "parent-995424086"; + client.listAcceleratorTypes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAcceleratorTypeTest() throws Exception { + AcceleratorType expectedResponse = + AcceleratorType.newBuilder() + .setName( + AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]").toString()) + .setType("type3575610") + .build(); + mockTpu.addResponse(expectedResponse); + + AcceleratorTypeName name = + AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]"); + + AcceleratorType actualResponse = client.getAcceleratorType(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAcceleratorTypeRequest actualRequest = ((GetAcceleratorTypeRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAcceleratorTypeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + AcceleratorTypeName name = + AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]"); + client.getAcceleratorType(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAcceleratorTypeTest2() throws Exception { + AcceleratorType expectedResponse = + AcceleratorType.newBuilder() + .setName( + AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]").toString()) + .setType("type3575610") + .build(); + mockTpu.addResponse(expectedResponse); + + String name = "name3373707"; + + AcceleratorType actualResponse = client.getAcceleratorType(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAcceleratorTypeRequest actualRequest = ((GetAcceleratorTypeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAcceleratorTypeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + String name = "name3373707"; + client.getAcceleratorType(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/grpc-google-cloud-tpu-v1/pom.xml b/grpc-google-cloud-tpu-v1/pom.xml new file mode 100644 index 00000000..24c2bef5 --- /dev/null +++ b/grpc-google-cloud-tpu-v1/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-tpu-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-tpu-v1 + GRPC library for google-cloud-tpu + + com.google.cloud + google-cloud-tpu-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-tpu-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-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TpuGrpc.java b/grpc-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TpuGrpc.java new file mode 100644 index 00000000..1a344308 --- /dev/null +++ b/grpc-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TpuGrpc.java @@ -0,0 +1,1462 @@ +/* + * 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.tpu.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Manages TPU nodes and other resources
+ * TPU API v1
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/tpu/v1/cloud_tpu.proto") +public final class TpuGrpc { + + private TpuGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.tpu.v1.Tpu"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.ListNodesRequest, com.google.cloud.tpu.v1.ListNodesResponse> + getListNodesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListNodes", + requestType = com.google.cloud.tpu.v1.ListNodesRequest.class, + responseType = com.google.cloud.tpu.v1.ListNodesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.ListNodesRequest, com.google.cloud.tpu.v1.ListNodesResponse> + getListNodesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.ListNodesRequest, com.google.cloud.tpu.v1.ListNodesResponse> + getListNodesMethod; + if ((getListNodesMethod = TpuGrpc.getListNodesMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getListNodesMethod = TpuGrpc.getListNodesMethod) == null) { + TpuGrpc.getListNodesMethod = + getListNodesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListNodes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.ListNodesRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.ListNodesResponse.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("ListNodes")) + .build(); + } + } + } + return getListNodesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.GetNodeRequest, com.google.cloud.tpu.v1.Node> + getGetNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetNode", + requestType = com.google.cloud.tpu.v1.GetNodeRequest.class, + responseType = com.google.cloud.tpu.v1.Node.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.GetNodeRequest, com.google.cloud.tpu.v1.Node> + getGetNodeMethod() { + io.grpc.MethodDescriptor + getGetNodeMethod; + if ((getGetNodeMethod = TpuGrpc.getGetNodeMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getGetNodeMethod = TpuGrpc.getGetNodeMethod) == null) { + TpuGrpc.getGetNodeMethod = + getGetNodeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetNode")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.GetNodeRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.Node.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("GetNode")) + .build(); + } + } + } + return getGetNodeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.CreateNodeRequest, com.google.longrunning.Operation> + getCreateNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateNode", + requestType = com.google.cloud.tpu.v1.CreateNodeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.CreateNodeRequest, com.google.longrunning.Operation> + getCreateNodeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.CreateNodeRequest, com.google.longrunning.Operation> + getCreateNodeMethod; + if ((getCreateNodeMethod = TpuGrpc.getCreateNodeMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getCreateNodeMethod = TpuGrpc.getCreateNodeMethod) == null) { + TpuGrpc.getCreateNodeMethod = + getCreateNodeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateNode")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.CreateNodeRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("CreateNode")) + .build(); + } + } + } + return getCreateNodeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.DeleteNodeRequest, com.google.longrunning.Operation> + getDeleteNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteNode", + requestType = com.google.cloud.tpu.v1.DeleteNodeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.DeleteNodeRequest, com.google.longrunning.Operation> + getDeleteNodeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.DeleteNodeRequest, com.google.longrunning.Operation> + getDeleteNodeMethod; + if ((getDeleteNodeMethod = TpuGrpc.getDeleteNodeMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getDeleteNodeMethod = TpuGrpc.getDeleteNodeMethod) == null) { + TpuGrpc.getDeleteNodeMethod = + getDeleteNodeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteNode")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.DeleteNodeRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("DeleteNode")) + .build(); + } + } + } + return getDeleteNodeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.ReimageNodeRequest, com.google.longrunning.Operation> + getReimageNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ReimageNode", + requestType = com.google.cloud.tpu.v1.ReimageNodeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.ReimageNodeRequest, com.google.longrunning.Operation> + getReimageNodeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.ReimageNodeRequest, com.google.longrunning.Operation> + getReimageNodeMethod; + if ((getReimageNodeMethod = TpuGrpc.getReimageNodeMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getReimageNodeMethod = TpuGrpc.getReimageNodeMethod) == null) { + TpuGrpc.getReimageNodeMethod = + getReimageNodeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ReimageNode")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.ReimageNodeRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("ReimageNode")) + .build(); + } + } + } + return getReimageNodeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.StopNodeRequest, com.google.longrunning.Operation> + getStopNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StopNode", + requestType = com.google.cloud.tpu.v1.StopNodeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.StopNodeRequest, com.google.longrunning.Operation> + getStopNodeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.StopNodeRequest, com.google.longrunning.Operation> + getStopNodeMethod; + if ((getStopNodeMethod = TpuGrpc.getStopNodeMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getStopNodeMethod = TpuGrpc.getStopNodeMethod) == null) { + TpuGrpc.getStopNodeMethod = + getStopNodeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StopNode")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.StopNodeRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("StopNode")) + .build(); + } + } + } + return getStopNodeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.StartNodeRequest, com.google.longrunning.Operation> + getStartNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StartNode", + requestType = com.google.cloud.tpu.v1.StartNodeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.StartNodeRequest, com.google.longrunning.Operation> + getStartNodeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.StartNodeRequest, com.google.longrunning.Operation> + getStartNodeMethod; + if ((getStartNodeMethod = TpuGrpc.getStartNodeMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getStartNodeMethod = TpuGrpc.getStartNodeMethod) == null) { + TpuGrpc.getStartNodeMethod = + getStartNodeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StartNode")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.StartNodeRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("StartNode")) + .build(); + } + } + } + return getStartNodeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest, + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse> + getListTensorFlowVersionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListTensorFlowVersions", + requestType = com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest.class, + responseType = com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest, + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse> + getListTensorFlowVersionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest, + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse> + getListTensorFlowVersionsMethod; + if ((getListTensorFlowVersionsMethod = TpuGrpc.getListTensorFlowVersionsMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getListTensorFlowVersionsMethod = TpuGrpc.getListTensorFlowVersionsMethod) == null) { + TpuGrpc.getListTensorFlowVersionsMethod = + getListTensorFlowVersionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListTensorFlowVersions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new TpuMethodDescriptorSupplier("ListTensorFlowVersions")) + .build(); + } + } + } + return getListTensorFlowVersionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest, + com.google.cloud.tpu.v1.TensorFlowVersion> + getGetTensorFlowVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetTensorFlowVersion", + requestType = com.google.cloud.tpu.v1.GetTensorFlowVersionRequest.class, + responseType = com.google.cloud.tpu.v1.TensorFlowVersion.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest, + com.google.cloud.tpu.v1.TensorFlowVersion> + getGetTensorFlowVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest, + com.google.cloud.tpu.v1.TensorFlowVersion> + getGetTensorFlowVersionMethod; + if ((getGetTensorFlowVersionMethod = TpuGrpc.getGetTensorFlowVersionMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getGetTensorFlowVersionMethod = TpuGrpc.getGetTensorFlowVersionMethod) == null) { + TpuGrpc.getGetTensorFlowVersionMethod = + getGetTensorFlowVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetTensorFlowVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.TensorFlowVersion.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("GetTensorFlowVersion")) + .build(); + } + } + } + return getGetTensorFlowVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest, + com.google.cloud.tpu.v1.ListAcceleratorTypesResponse> + getListAcceleratorTypesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListAcceleratorTypes", + requestType = com.google.cloud.tpu.v1.ListAcceleratorTypesRequest.class, + responseType = com.google.cloud.tpu.v1.ListAcceleratorTypesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest, + com.google.cloud.tpu.v1.ListAcceleratorTypesResponse> + getListAcceleratorTypesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest, + com.google.cloud.tpu.v1.ListAcceleratorTypesResponse> + getListAcceleratorTypesMethod; + if ((getListAcceleratorTypesMethod = TpuGrpc.getListAcceleratorTypesMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getListAcceleratorTypesMethod = TpuGrpc.getListAcceleratorTypesMethod) == null) { + TpuGrpc.getListAcceleratorTypesMethod = + getListAcceleratorTypesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListAcceleratorTypes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.ListAcceleratorTypesResponse + .getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("ListAcceleratorTypes")) + .build(); + } + } + } + return getListAcceleratorTypesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest, + com.google.cloud.tpu.v1.AcceleratorType> + getGetAcceleratorTypeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAcceleratorType", + requestType = com.google.cloud.tpu.v1.GetAcceleratorTypeRequest.class, + responseType = com.google.cloud.tpu.v1.AcceleratorType.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest, + com.google.cloud.tpu.v1.AcceleratorType> + getGetAcceleratorTypeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest, + com.google.cloud.tpu.v1.AcceleratorType> + getGetAcceleratorTypeMethod; + if ((getGetAcceleratorTypeMethod = TpuGrpc.getGetAcceleratorTypeMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getGetAcceleratorTypeMethod = TpuGrpc.getGetAcceleratorTypeMethod) == null) { + TpuGrpc.getGetAcceleratorTypeMethod = + getGetAcceleratorTypeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetAcceleratorType")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.AcceleratorType.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("GetAcceleratorType")) + .build(); + } + } + } + return getGetAcceleratorTypeMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static TpuStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TpuStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TpuStub(channel, callOptions); + } + }; + return TpuStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static TpuBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TpuBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TpuBlockingStub(channel, callOptions); + } + }; + return TpuBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static TpuFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TpuFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TpuFutureStub(channel, callOptions); + } + }; + return TpuFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Manages TPU nodes and other resources
+   * TPU API v1
+   * 
+ */ + public abstract static class TpuImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists nodes.
+     * 
+ */ + public void listNodes( + com.google.cloud.tpu.v1.ListNodesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListNodesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the details of a node.
+     * 
+ */ + public void getNode( + com.google.cloud.tpu.v1.GetNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetNodeMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a node.
+     * 
+ */ + public void createNode( + com.google.cloud.tpu.v1.CreateNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateNodeMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a node.
+     * 
+ */ + public void deleteNode( + com.google.cloud.tpu.v1.DeleteNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteNodeMethod(), responseObserver); + } + + /** + * + * + *
+     * Reimages a node's OS.
+     * 
+ */ + public void reimageNode( + com.google.cloud.tpu.v1.ReimageNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getReimageNodeMethod(), responseObserver); + } + + /** + * + * + *
+     * Stops a node.
+     * 
+ */ + public void stopNode( + com.google.cloud.tpu.v1.StopNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStopNodeMethod(), responseObserver); + } + + /** + * + * + *
+     * Starts a node.
+     * 
+ */ + public void startNode( + com.google.cloud.tpu.v1.StartNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStartNodeMethod(), responseObserver); + } + + /** + * + * + *
+     * List TensorFlow versions supported by this API.
+     * 
+ */ + public void listTensorFlowVersions( + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListTensorFlowVersionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets TensorFlow Version.
+     * 
+ */ + public void getTensorFlowVersion( + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetTensorFlowVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists accelerator types supported by this API.
+     * 
+ */ + public void listAcceleratorTypes( + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListAcceleratorTypesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets AcceleratorType.
+     * 
+ */ + public void getAcceleratorType( + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetAcceleratorTypeMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListNodesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v1.ListNodesRequest, + com.google.cloud.tpu.v1.ListNodesResponse>(this, METHODID_LIST_NODES))) + .addMethod( + getGetNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v1.GetNodeRequest, com.google.cloud.tpu.v1.Node>( + this, METHODID_GET_NODE))) + .addMethod( + getCreateNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v1.CreateNodeRequest, com.google.longrunning.Operation>( + this, METHODID_CREATE_NODE))) + .addMethod( + getDeleteNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v1.DeleteNodeRequest, com.google.longrunning.Operation>( + this, METHODID_DELETE_NODE))) + .addMethod( + getReimageNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v1.ReimageNodeRequest, com.google.longrunning.Operation>( + this, METHODID_REIMAGE_NODE))) + .addMethod( + getStopNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v1.StopNodeRequest, com.google.longrunning.Operation>( + this, METHODID_STOP_NODE))) + .addMethod( + getStartNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v1.StartNodeRequest, com.google.longrunning.Operation>( + this, METHODID_START_NODE))) + .addMethod( + getListTensorFlowVersionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest, + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse>( + this, METHODID_LIST_TENSOR_FLOW_VERSIONS))) + .addMethod( + getGetTensorFlowVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest, + com.google.cloud.tpu.v1.TensorFlowVersion>( + this, METHODID_GET_TENSOR_FLOW_VERSION))) + .addMethod( + getListAcceleratorTypesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest, + com.google.cloud.tpu.v1.ListAcceleratorTypesResponse>( + this, METHODID_LIST_ACCELERATOR_TYPES))) + .addMethod( + getGetAcceleratorTypeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest, + com.google.cloud.tpu.v1.AcceleratorType>( + this, METHODID_GET_ACCELERATOR_TYPE))) + .build(); + } + } + + /** + * + * + *
+   * Manages TPU nodes and other resources
+   * TPU API v1
+   * 
+ */ + public static final class TpuStub extends io.grpc.stub.AbstractAsyncStub { + private TpuStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TpuStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TpuStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists nodes.
+     * 
+ */ + public void listNodes( + com.google.cloud.tpu.v1.ListNodesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListNodesMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Gets the details of a node.
+     * 
+ */ + public void getNode( + com.google.cloud.tpu.v1.GetNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetNodeMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a node.
+     * 
+ */ + public void createNode( + com.google.cloud.tpu.v1.CreateNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateNodeMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Deletes a node.
+     * 
+ */ + public void deleteNode( + com.google.cloud.tpu.v1.DeleteNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteNodeMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Reimages a node's OS.
+     * 
+ */ + public void reimageNode( + com.google.cloud.tpu.v1.ReimageNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getReimageNodeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Stops a node.
+     * 
+ */ + public void stopNode( + com.google.cloud.tpu.v1.StopNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getStopNodeMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Starts a node.
+     * 
+ */ + public void startNode( + com.google.cloud.tpu.v1.StartNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getStartNodeMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * List TensorFlow versions supported by this API.
+     * 
+ */ + public void listTensorFlowVersions( + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListTensorFlowVersionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets TensorFlow Version.
+     * 
+ */ + public void getTensorFlowVersion( + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetTensorFlowVersionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists accelerator types supported by this API.
+     * 
+ */ + public void listAcceleratorTypes( + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListAcceleratorTypesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets AcceleratorType.
+     * 
+ */ + public void getAcceleratorType( + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetAcceleratorTypeMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Manages TPU nodes and other resources
+   * TPU API v1
+   * 
+ */ + public static final class TpuBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private TpuBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TpuBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TpuBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists nodes.
+     * 
+ */ + public com.google.cloud.tpu.v1.ListNodesResponse listNodes( + com.google.cloud.tpu.v1.ListNodesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListNodesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the details of a node.
+     * 
+ */ + public com.google.cloud.tpu.v1.Node getNode(com.google.cloud.tpu.v1.GetNodeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetNodeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a node.
+     * 
+ */ + public com.google.longrunning.Operation createNode( + com.google.cloud.tpu.v1.CreateNodeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateNodeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a node.
+     * 
+ */ + public com.google.longrunning.Operation deleteNode( + com.google.cloud.tpu.v1.DeleteNodeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteNodeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Reimages a node's OS.
+     * 
+ */ + public com.google.longrunning.Operation reimageNode( + com.google.cloud.tpu.v1.ReimageNodeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getReimageNodeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Stops a node.
+     * 
+ */ + public com.google.longrunning.Operation stopNode( + com.google.cloud.tpu.v1.StopNodeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getStopNodeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Starts a node.
+     * 
+ */ + public com.google.longrunning.Operation startNode( + com.google.cloud.tpu.v1.StartNodeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getStartNodeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List TensorFlow versions supported by this API.
+     * 
+ */ + public com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse listTensorFlowVersions( + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListTensorFlowVersionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets TensorFlow Version.
+     * 
+ */ + public com.google.cloud.tpu.v1.TensorFlowVersion getTensorFlowVersion( + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetTensorFlowVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists accelerator types supported by this API.
+     * 
+ */ + public com.google.cloud.tpu.v1.ListAcceleratorTypesResponse listAcceleratorTypes( + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListAcceleratorTypesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets AcceleratorType.
+     * 
+ */ + public com.google.cloud.tpu.v1.AcceleratorType getAcceleratorType( + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetAcceleratorTypeMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Manages TPU nodes and other resources
+   * TPU API v1
+   * 
+ */ + public static final class TpuFutureStub extends io.grpc.stub.AbstractFutureStub { + private TpuFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TpuFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TpuFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists nodes.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.tpu.v1.ListNodesResponse> + listNodes(com.google.cloud.tpu.v1.ListNodesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListNodesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the details of a node.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getNode( + com.google.cloud.tpu.v1.GetNodeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetNodeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a node.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createNode(com.google.cloud.tpu.v1.CreateNodeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateNodeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a node.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteNode(com.google.cloud.tpu.v1.DeleteNodeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteNodeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Reimages a node's OS.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + reimageNode(com.google.cloud.tpu.v1.ReimageNodeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getReimageNodeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Stops a node.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + stopNode(com.google.cloud.tpu.v1.StopNodeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getStopNodeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Starts a node.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + startNode(com.google.cloud.tpu.v1.StartNodeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getStartNodeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List TensorFlow versions supported by this API.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse> + listTensorFlowVersions(com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListTensorFlowVersionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets TensorFlow Version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.tpu.v1.TensorFlowVersion> + getTensorFlowVersion(com.google.cloud.tpu.v1.GetTensorFlowVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetTensorFlowVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists accelerator types supported by this API.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.tpu.v1.ListAcceleratorTypesResponse> + listAcceleratorTypes(com.google.cloud.tpu.v1.ListAcceleratorTypesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListAcceleratorTypesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets AcceleratorType.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.tpu.v1.AcceleratorType> + getAcceleratorType(com.google.cloud.tpu.v1.GetAcceleratorTypeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetAcceleratorTypeMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_NODES = 0; + private static final int METHODID_GET_NODE = 1; + private static final int METHODID_CREATE_NODE = 2; + private static final int METHODID_DELETE_NODE = 3; + private static final int METHODID_REIMAGE_NODE = 4; + private static final int METHODID_STOP_NODE = 5; + private static final int METHODID_START_NODE = 6; + private static final int METHODID_LIST_TENSOR_FLOW_VERSIONS = 7; + private static final int METHODID_GET_TENSOR_FLOW_VERSION = 8; + private static final int METHODID_LIST_ACCELERATOR_TYPES = 9; + private static final int METHODID_GET_ACCELERATOR_TYPE = 10; + + 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 TpuImplBase serviceImpl; + private final int methodId; + + MethodHandlers(TpuImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_NODES: + serviceImpl.listNodes( + (com.google.cloud.tpu.v1.ListNodesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_NODE: + serviceImpl.getNode( + (com.google.cloud.tpu.v1.GetNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_NODE: + serviceImpl.createNode( + (com.google.cloud.tpu.v1.CreateNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_NODE: + serviceImpl.deleteNode( + (com.google.cloud.tpu.v1.DeleteNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REIMAGE_NODE: + serviceImpl.reimageNode( + (com.google.cloud.tpu.v1.ReimageNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_STOP_NODE: + serviceImpl.stopNode( + (com.google.cloud.tpu.v1.StopNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_START_NODE: + serviceImpl.startNode( + (com.google.cloud.tpu.v1.StartNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_TENSOR_FLOW_VERSIONS: + serviceImpl.listTensorFlowVersions( + (com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_TENSOR_FLOW_VERSION: + serviceImpl.getTensorFlowVersion( + (com.google.cloud.tpu.v1.GetTensorFlowVersionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_ACCELERATOR_TYPES: + serviceImpl.listAcceleratorTypes( + (com.google.cloud.tpu.v1.ListAcceleratorTypesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_ACCELERATOR_TYPE: + serviceImpl.getAcceleratorType( + (com.google.cloud.tpu.v1.GetAcceleratorTypeRequest) 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 TpuBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + TpuBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Tpu"); + } + } + + private static final class TpuFileDescriptorSupplier extends TpuBaseDescriptorSupplier { + TpuFileDescriptorSupplier() {} + } + + private static final class TpuMethodDescriptorSupplier extends TpuBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + TpuMethodDescriptorSupplier(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 (TpuGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new TpuFileDescriptorSupplier()) + .addMethod(getListNodesMethod()) + .addMethod(getGetNodeMethod()) + .addMethod(getCreateNodeMethod()) + .addMethod(getDeleteNodeMethod()) + .addMethod(getReimageNodeMethod()) + .addMethod(getStopNodeMethod()) + .addMethod(getStartNodeMethod()) + .addMethod(getListTensorFlowVersionsMethod()) + .addMethod(getGetTensorFlowVersionMethod()) + .addMethod(getListAcceleratorTypesMethod()) + .addMethod(getGetAcceleratorTypeMethod()) + .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..5c27571c --- /dev/null +++ b/pom.xml @@ -0,0 +1,179 @@ + + + 4.0.0 + com.google.cloud + google-cloud-tpu-parent + pom + 0.0.1-SNAPSHOT + Google Cloud TPU Parent + https://github.com/googleapis/java-tpu + + 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-tpu.git + scm:git:git@github.com:googleapis/java-tpu.git + https://github.com/googleapis/java-tpu + HEAD + + + https://github.com/googleapis/java-tpu/issues + GitHub Issues + + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + UTF-8 + UTF-8 + github + google-cloud-tpu-parent + + + + + + com.google.cloud + google-cloud-tpu + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-tpu-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-tpu-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-tpu + grpc-google-cloud-tpu-v1 + proto-google-cloud-tpu-v1 + google-cloud-tpu-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-tpu-v1/clirr-ignored-differences.xml b/proto-google-cloud-tpu-v1/clirr-ignored-differences.xml new file mode 100644 index 00000000..c2906487 --- /dev/null +++ b/proto-google-cloud-tpu-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/tpu/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/tpu/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/tpu/v1/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-tpu-v1/pom.xml b/proto-google-cloud-tpu-v1/pom.xml new file mode 100644 index 00000000..6ab12b0f --- /dev/null +++ b/proto-google-cloud-tpu-v1/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-tpu-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-tpu-v1 + Proto library for google-cloud-tpu + + com.google.cloud + google-cloud-tpu-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-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorType.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorType.java new file mode 100644 index 00000000..f7b0fa47 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorType.java @@ -0,0 +1,812 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + * + * + *
+ * A accelerator type that a Node can be configured with.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.AcceleratorType} + */ +public final class AcceleratorType extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.AcceleratorType) + AcceleratorTypeOrBuilder { + private static final long serialVersionUID = 0L; + // Use AcceleratorType.newBuilder() to construct. + private AcceleratorType(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AcceleratorType() { + name_ = ""; + type_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AcceleratorType(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AcceleratorType( + 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(); + + type_ = 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.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_AcceleratorType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_AcceleratorType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.AcceleratorType.class, + com.google.cloud.tpu.v1.AcceleratorType.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * The resource name.
+   * 
+ * + * 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 TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object type_; + /** + * + * + *
+   * the accelerator type.
+   * 
+ * + * string type = 2; + * + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + 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(); + type_ = s; + return s; + } + } + /** + * + * + *
+   * the accelerator type.
+   * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); + } + 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 (!getTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); + } + 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.tpu.v1.AcceleratorType)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.AcceleratorType other = (com.google.cloud.tpu.v1.AcceleratorType) obj; + + if (!getName().equals(other.getName())) return false; + if (!getType().equals(other.getType())) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.AcceleratorType parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.AcceleratorType 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.tpu.v1.AcceleratorType parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.AcceleratorType 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.tpu.v1.AcceleratorType parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.AcceleratorType parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.AcceleratorType parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.AcceleratorType 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.tpu.v1.AcceleratorType parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.AcceleratorType 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.tpu.v1.AcceleratorType parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.AcceleratorType 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.tpu.v1.AcceleratorType 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 accelerator type that a Node can be configured with.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.AcceleratorType} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.AcceleratorType) + com.google.cloud.tpu.v1.AcceleratorTypeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_AcceleratorType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_AcceleratorType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.AcceleratorType.class, + com.google.cloud.tpu.v1.AcceleratorType.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.AcceleratorType.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_ = ""; + + type_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_AcceleratorType_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.AcceleratorType getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.AcceleratorType.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.AcceleratorType build() { + com.google.cloud.tpu.v1.AcceleratorType result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.AcceleratorType buildPartial() { + com.google.cloud.tpu.v1.AcceleratorType result = + new com.google.cloud.tpu.v1.AcceleratorType(this); + result.name_ = name_; + result.type_ = type_; + 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.tpu.v1.AcceleratorType) { + return mergeFrom((com.google.cloud.tpu.v1.AcceleratorType) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.AcceleratorType other) { + if (other == com.google.cloud.tpu.v1.AcceleratorType.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + 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.tpu.v1.AcceleratorType parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.AcceleratorType) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name.
+     * 
+ * + * 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 type_ = ""; + /** + * + * + *
+     * the accelerator type.
+     * 
+ * + * string type = 2; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * the accelerator type.
+     * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * the accelerator type.
+     * 
+ * + * string type = 2; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * the accelerator type.
+     * 
+ * + * string type = 2; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+     * the accelerator type.
+     * 
+ * + * string type = 2; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = 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.tpu.v1.AcceleratorType) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.AcceleratorType) + private static final com.google.cloud.tpu.v1.AcceleratorType DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.AcceleratorType(); + } + + public static com.google.cloud.tpu.v1.AcceleratorType getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AcceleratorType parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AcceleratorType(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.tpu.v1.AcceleratorType getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorTypeName.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorTypeName.java new file mode 100644 index 00000000..d3e01e5e --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorTypeName.java @@ -0,0 +1,227 @@ +/* + * 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.tpu.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 AcceleratorTypeName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_ACCELERATOR_TYPE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/acceleratorTypes/{accelerator_type}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String acceleratorType; + + @Deprecated + protected AcceleratorTypeName() { + project = null; + location = null; + acceleratorType = null; + } + + private AcceleratorTypeName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + acceleratorType = Preconditions.checkNotNull(builder.getAcceleratorType()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAcceleratorType() { + return acceleratorType; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static AcceleratorTypeName of(String project, String location, String acceleratorType) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAcceleratorType(acceleratorType) + .build(); + } + + public static String format(String project, String location, String acceleratorType) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAcceleratorType(acceleratorType) + .build() + .toString(); + } + + public static AcceleratorTypeName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_ACCELERATOR_TYPE.validatedMatch( + formattedString, "AcceleratorTypeName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("accelerator_type")); + } + + 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 (AcceleratorTypeName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_ACCELERATOR_TYPE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (acceleratorType != null) { + fieldMapBuilder.put("accelerator_type", acceleratorType); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_ACCELERATOR_TYPE.instantiate( + "project", project, "location", location, "accelerator_type", acceleratorType); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + AcceleratorTypeName that = ((AcceleratorTypeName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.acceleratorType, that.acceleratorType); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(acceleratorType); + return h; + } + + /** Builder for projects/{project}/locations/{location}/acceleratorTypes/{accelerator_type}. */ + public static class Builder { + private String project; + private String location; + private String acceleratorType; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAcceleratorType() { + return acceleratorType; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setAcceleratorType(String acceleratorType) { + this.acceleratorType = acceleratorType; + return this; + } + + private Builder(AcceleratorTypeName acceleratorTypeName) { + project = acceleratorTypeName.project; + location = acceleratorTypeName.location; + acceleratorType = acceleratorTypeName.acceleratorType; + } + + public AcceleratorTypeName build() { + return new AcceleratorTypeName(this); + } + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorTypeOrBuilder.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorTypeOrBuilder.java new file mode 100644 index 00000000..d9a66a85 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorTypeOrBuilder.java @@ -0,0 +1,75 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface AcceleratorTypeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.AcceleratorType) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * the accelerator type.
+   * 
+ * + * string type = 2; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * the accelerator type.
+   * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CloudTpuProto.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CloudTpuProto.java new file mode 100644 index 00000000..f6a47cfd --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CloudTpuProto.java @@ -0,0 +1,513 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public final class CloudTpuProto { + private CloudTpuProto() {} + + 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_tpu_v1_SchedulingConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_SchedulingConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_NetworkEndpoint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_NetworkEndpoint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_Node_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_Node_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_Node_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_Node_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_ListNodesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_ListNodesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_ListNodesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_ListNodesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_GetNodeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_GetNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_CreateNodeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_CreateNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_DeleteNodeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_DeleteNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_ReimageNodeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_ReimageNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_StopNodeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_StopNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_StartNodeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_StartNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_TensorFlowVersion_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_TensorFlowVersion_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_GetTensorFlowVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_GetTensorFlowVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_AcceleratorType_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_AcceleratorType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_GetAcceleratorTypeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_GetAcceleratorTypeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_ListAcceleratorTypesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_ListAcceleratorTypesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_ListAcceleratorTypesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_ListAcceleratorTypesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_OperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_Symptom_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_Symptom_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/tpu/v1/cloud_tpu.proto\022\023g" + + "oogle.cloud.tpu.v1\032\034google/api/annotatio" + + "ns.proto\032\027google/api/client.proto\032\037googl" + + "e/api/field_behavior.proto\032\031google/api/r" + + "esource.proto\032#google/longrunning/operat" + + "ions.proto\032\037google/protobuf/timestamp.pr" + + "oto\"9\n\020SchedulingConfig\022\023\n\013preemptible\030\001" + + " \001(\010\022\020\n\010reserved\030\002 \001(\010\"3\n\017NetworkEndpoin" + + "t\022\022\n\nip_address\030\001 \001(\t\022\014\n\004port\030\002 \001(\005\"\264\n\n\004" + + "Node\022\024\n\004name\030\001 \001(\tB\006\340A\005\340A\003\022\023\n\013descriptio" + + "n\030\003 \001(\t\022\035\n\020accelerator_type\030\005 \001(\tB\003\340A\002\022\026" + + "\n\nip_address\030\010 \001(\tB\002\030\001\022\020\n\004port\030\016 \001(\tB\002\030\001" + + "\0223\n\005state\030\t \001(\0162\037.google.cloud.tpu.v1.No" + + "de.StateB\003\340A\003\022\037\n\022health_description\030\n \001(" + + "\tB\003\340A\003\022\037\n\022tensorflow_version\030\013 \001(\tB\003\340A\002\022" + + "\017\n\007network\030\014 \001(\t\022\022\n\ncidr_block\030\r \001(\t\022\034\n\017" + + "service_account\030\017 \001(\tB\003\340A\003\0224\n\013create_tim" + + "e\030\020 \001(\0132\032.google.protobuf.TimestampB\003\340A\003" + + "\022@\n\021scheduling_config\030\021 \001(\0132%.google.clo" + + "ud.tpu.v1.SchedulingConfig\022D\n\021network_en" + + "dpoints\030\025 \003(\0132$.google.cloud.tpu.v1.Netw" + + "orkEndpointB\003\340A\003\0220\n\006health\030\026 \001(\0162 .googl" + + "e.cloud.tpu.v1.Node.Health\0225\n\006labels\030\030 \003" + + "(\0132%.google.cloud.tpu.v1.Node.LabelsEntr" + + "y\022\036\n\026use_service_networking\030\033 \001(\010\022>\n\013api" + + "_version\030& \001(\0162$.google.cloud.tpu.v1.Nod" + + "e.ApiVersionB\003\340A\003\0223\n\010symptoms\030\' \003(\0132\034.go" + + "ogle.cloud.tpu.v1.SymptomB\003\340A\003\032-\n\013Labels" + + "Entry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\341\001" + + "\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\014\n\010CREATI" + + "NG\020\001\022\t\n\005READY\020\002\022\016\n\nRESTARTING\020\003\022\r\n\tREIMA" + + "GING\020\004\022\014\n\010DELETING\020\005\022\r\n\tREPAIRING\020\006\022\013\n\007S" + + "TOPPED\020\010\022\014\n\010STOPPING\020\t\022\014\n\010STARTING\020\n\022\r\n\t" + + "PREEMPTED\020\013\022\016\n\nTERMINATED\020\014\022\n\n\006HIDING\020\r\022" + + "\n\n\006HIDDEN\020\016\022\014\n\010UNHIDING\020\017\"\211\001\n\006Health\022\026\n\022" + + "HEALTH_UNSPECIFIED\020\000\022\013\n\007HEALTHY\020\001\022\030\n\024DEP" + + "RECATED_UNHEALTHY\020\002\022\013\n\007TIMEOUT\020\003\022\030\n\024UNHE" + + "ALTHY_TENSORFLOW\020\004\022\031\n\025UNHEALTHY_MAINTENA" + + "NCE\020\005\"O\n\nApiVersion\022\033\n\027API_VERSION_UNSPE" + + "CIFIED\020\000\022\r\n\tV1_ALPHA1\020\001\022\006\n\002V1\020\002\022\r\n\tV2_AL" + + "PHA1\020\003:R\352AO\n\027tpu.googleapis.com/Node\0224pr" + + "ojects/{project}/locations/{location}/no" + + "des/{node}\"j\n\020ListNodesRequest\022/\n\006parent" + + "\030\001 \001(\tB\037\340A\002\372A\031\022\027tpu.googleapis.com/Node\022" + + "\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"k" + + "\n\021ListNodesResponse\022(\n\005nodes\030\001 \003(\0132\031.goo" + + "gle.cloud.tpu.v1.Node\022\027\n\017next_page_token" + + "\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"?\n\016GetNodeRe" + + "quest\022-\n\004name\030\001 \001(\tB\037\340A\002\372A\031\n\027tpu.googlea" + + "pis.com/Node\"\203\001\n\021CreateNodeRequest\022/\n\006pa" + + "rent\030\001 \001(\tB\037\340A\002\372A\031\022\027tpu.googleapis.com/N" + + "ode\022\017\n\007node_id\030\002 \001(\t\022,\n\004node\030\003 \001(\0132\031.goo" + + "gle.cloud.tpu.v1.NodeB\003\340A\002\"B\n\021DeleteNode" + + "Request\022-\n\004name\030\001 \001(\tB\037\340A\002\372A\031\n\027tpu.googl" + + "eapis.com/Node\">\n\022ReimageNodeRequest\022\014\n\004" + + "name\030\001 \001(\t\022\032\n\022tensorflow_version\030\002 \001(\t\"\037" + + "\n\017StopNodeRequest\022\014\n\004name\030\001 \001(\t\" \n\020Start" + + "NodeRequest\022\014\n\004name\030\001 \001(\t\"\257\001\n\021TensorFlow" + + "Version\022\014\n\004name\030\001 \001(\t\022\017\n\007version\030\002 \001(\t:{" + + "\352Ax\n$tpu.googleapis.com/TensorFlowVersio" + + "n\022Pprojects/{project}/locations/{locatio" + + "n}/tensorFlowVersions/{tensor_flow_versi" + + "on}\"Y\n\033GetTensorFlowVersionRequest\022:\n\004na" + + "me\030\001 \001(\tB,\340A\002\372A&\n$tpu.googleapis.com/Ten" + + "sorFlowVersion\"\246\001\n\035ListTensorFlowVersion" + + "sRequest\022<\n\006parent\030\001 \001(\tB,\340A\002\372A&\n$tpu.go" + + "ogleapis.com/TensorFlowVersion\022\021\n\tpage_s" + + "ize\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n\006filter\030" + + "\005 \001(\t\022\020\n\010order_by\030\006 \001(\t\"\223\001\n\036ListTensorFl" + + "owVersionsResponse\022C\n\023tensorflow_version" + + "s\030\001 \003(\0132&.google.cloud.tpu.v1.TensorFlow" + + "Version\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unre" + + "achable\030\003 \003(\t\"\243\001\n\017AcceleratorType\022\014\n\004nam" + + "e\030\001 \001(\t\022\014\n\004type\030\002 \001(\t:t\352Aq\n\"tpu.googleap" + + "is.com/AcceleratorType\022Kprojects/{projec" + + "t}/locations/{location}/acceleratorTypes" + + "/{accelerator_type}\"U\n\031GetAcceleratorTyp" + + "eRequest\0228\n\004name\030\001 \001(\tB*\340A\002\372A$\n\"tpu.goog" + + "leapis.com/AcceleratorType\"\242\001\n\033ListAccel" + + "eratorTypesRequest\022:\n\006parent\030\001 \001(\tB*\340A\002\372" + + "A$\n\"tpu.googleapis.com/AcceleratorType\022\021" + + "\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n" + + "\006filter\030\005 \001(\t\022\020\n\010order_by\030\006 \001(\t\"\215\001\n\034List" + + "AcceleratorTypesResponse\022?\n\021accelerator_" + + "types\030\001 \003(\0132$.google.cloud.tpu.v1.Accele" + + "ratorType\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013un" + + "reachable\030\003 \003(\t\"\326\001\n\021OperationMetadata\022/\n" + + "\013create_time\030\001 \001(\0132\032.google.protobuf.Tim" + + "estamp\022,\n\010end_time\030\002 \001(\0132\032.google.protob" + + "uf.Timestamp\022\016\n\006target\030\003 \001(\t\022\014\n\004verb\030\004 \001" + + "(\t\022\025\n\rstatus_detail\030\005 \001(\t\022\030\n\020cancel_requ" + + "ested\030\006 \001(\010\022\023\n\013api_version\030\007 \001(\t\"\305\002\n\007Sym" + + "ptom\022/\n\013create_time\030\001 \001(\0132\032.google.proto" + + "buf.Timestamp\022>\n\014symptom_type\030\002 \001(\0162(.go" + + "ogle.cloud.tpu.v1.Symptom.SymptomType\022\017\n" + + "\007details\030\003 \001(\t\022\021\n\tworker_id\030\004 \001(\t\"\244\001\n\013Sy" + + "mptomType\022\034\n\030SYMPTOM_TYPE_UNSPECIFIED\020\000\022" + + "\016\n\nLOW_MEMORY\020\001\022\021\n\rOUT_OF_MEMORY\020\002\022\025\n\021EX" + + "ECUTE_TIMED_OUT\020\003\022\023\n\017MESH_BUILD_FAIL\020\004\022\025" + + "\n\021HBM_OUT_OF_MEMORY\020\005\022\021\n\rPROJECT_ABUSE\020\006" + + "2\336\017\n\003Tpu\022\226\001\n\tListNodes\022%.google.cloud.tp" + + "u.v1.ListNodesRequest\032&.google.cloud.tpu" + + ".v1.ListNodesResponse\":\202\323\344\223\002+\022)/v1/{pare" + + "nt=projects/*/locations/*}/nodes\332A\006paren" + + "t\022\203\001\n\007GetNode\022#.google.cloud.tpu.v1.GetN" + + "odeRequest\032\031.google.cloud.tpu.v1.Node\"8\202" + + "\323\344\223\002+\022)/v1/{name=projects/*/locations/*/" + + "nodes/*}\332A\004name\022\276\001\n\nCreateNode\022&.google." + + "cloud.tpu.v1.CreateNodeRequest\032\035.google." + + "longrunning.Operation\"i\202\323\344\223\0021\")/v1/{pare" + + "nt=projects/*/locations/*}/nodes:\004node\332A" + + "\023parent,node,node_id\312A\031\n\004Node\022\021Operation" + + "Metadata\022\251\001\n\nDeleteNode\022&.google.cloud.t" + + "pu.v1.DeleteNodeRequest\032\035.google.longrun" + + "ning.Operation\"T\202\323\344\223\002+*)/v1/{name=projec" + + "ts/*/locations/*/nodes/*}\332A\004name\312A\031\n\004Nod" + + "e\022\021OperationMetadata\022\257\001\n\013ReimageNode\022\'.g" + + "oogle.cloud.tpu.v1.ReimageNodeRequest\032\035." + + "google.longrunning.Operation\"X\202\323\344\223\0026\"1/v" + + "1/{name=projects/*/locations/*/nodes/*}:" + + "reimage:\001*\312A\031\n\004Node\022\021OperationMetadata\022\246" + + "\001\n\010StopNode\022$.google.cloud.tpu.v1.StopNo" + + "deRequest\032\035.google.longrunning.Operation" + + "\"U\202\323\344\223\0023\"./v1/{name=projects/*/locations" + + "/*/nodes/*}:stop:\001*\312A\031\n\004Node\022\021OperationM" + + "etadata\022\251\001\n\tStartNode\022%.google.cloud.tpu" + + ".v1.StartNodeRequest\032\035.google.longrunnin" + + "g.Operation\"V\202\323\344\223\0024\"//v1/{name=projects/" + + "*/locations/*/nodes/*}:start:\001*\312A\031\n\004Node" + + "\022\021OperationMetadata\022\312\001\n\026ListTensorFlowVe" + + "rsions\0222.google.cloud.tpu.v1.ListTensorF" + + "lowVersionsRequest\0323.google.cloud.tpu.v1" + + ".ListTensorFlowVersionsResponse\"G\202\323\344\223\0028\022" + + "6/v1/{parent=projects/*/locations/*}/ten" + + "sorflowVersions\332A\006parent\022\267\001\n\024GetTensorFl" + + "owVersion\0220.google.cloud.tpu.v1.GetTenso" + + "rFlowVersionRequest\032&.google.cloud.tpu.v" + + "1.TensorFlowVersion\"E\202\323\344\223\0028\0226/v1/{name=p" + + "rojects/*/locations/*/tensorflowVersions" + + "/*}\332A\004name\022\302\001\n\024ListAcceleratorTypes\0220.go" + + "ogle.cloud.tpu.v1.ListAcceleratorTypesRe" + + "quest\0321.google.cloud.tpu.v1.ListAccelera" + + "torTypesResponse\"E\202\323\344\223\0026\0224/v1/{parent=pr" + + "ojects/*/locations/*}/acceleratorTypes\332A" + + "\006parent\022\257\001\n\022GetAcceleratorType\022..google." + + "cloud.tpu.v1.GetAcceleratorTypeRequest\032$" + + ".google.cloud.tpu.v1.AcceleratorType\"C\202\323" + + "\344\223\0026\0224/v1/{name=projects/*/locations/*/a" + + "cceleratorTypes/*}\332A\004name\032F\312A\022tpu.google" + + "apis.com\322A.https://www.googleapis.com/au" + + "th/cloud-platformBb\n\027com.google.cloud.tp" + + "u.v1B\rCloudTpuProtoP\001Z6google.golang.org" + + "/genproto/googleapis/cloud/tpu/v1;tpub\006p" + + "roto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_tpu_v1_SchedulingConfig_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_tpu_v1_SchedulingConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_SchedulingConfig_descriptor, + new java.lang.String[] { + "Preemptible", "Reserved", + }); + internal_static_google_cloud_tpu_v1_NetworkEndpoint_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_tpu_v1_NetworkEndpoint_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_NetworkEndpoint_descriptor, + new java.lang.String[] { + "IpAddress", "Port", + }); + internal_static_google_cloud_tpu_v1_Node_descriptor = getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_tpu_v1_Node_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_Node_descriptor, + new java.lang.String[] { + "Name", + "Description", + "AcceleratorType", + "IpAddress", + "Port", + "State", + "HealthDescription", + "TensorflowVersion", + "Network", + "CidrBlock", + "ServiceAccount", + "CreateTime", + "SchedulingConfig", + "NetworkEndpoints", + "Health", + "Labels", + "UseServiceNetworking", + "ApiVersion", + "Symptoms", + }); + internal_static_google_cloud_tpu_v1_Node_LabelsEntry_descriptor = + internal_static_google_cloud_tpu_v1_Node_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_tpu_v1_Node_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_Node_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_tpu_v1_ListNodesRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_tpu_v1_ListNodesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_ListNodesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_tpu_v1_ListNodesResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_tpu_v1_ListNodesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_ListNodesResponse_descriptor, + new java.lang.String[] { + "Nodes", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_tpu_v1_GetNodeRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_tpu_v1_GetNodeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_GetNodeRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_tpu_v1_CreateNodeRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_tpu_v1_CreateNodeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_CreateNodeRequest_descriptor, + new java.lang.String[] { + "Parent", "NodeId", "Node", + }); + internal_static_google_cloud_tpu_v1_DeleteNodeRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_tpu_v1_DeleteNodeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_DeleteNodeRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_tpu_v1_ReimageNodeRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_tpu_v1_ReimageNodeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_ReimageNodeRequest_descriptor, + new java.lang.String[] { + "Name", "TensorflowVersion", + }); + internal_static_google_cloud_tpu_v1_StopNodeRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_tpu_v1_StopNodeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_StopNodeRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_tpu_v1_StartNodeRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_tpu_v1_StartNodeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_StartNodeRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_tpu_v1_TensorFlowVersion_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_tpu_v1_TensorFlowVersion_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_TensorFlowVersion_descriptor, + new java.lang.String[] { + "Name", "Version", + }); + internal_static_google_cloud_tpu_v1_GetTensorFlowVersionRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_tpu_v1_GetTensorFlowVersionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_GetTensorFlowVersionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsResponse_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsResponse_descriptor, + new java.lang.String[] { + "TensorflowVersions", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_tpu_v1_AcceleratorType_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_tpu_v1_AcceleratorType_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_AcceleratorType_descriptor, + new java.lang.String[] { + "Name", "Type", + }); + internal_static_google_cloud_tpu_v1_GetAcceleratorTypeRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_tpu_v1_GetAcceleratorTypeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_GetAcceleratorTypeRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_tpu_v1_ListAcceleratorTypesRequest_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_tpu_v1_ListAcceleratorTypesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_ListAcceleratorTypesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_tpu_v1_ListAcceleratorTypesResponse_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_tpu_v1_ListAcceleratorTypesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_ListAcceleratorTypesResponse_descriptor, + new java.lang.String[] { + "AcceleratorTypes", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_tpu_v1_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_tpu_v1_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_OperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusDetail", + "CancelRequested", + "ApiVersion", + }); + internal_static_google_cloud_tpu_v1_Symptom_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_tpu_v1_Symptom_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_Symptom_descriptor, + new java.lang.String[] { + "CreateTime", "SymptomType", "Details", "WorkerId", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CreateNodeRequest.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CreateNodeRequest.java new file mode 100644 index 00000000..ee8ae46d --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CreateNodeRequest.java @@ -0,0 +1,1093 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + * + * + *
+ * Request for [CreateNode][google.cloud.tpu.v1.Tpu.CreateNode].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.CreateNodeRequest} + */ +public final class CreateNodeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.CreateNodeRequest) + CreateNodeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateNodeRequest.newBuilder() to construct. + private CreateNodeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateNodeRequest() { + parent_ = ""; + nodeId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateNodeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateNodeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nodeId_ = s; + break; + } + case 26: + { + com.google.cloud.tpu.v1.Node.Builder subBuilder = null; + if (node_ != null) { + subBuilder = node_.toBuilder(); + } + node_ = input.readMessage(com.google.cloud.tpu.v1.Node.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(node_); + node_ = 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.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_CreateNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_CreateNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.CreateNodeRequest.class, + com.google.cloud.tpu.v1.CreateNodeRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NODE_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object nodeId_; + /** + * + * + *
+   * The unqualified resource name.
+   * 
+ * + * string node_id = 2; + * + * @return The nodeId. + */ + @java.lang.Override + public java.lang.String getNodeId() { + java.lang.Object ref = nodeId_; + 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(); + nodeId_ = s; + return s; + } + } + /** + * + * + *
+   * The unqualified resource name.
+   * 
+ * + * string node_id = 2; + * + * @return The bytes for nodeId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNodeIdBytes() { + java.lang.Object ref = nodeId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nodeId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NODE_FIELD_NUMBER = 3; + private com.google.cloud.tpu.v1.Node node_; + /** + * + * + *
+   * Required. The node.
+   * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the node field is set. + */ + @java.lang.Override + public boolean hasNode() { + return node_ != null; + } + /** + * + * + *
+   * Required. The node.
+   * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The node. + */ + @java.lang.Override + public com.google.cloud.tpu.v1.Node getNode() { + return node_ == null ? com.google.cloud.tpu.v1.Node.getDefaultInstance() : node_; + } + /** + * + * + *
+   * Required. The node.
+   * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.tpu.v1.NodeOrBuilder getNodeOrBuilder() { + return getNode(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getNodeIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nodeId_); + } + if (node_ != null) { + output.writeMessage(3, getNode()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getNodeIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nodeId_); + } + if (node_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getNode()); + } + 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.tpu.v1.CreateNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.CreateNodeRequest other = + (com.google.cloud.tpu.v1.CreateNodeRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getNodeId().equals(other.getNodeId())) return false; + if (hasNode() != other.hasNode()) return false; + if (hasNode()) { + if (!getNode().equals(other.getNode())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + NODE_ID_FIELD_NUMBER; + hash = (53 * hash) + getNodeId().hashCode(); + if (hasNode()) { + hash = (37 * hash) + NODE_FIELD_NUMBER; + hash = (53 * hash) + getNode().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.CreateNodeRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.CreateNodeRequest 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.tpu.v1.CreateNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.CreateNodeRequest 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.tpu.v1.CreateNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.CreateNodeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.CreateNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.CreateNodeRequest 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.tpu.v1.CreateNodeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.CreateNodeRequest 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.tpu.v1.CreateNodeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.CreateNodeRequest 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.tpu.v1.CreateNodeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for [CreateNode][google.cloud.tpu.v1.Tpu.CreateNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.CreateNodeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.CreateNodeRequest) + com.google.cloud.tpu.v1.CreateNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_CreateNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_CreateNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.CreateNodeRequest.class, + com.google.cloud.tpu.v1.CreateNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.CreateNodeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + nodeId_ = ""; + + if (nodeBuilder_ == null) { + node_ = null; + } else { + node_ = null; + nodeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_CreateNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.CreateNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.CreateNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.CreateNodeRequest build() { + com.google.cloud.tpu.v1.CreateNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.CreateNodeRequest buildPartial() { + com.google.cloud.tpu.v1.CreateNodeRequest result = + new com.google.cloud.tpu.v1.CreateNodeRequest(this); + result.parent_ = parent_; + result.nodeId_ = nodeId_; + if (nodeBuilder_ == null) { + result.node_ = node_; + } else { + result.node_ = nodeBuilder_.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.tpu.v1.CreateNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v1.CreateNodeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.CreateNodeRequest other) { + if (other == com.google.cloud.tpu.v1.CreateNodeRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getNodeId().isEmpty()) { + nodeId_ = other.nodeId_; + onChanged(); + } + if (other.hasNode()) { + mergeNode(other.getNode()); + } + 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.tpu.v1.CreateNodeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.CreateNodeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object nodeId_ = ""; + /** + * + * + *
+     * The unqualified resource name.
+     * 
+ * + * string node_id = 2; + * + * @return The nodeId. + */ + public java.lang.String getNodeId() { + java.lang.Object ref = nodeId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nodeId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The unqualified resource name.
+     * 
+ * + * string node_id = 2; + * + * @return The bytes for nodeId. + */ + public com.google.protobuf.ByteString getNodeIdBytes() { + java.lang.Object ref = nodeId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nodeId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The unqualified resource name.
+     * 
+ * + * string node_id = 2; + * + * @param value The nodeId to set. + * @return This builder for chaining. + */ + public Builder setNodeId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nodeId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The unqualified resource name.
+     * 
+ * + * string node_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearNodeId() { + + nodeId_ = getDefaultInstance().getNodeId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The unqualified resource name.
+     * 
+ * + * string node_id = 2; + * + * @param value The bytes for nodeId to set. + * @return This builder for chaining. + */ + public Builder setNodeIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nodeId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.tpu.v1.Node node_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v1.Node, + com.google.cloud.tpu.v1.Node.Builder, + com.google.cloud.tpu.v1.NodeOrBuilder> + nodeBuilder_; + /** + * + * + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the node field is set. + */ + public boolean hasNode() { + return nodeBuilder_ != null || node_ != null; + } + /** + * + * + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The node. + */ + public com.google.cloud.tpu.v1.Node getNode() { + if (nodeBuilder_ == null) { + return node_ == null ? com.google.cloud.tpu.v1.Node.getDefaultInstance() : node_; + } else { + return nodeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setNode(com.google.cloud.tpu.v1.Node value) { + if (nodeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + node_ = value; + onChanged(); + } else { + nodeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setNode(com.google.cloud.tpu.v1.Node.Builder builderForValue) { + if (nodeBuilder_ == null) { + node_ = builderForValue.build(); + onChanged(); + } else { + nodeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeNode(com.google.cloud.tpu.v1.Node value) { + if (nodeBuilder_ == null) { + if (node_ != null) { + node_ = com.google.cloud.tpu.v1.Node.newBuilder(node_).mergeFrom(value).buildPartial(); + } else { + node_ = value; + } + onChanged(); + } else { + nodeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearNode() { + if (nodeBuilder_ == null) { + node_ = null; + onChanged(); + } else { + node_ = null; + nodeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.tpu.v1.Node.Builder getNodeBuilder() { + + onChanged(); + return getNodeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.tpu.v1.NodeOrBuilder getNodeOrBuilder() { + if (nodeBuilder_ != null) { + return nodeBuilder_.getMessageOrBuilder(); + } else { + return node_ == null ? com.google.cloud.tpu.v1.Node.getDefaultInstance() : node_; + } + } + /** + * + * + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v1.Node, + com.google.cloud.tpu.v1.Node.Builder, + com.google.cloud.tpu.v1.NodeOrBuilder> + getNodeFieldBuilder() { + if (nodeBuilder_ == null) { + nodeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v1.Node, + com.google.cloud.tpu.v1.Node.Builder, + com.google.cloud.tpu.v1.NodeOrBuilder>( + getNode(), getParentForChildren(), isClean()); + node_ = null; + } + return nodeBuilder_; + } + + @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.tpu.v1.CreateNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.CreateNodeRequest) + private static final com.google.cloud.tpu.v1.CreateNodeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.CreateNodeRequest(); + } + + public static com.google.cloud.tpu.v1.CreateNodeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateNodeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateNodeRequest(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.tpu.v1.CreateNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CreateNodeRequestOrBuilder.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CreateNodeRequestOrBuilder.java new file mode 100644 index 00000000..2f6aae51 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CreateNodeRequestOrBuilder.java @@ -0,0 +1,114 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface CreateNodeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.CreateNodeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The unqualified resource name.
+   * 
+ * + * string node_id = 2; + * + * @return The nodeId. + */ + java.lang.String getNodeId(); + /** + * + * + *
+   * The unqualified resource name.
+   * 
+ * + * string node_id = 2; + * + * @return The bytes for nodeId. + */ + com.google.protobuf.ByteString getNodeIdBytes(); + + /** + * + * + *
+   * Required. The node.
+   * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the node field is set. + */ + boolean hasNode(); + /** + * + * + *
+   * Required. The node.
+   * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The node. + */ + com.google.cloud.tpu.v1.Node getNode(); + /** + * + * + *
+   * Required. The node.
+   * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.tpu.v1.NodeOrBuilder getNodeOrBuilder(); +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/DeleteNodeRequest.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/DeleteNodeRequest.java new file mode 100644 index 00000000..b66131c9 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/DeleteNodeRequest.java @@ -0,0 +1,648 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + * + * + *
+ * Request for [DeleteNode][google.cloud.tpu.v1.Tpu.DeleteNode].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.DeleteNodeRequest} + */ +public final class DeleteNodeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.DeleteNodeRequest) + DeleteNodeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteNodeRequest.newBuilder() to construct. + private DeleteNodeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteNodeRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteNodeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteNodeRequest( + 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.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_DeleteNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_DeleteNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.DeleteNodeRequest.class, + com.google.cloud.tpu.v1.DeleteNodeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name.
+   * 
+ * + * + * 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.tpu.v1.DeleteNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.DeleteNodeRequest other = + (com.google.cloud.tpu.v1.DeleteNodeRequest) 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.tpu.v1.DeleteNodeRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.DeleteNodeRequest 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.tpu.v1.DeleteNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.DeleteNodeRequest 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.tpu.v1.DeleteNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.DeleteNodeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.DeleteNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.DeleteNodeRequest 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.tpu.v1.DeleteNodeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.DeleteNodeRequest 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.tpu.v1.DeleteNodeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.DeleteNodeRequest 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.tpu.v1.DeleteNodeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for [DeleteNode][google.cloud.tpu.v1.Tpu.DeleteNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.DeleteNodeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.DeleteNodeRequest) + com.google.cloud.tpu.v1.DeleteNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_DeleteNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_DeleteNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.DeleteNodeRequest.class, + com.google.cloud.tpu.v1.DeleteNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.DeleteNodeRequest.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.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_DeleteNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.DeleteNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.DeleteNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.DeleteNodeRequest build() { + com.google.cloud.tpu.v1.DeleteNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.DeleteNodeRequest buildPartial() { + com.google.cloud.tpu.v1.DeleteNodeRequest result = + new com.google.cloud.tpu.v1.DeleteNodeRequest(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.tpu.v1.DeleteNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v1.DeleteNodeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.DeleteNodeRequest other) { + if (other == com.google.cloud.tpu.v1.DeleteNodeRequest.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.tpu.v1.DeleteNodeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.DeleteNodeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name.
+     * 
+ * + * + * 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.tpu.v1.DeleteNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.DeleteNodeRequest) + private static final com.google.cloud.tpu.v1.DeleteNodeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.DeleteNodeRequest(); + } + + public static com.google.cloud.tpu.v1.DeleteNodeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteNodeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteNodeRequest(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.tpu.v1.DeleteNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/DeleteNodeRequestOrBuilder.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/DeleteNodeRequestOrBuilder.java new file mode 100644 index 00000000..cca7435f --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/DeleteNodeRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface DeleteNodeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.DeleteNodeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name.
+   * 
+ * + * + * 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-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetAcceleratorTypeRequest.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetAcceleratorTypeRequest.java new file mode 100644 index 00000000..1d368961 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetAcceleratorTypeRequest.java @@ -0,0 +1,650 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + * + * + *
+ * Request for [GetAcceleratorType][google.cloud.tpu.v1.Tpu.GetAcceleratorType].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.GetAcceleratorTypeRequest} + */ +public final class GetAcceleratorTypeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.GetAcceleratorTypeRequest) + GetAcceleratorTypeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetAcceleratorTypeRequest.newBuilder() to construct. + private GetAcceleratorTypeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetAcceleratorTypeRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetAcceleratorTypeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetAcceleratorTypeRequest( + 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.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_GetAcceleratorTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_GetAcceleratorTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest.class, + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name.
+   * 
+ * + * + * 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.tpu.v1.GetAcceleratorTypeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest other = + (com.google.cloud.tpu.v1.GetAcceleratorTypeRequest) 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.tpu.v1.GetAcceleratorTypeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.GetAcceleratorTypeRequest 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.tpu.v1.GetAcceleratorTypeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.GetAcceleratorTypeRequest 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.tpu.v1.GetAcceleratorTypeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.GetAcceleratorTypeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.GetAcceleratorTypeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.GetAcceleratorTypeRequest 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.tpu.v1.GetAcceleratorTypeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.GetAcceleratorTypeRequest 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.tpu.v1.GetAcceleratorTypeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.GetAcceleratorTypeRequest 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.tpu.v1.GetAcceleratorTypeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for [GetAcceleratorType][google.cloud.tpu.v1.Tpu.GetAcceleratorType].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.GetAcceleratorTypeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.GetAcceleratorTypeRequest) + com.google.cloud.tpu.v1.GetAcceleratorTypeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_GetAcceleratorTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_GetAcceleratorTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest.class, + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.GetAcceleratorTypeRequest.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.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_GetAcceleratorTypeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.GetAcceleratorTypeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.GetAcceleratorTypeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.GetAcceleratorTypeRequest build() { + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.GetAcceleratorTypeRequest buildPartial() { + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest result = + new com.google.cloud.tpu.v1.GetAcceleratorTypeRequest(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.tpu.v1.GetAcceleratorTypeRequest) { + return mergeFrom((com.google.cloud.tpu.v1.GetAcceleratorTypeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.GetAcceleratorTypeRequest other) { + if (other == com.google.cloud.tpu.v1.GetAcceleratorTypeRequest.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.tpu.v1.GetAcceleratorTypeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.tpu.v1.GetAcceleratorTypeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name.
+     * 
+ * + * + * 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.tpu.v1.GetAcceleratorTypeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.GetAcceleratorTypeRequest) + private static final com.google.cloud.tpu.v1.GetAcceleratorTypeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.GetAcceleratorTypeRequest(); + } + + public static com.google.cloud.tpu.v1.GetAcceleratorTypeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetAcceleratorTypeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetAcceleratorTypeRequest(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.tpu.v1.GetAcceleratorTypeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetAcceleratorTypeRequestOrBuilder.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetAcceleratorTypeRequestOrBuilder.java new file mode 100644 index 00000000..236bc019 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetAcceleratorTypeRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface GetAcceleratorTypeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.GetAcceleratorTypeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name.
+   * 
+ * + * + * 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-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetNodeRequest.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetNodeRequest.java new file mode 100644 index 00000000..076aafd3 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetNodeRequest.java @@ -0,0 +1,647 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + * + * + *
+ * Request for [GetNode][google.cloud.tpu.v1.Tpu.GetNode].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.GetNodeRequest} + */ +public final class GetNodeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.GetNodeRequest) + GetNodeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetNodeRequest.newBuilder() to construct. + private GetNodeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetNodeRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetNodeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetNodeRequest( + 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.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_GetNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_GetNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.GetNodeRequest.class, + com.google.cloud.tpu.v1.GetNodeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name.
+   * 
+ * + * + * 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.tpu.v1.GetNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.GetNodeRequest other = (com.google.cloud.tpu.v1.GetNodeRequest) 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.tpu.v1.GetNodeRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.GetNodeRequest 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.tpu.v1.GetNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.GetNodeRequest 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.tpu.v1.GetNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.GetNodeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.GetNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.GetNodeRequest 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.tpu.v1.GetNodeRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.GetNodeRequest 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.tpu.v1.GetNodeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.GetNodeRequest 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.tpu.v1.GetNodeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for [GetNode][google.cloud.tpu.v1.Tpu.GetNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.GetNodeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.GetNodeRequest) + com.google.cloud.tpu.v1.GetNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_GetNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_GetNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.GetNodeRequest.class, + com.google.cloud.tpu.v1.GetNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.GetNodeRequest.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.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_GetNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.GetNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.GetNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.GetNodeRequest build() { + com.google.cloud.tpu.v1.GetNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.GetNodeRequest buildPartial() { + com.google.cloud.tpu.v1.GetNodeRequest result = + new com.google.cloud.tpu.v1.GetNodeRequest(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.tpu.v1.GetNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v1.GetNodeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.GetNodeRequest other) { + if (other == com.google.cloud.tpu.v1.GetNodeRequest.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.tpu.v1.GetNodeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.GetNodeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name.
+     * 
+ * + * + * 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.tpu.v1.GetNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.GetNodeRequest) + private static final com.google.cloud.tpu.v1.GetNodeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.GetNodeRequest(); + } + + public static com.google.cloud.tpu.v1.GetNodeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetNodeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetNodeRequest(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.tpu.v1.GetNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetNodeRequestOrBuilder.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetNodeRequestOrBuilder.java new file mode 100644 index 00000000..283d187a --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetNodeRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface GetNodeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.GetNodeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name.
+   * 
+ * + * + * 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-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetTensorFlowVersionRequest.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetTensorFlowVersionRequest.java new file mode 100644 index 00000000..0b9d4a49 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetTensorFlowVersionRequest.java @@ -0,0 +1,650 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + * + * + *
+ * Request for [GetTensorFlowVersion][google.cloud.tpu.v1.Tpu.GetTensorFlowVersion].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.GetTensorFlowVersionRequest} + */ +public final class GetTensorFlowVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.GetTensorFlowVersionRequest) + GetTensorFlowVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetTensorFlowVersionRequest.newBuilder() to construct. + private GetTensorFlowVersionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetTensorFlowVersionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetTensorFlowVersionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetTensorFlowVersionRequest( + 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.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_GetTensorFlowVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_GetTensorFlowVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest.class, + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name.
+   * 
+ * + * + * 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.tpu.v1.GetTensorFlowVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest other = + (com.google.cloud.tpu.v1.GetTensorFlowVersionRequest) 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.tpu.v1.GetTensorFlowVersionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.GetTensorFlowVersionRequest 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.tpu.v1.GetTensorFlowVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.GetTensorFlowVersionRequest 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.tpu.v1.GetTensorFlowVersionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.GetTensorFlowVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.GetTensorFlowVersionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.GetTensorFlowVersionRequest 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.tpu.v1.GetTensorFlowVersionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.GetTensorFlowVersionRequest 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.tpu.v1.GetTensorFlowVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.GetTensorFlowVersionRequest 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.tpu.v1.GetTensorFlowVersionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for [GetTensorFlowVersion][google.cloud.tpu.v1.Tpu.GetTensorFlowVersion].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.GetTensorFlowVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.GetTensorFlowVersionRequest) + com.google.cloud.tpu.v1.GetTensorFlowVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_GetTensorFlowVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_GetTensorFlowVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest.class, + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.GetTensorFlowVersionRequest.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.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_GetTensorFlowVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.GetTensorFlowVersionRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.GetTensorFlowVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.GetTensorFlowVersionRequest build() { + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.GetTensorFlowVersionRequest buildPartial() { + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest result = + new com.google.cloud.tpu.v1.GetTensorFlowVersionRequest(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.tpu.v1.GetTensorFlowVersionRequest) { + return mergeFrom((com.google.cloud.tpu.v1.GetTensorFlowVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.GetTensorFlowVersionRequest other) { + if (other == com.google.cloud.tpu.v1.GetTensorFlowVersionRequest.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.tpu.v1.GetTensorFlowVersionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.tpu.v1.GetTensorFlowVersionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name.
+     * 
+ * + * + * 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.tpu.v1.GetTensorFlowVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.GetTensorFlowVersionRequest) + private static final com.google.cloud.tpu.v1.GetTensorFlowVersionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.GetTensorFlowVersionRequest(); + } + + public static com.google.cloud.tpu.v1.GetTensorFlowVersionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetTensorFlowVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetTensorFlowVersionRequest(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.tpu.v1.GetTensorFlowVersionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetTensorFlowVersionRequestOrBuilder.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetTensorFlowVersionRequestOrBuilder.java new file mode 100644 index 00000000..ed5597d5 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetTensorFlowVersionRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface GetTensorFlowVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.GetTensorFlowVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name.
+   * 
+ * + * + * 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-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesRequest.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesRequest.java new file mode 100644 index 00000000..e0c68864 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesRequest.java @@ -0,0 +1,1277 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + * + * + *
+ * Request for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListAcceleratorTypesRequest} + */ +public final class ListAcceleratorTypesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.ListAcceleratorTypesRequest) + ListAcceleratorTypesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAcceleratorTypesRequest.newBuilder() to construct. + private ListAcceleratorTypesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAcceleratorTypesRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAcceleratorTypesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListAcceleratorTypesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListAcceleratorTypesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListAcceleratorTypesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest.class, + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 5; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 6; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * Sort results.
+   * 
+ * + * string order_by = 6; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Sort results.
+   * 
+ * + * string order_by = 6; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, filter_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, orderBy_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, filter_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, orderBy_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.tpu.v1.ListAcceleratorTypesRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest other = + (com.google.cloud.tpu.v1.ListAcceleratorTypesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.ListAcceleratorTypesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.ListAcceleratorTypesRequest 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.tpu.v1.ListAcceleratorTypesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.ListAcceleratorTypesRequest 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.tpu.v1.ListAcceleratorTypesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.ListAcceleratorTypesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.ListAcceleratorTypesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.ListAcceleratorTypesRequest 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.tpu.v1.ListAcceleratorTypesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.ListAcceleratorTypesRequest 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.tpu.v1.ListAcceleratorTypesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.ListAcceleratorTypesRequest 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.tpu.v1.ListAcceleratorTypesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListAcceleratorTypesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.ListAcceleratorTypesRequest) + com.google.cloud.tpu.v1.ListAcceleratorTypesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListAcceleratorTypesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListAcceleratorTypesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest.class, + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.ListAcceleratorTypesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListAcceleratorTypesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListAcceleratorTypesRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.ListAcceleratorTypesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListAcceleratorTypesRequest build() { + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListAcceleratorTypesRequest buildPartial() { + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest result = + new com.google.cloud.tpu.v1.ListAcceleratorTypesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.ListAcceleratorTypesRequest) { + return mergeFrom((com.google.cloud.tpu.v1.ListAcceleratorTypesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.ListAcceleratorTypesRequest other) { + if (other == com.google.cloud.tpu.v1.ListAcceleratorTypesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.tpu.v1.ListAcceleratorTypesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Sort results.
+     * 
+ * + * string order_by = 6; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Sort results.
+     * 
+ * + * string order_by = 6; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Sort results.
+     * 
+ * + * string order_by = 6; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Sort results.
+     * 
+ * + * string order_by = 6; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Sort results.
+     * 
+ * + * string order_by = 6; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.ListAcceleratorTypesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.ListAcceleratorTypesRequest) + private static final com.google.cloud.tpu.v1.ListAcceleratorTypesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.ListAcceleratorTypesRequest(); + } + + public static com.google.cloud.tpu.v1.ListAcceleratorTypesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAcceleratorTypesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAcceleratorTypesRequest(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.tpu.v1.ListAcceleratorTypesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesRequestOrBuilder.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesRequestOrBuilder.java new file mode 100644 index 00000000..d2b5e3b4 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesRequestOrBuilder.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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface ListAcceleratorTypesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.ListAcceleratorTypesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Sort results.
+   * 
+ * + * string order_by = 6; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Sort results.
+   * 
+ * + * string order_by = 6; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesResponse.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesResponse.java new file mode 100644 index 00000000..22370484 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesResponse.java @@ -0,0 +1,1411 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + * + * + *
+ * Response for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListAcceleratorTypesResponse} + */ +public final class ListAcceleratorTypesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.ListAcceleratorTypesResponse) + ListAcceleratorTypesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAcceleratorTypesResponse.newBuilder() to construct. + private ListAcceleratorTypesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAcceleratorTypesResponse() { + acceleratorTypes_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAcceleratorTypesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListAcceleratorTypesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + acceleratorTypes_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + acceleratorTypes_.add( + input.readMessage( + com.google.cloud.tpu.v1.AcceleratorType.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + unreachable_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + acceleratorTypes_ = java.util.Collections.unmodifiableList(acceleratorTypes_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListAcceleratorTypesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListAcceleratorTypesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListAcceleratorTypesResponse.class, + com.google.cloud.tpu.v1.ListAcceleratorTypesResponse.Builder.class); + } + + public static final int ACCELERATOR_TYPES_FIELD_NUMBER = 1; + private java.util.List acceleratorTypes_; + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + @java.lang.Override + public java.util.List getAcceleratorTypesList() { + return acceleratorTypes_; + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + @java.lang.Override + public java.util.List + getAcceleratorTypesOrBuilderList() { + return acceleratorTypes_; + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + @java.lang.Override + public int getAcceleratorTypesCount() { + return acceleratorTypes_.size(); + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v1.AcceleratorType getAcceleratorTypes(int index) { + return acceleratorTypes_.get(index); + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v1.AcceleratorTypeOrBuilder getAcceleratorTypesOrBuilder(int index) { + return acceleratorTypes_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < acceleratorTypes_.size(); i++) { + output.writeMessage(1, acceleratorTypes_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < acceleratorTypes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, acceleratorTypes_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.tpu.v1.ListAcceleratorTypesResponse)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.ListAcceleratorTypesResponse other = + (com.google.cloud.tpu.v1.ListAcceleratorTypesResponse) obj; + + if (!getAcceleratorTypesList().equals(other.getAcceleratorTypesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAcceleratorTypesCount() > 0) { + hash = (37 * hash) + ACCELERATOR_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getAcceleratorTypesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.ListAcceleratorTypesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.ListAcceleratorTypesResponse 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.tpu.v1.ListAcceleratorTypesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.ListAcceleratorTypesResponse 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.tpu.v1.ListAcceleratorTypesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.ListAcceleratorTypesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.ListAcceleratorTypesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.ListAcceleratorTypesResponse 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.tpu.v1.ListAcceleratorTypesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.ListAcceleratorTypesResponse 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.tpu.v1.ListAcceleratorTypesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.ListAcceleratorTypesResponse 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.tpu.v1.ListAcceleratorTypesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListAcceleratorTypesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.ListAcceleratorTypesResponse) + com.google.cloud.tpu.v1.ListAcceleratorTypesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListAcceleratorTypesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListAcceleratorTypesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListAcceleratorTypesResponse.class, + com.google.cloud.tpu.v1.ListAcceleratorTypesResponse.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.ListAcceleratorTypesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAcceleratorTypesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (acceleratorTypesBuilder_ == null) { + acceleratorTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + acceleratorTypesBuilder_.clear(); + } + nextPageToken_ = ""; + + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListAcceleratorTypesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListAcceleratorTypesResponse getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.ListAcceleratorTypesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListAcceleratorTypesResponse build() { + com.google.cloud.tpu.v1.ListAcceleratorTypesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListAcceleratorTypesResponse buildPartial() { + com.google.cloud.tpu.v1.ListAcceleratorTypesResponse result = + new com.google.cloud.tpu.v1.ListAcceleratorTypesResponse(this); + int from_bitField0_ = bitField0_; + if (acceleratorTypesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + acceleratorTypes_ = java.util.Collections.unmodifiableList(acceleratorTypes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.acceleratorTypes_ = acceleratorTypes_; + } else { + result.acceleratorTypes_ = acceleratorTypesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + if (((bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.unreachable_ = unreachable_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.ListAcceleratorTypesResponse) { + return mergeFrom((com.google.cloud.tpu.v1.ListAcceleratorTypesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.ListAcceleratorTypesResponse other) { + if (other == com.google.cloud.tpu.v1.ListAcceleratorTypesResponse.getDefaultInstance()) + return this; + if (acceleratorTypesBuilder_ == null) { + if (!other.acceleratorTypes_.isEmpty()) { + if (acceleratorTypes_.isEmpty()) { + acceleratorTypes_ = other.acceleratorTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAcceleratorTypesIsMutable(); + acceleratorTypes_.addAll(other.acceleratorTypes_); + } + onChanged(); + } + } else { + if (!other.acceleratorTypes_.isEmpty()) { + if (acceleratorTypesBuilder_.isEmpty()) { + acceleratorTypesBuilder_.dispose(); + acceleratorTypesBuilder_ = null; + acceleratorTypes_ = other.acceleratorTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + acceleratorTypesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAcceleratorTypesFieldBuilder() + : null; + } else { + acceleratorTypesBuilder_.addAllMessages(other.acceleratorTypes_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.ListAcceleratorTypesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.tpu.v1.ListAcceleratorTypesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List acceleratorTypes_ = + java.util.Collections.emptyList(); + + private void ensureAcceleratorTypesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + acceleratorTypes_ = + new java.util.ArrayList(acceleratorTypes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.AcceleratorType, + com.google.cloud.tpu.v1.AcceleratorType.Builder, + com.google.cloud.tpu.v1.AcceleratorTypeOrBuilder> + acceleratorTypesBuilder_; + + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public java.util.List getAcceleratorTypesList() { + if (acceleratorTypesBuilder_ == null) { + return java.util.Collections.unmodifiableList(acceleratorTypes_); + } else { + return acceleratorTypesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public int getAcceleratorTypesCount() { + if (acceleratorTypesBuilder_ == null) { + return acceleratorTypes_.size(); + } else { + return acceleratorTypesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public com.google.cloud.tpu.v1.AcceleratorType getAcceleratorTypes(int index) { + if (acceleratorTypesBuilder_ == null) { + return acceleratorTypes_.get(index); + } else { + return acceleratorTypesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public Builder setAcceleratorTypes(int index, com.google.cloud.tpu.v1.AcceleratorType value) { + if (acceleratorTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAcceleratorTypesIsMutable(); + acceleratorTypes_.set(index, value); + onChanged(); + } else { + acceleratorTypesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public Builder setAcceleratorTypes( + int index, com.google.cloud.tpu.v1.AcceleratorType.Builder builderForValue) { + if (acceleratorTypesBuilder_ == null) { + ensureAcceleratorTypesIsMutable(); + acceleratorTypes_.set(index, builderForValue.build()); + onChanged(); + } else { + acceleratorTypesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public Builder addAcceleratorTypes(com.google.cloud.tpu.v1.AcceleratorType value) { + if (acceleratorTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAcceleratorTypesIsMutable(); + acceleratorTypes_.add(value); + onChanged(); + } else { + acceleratorTypesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public Builder addAcceleratorTypes(int index, com.google.cloud.tpu.v1.AcceleratorType value) { + if (acceleratorTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAcceleratorTypesIsMutable(); + acceleratorTypes_.add(index, value); + onChanged(); + } else { + acceleratorTypesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public Builder addAcceleratorTypes( + com.google.cloud.tpu.v1.AcceleratorType.Builder builderForValue) { + if (acceleratorTypesBuilder_ == null) { + ensureAcceleratorTypesIsMutable(); + acceleratorTypes_.add(builderForValue.build()); + onChanged(); + } else { + acceleratorTypesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public Builder addAcceleratorTypes( + int index, com.google.cloud.tpu.v1.AcceleratorType.Builder builderForValue) { + if (acceleratorTypesBuilder_ == null) { + ensureAcceleratorTypesIsMutable(); + acceleratorTypes_.add(index, builderForValue.build()); + onChanged(); + } else { + acceleratorTypesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public Builder addAllAcceleratorTypes( + java.lang.Iterable values) { + if (acceleratorTypesBuilder_ == null) { + ensureAcceleratorTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, acceleratorTypes_); + onChanged(); + } else { + acceleratorTypesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public Builder clearAcceleratorTypes() { + if (acceleratorTypesBuilder_ == null) { + acceleratorTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + acceleratorTypesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public Builder removeAcceleratorTypes(int index) { + if (acceleratorTypesBuilder_ == null) { + ensureAcceleratorTypesIsMutable(); + acceleratorTypes_.remove(index); + onChanged(); + } else { + acceleratorTypesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public com.google.cloud.tpu.v1.AcceleratorType.Builder getAcceleratorTypesBuilder(int index) { + return getAcceleratorTypesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public com.google.cloud.tpu.v1.AcceleratorTypeOrBuilder getAcceleratorTypesOrBuilder( + int index) { + if (acceleratorTypesBuilder_ == null) { + return acceleratorTypes_.get(index); + } else { + return acceleratorTypesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public java.util.List + getAcceleratorTypesOrBuilderList() { + if (acceleratorTypesBuilder_ != null) { + return acceleratorTypesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(acceleratorTypes_); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public com.google.cloud.tpu.v1.AcceleratorType.Builder addAcceleratorTypesBuilder() { + return getAcceleratorTypesFieldBuilder() + .addBuilder(com.google.cloud.tpu.v1.AcceleratorType.getDefaultInstance()); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public com.google.cloud.tpu.v1.AcceleratorType.Builder addAcceleratorTypesBuilder(int index) { + return getAcceleratorTypesFieldBuilder() + .addBuilder(index, com.google.cloud.tpu.v1.AcceleratorType.getDefaultInstance()); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public java.util.List + getAcceleratorTypesBuilderList() { + return getAcceleratorTypesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.AcceleratorType, + com.google.cloud.tpu.v1.AcceleratorType.Builder, + com.google.cloud.tpu.v1.AcceleratorTypeOrBuilder> + getAcceleratorTypesFieldBuilder() { + if (acceleratorTypesBuilder_ == null) { + acceleratorTypesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.AcceleratorType, + com.google.cloud.tpu.v1.AcceleratorType.Builder, + com.google.cloud.tpu.v1.AcceleratorTypeOrBuilder>( + acceleratorTypes_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + acceleratorTypes_ = null; + } + return acceleratorTypesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.ListAcceleratorTypesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.ListAcceleratorTypesResponse) + private static final com.google.cloud.tpu.v1.ListAcceleratorTypesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.ListAcceleratorTypesResponse(); + } + + public static com.google.cloud.tpu.v1.ListAcceleratorTypesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAcceleratorTypesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAcceleratorTypesResponse(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.tpu.v1.ListAcceleratorTypesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesResponseOrBuilder.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesResponseOrBuilder.java new file mode 100644 index 00000000..22c7fea3 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesResponseOrBuilder.java @@ -0,0 +1,153 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface ListAcceleratorTypesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.ListAcceleratorTypesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + java.util.List getAcceleratorTypesList(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + com.google.cloud.tpu.v1.AcceleratorType getAcceleratorTypes(int index); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + int getAcceleratorTypesCount(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + java.util.List + getAcceleratorTypesOrBuilderList(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + com.google.cloud.tpu.v1.AcceleratorTypeOrBuilder getAcceleratorTypesOrBuilder(int index); + + /** + * + * + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesRequest.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesRequest.java new file mode 100644 index 00000000..e5977483 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesRequest.java @@ -0,0 +1,916 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + * + * + *
+ * Request for [ListNodes][google.cloud.tpu.v1.Tpu.ListNodes].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListNodesRequest} + */ +public final class ListNodesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.ListNodesRequest) + ListNodesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListNodesRequest.newBuilder() to construct. + private ListNodesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListNodesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListNodesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListNodesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + 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.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListNodesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListNodesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListNodesRequest.class, + com.google.cloud.tpu.v1.ListNodesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + 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.tpu.v1.ListNodesRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.ListNodesRequest other = (com.google.cloud.tpu.v1.ListNodesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.ListNodesRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.ListNodesRequest 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.tpu.v1.ListNodesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.ListNodesRequest 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.tpu.v1.ListNodesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.ListNodesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.ListNodesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.ListNodesRequest 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.tpu.v1.ListNodesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.ListNodesRequest 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.tpu.v1.ListNodesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.ListNodesRequest 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.tpu.v1.ListNodesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for [ListNodes][google.cloud.tpu.v1.Tpu.ListNodes].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListNodesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.ListNodesRequest) + com.google.cloud.tpu.v1.ListNodesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListNodesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListNodesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListNodesRequest.class, + com.google.cloud.tpu.v1.ListNodesRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.ListNodesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListNodesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListNodesRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.ListNodesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListNodesRequest build() { + com.google.cloud.tpu.v1.ListNodesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListNodesRequest buildPartial() { + com.google.cloud.tpu.v1.ListNodesRequest result = + new com.google.cloud.tpu.v1.ListNodesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.ListNodesRequest) { + return mergeFrom((com.google.cloud.tpu.v1.ListNodesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.ListNodesRequest other) { + if (other == com.google.cloud.tpu.v1.ListNodesRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + 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.tpu.v1.ListNodesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.ListNodesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.ListNodesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.ListNodesRequest) + private static final com.google.cloud.tpu.v1.ListNodesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.ListNodesRequest(); + } + + public static com.google.cloud.tpu.v1.ListNodesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListNodesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListNodesRequest(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.tpu.v1.ListNodesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesRequestOrBuilder.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesRequestOrBuilder.java new file mode 100644 index 00000000..fdd37af6 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesRequestOrBuilder.java @@ -0,0 +1,92 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface ListNodesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.ListNodesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesResponse.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesResponse.java new file mode 100644 index 00000000..8f153a27 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesResponse.java @@ -0,0 +1,1393 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + * + * + *
+ * Response for [ListNodes][google.cloud.tpu.v1.Tpu.ListNodes].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListNodesResponse} + */ +public final class ListNodesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.ListNodesResponse) + ListNodesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListNodesResponse.newBuilder() to construct. + private ListNodesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListNodesResponse() { + nodes_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListNodesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListNodesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + nodes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + nodes_.add( + input.readMessage(com.google.cloud.tpu.v1.Node.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + unreachable_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + nodes_ = java.util.Collections.unmodifiableList(nodes_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListNodesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListNodesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListNodesResponse.class, + com.google.cloud.tpu.v1.ListNodesResponse.Builder.class); + } + + public static final int NODES_FIELD_NUMBER = 1; + private java.util.List nodes_; + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + @java.lang.Override + public java.util.List getNodesList() { + return nodes_; + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + @java.lang.Override + public java.util.List getNodesOrBuilderList() { + return nodes_; + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + @java.lang.Override + public int getNodesCount() { + return nodes_.size(); + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v1.Node getNodes(int index) { + return nodes_.get(index); + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v1.NodeOrBuilder getNodesOrBuilder(int index) { + return nodes_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < nodes_.size(); i++) { + output.writeMessage(1, nodes_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < nodes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, nodes_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.tpu.v1.ListNodesResponse)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.ListNodesResponse other = + (com.google.cloud.tpu.v1.ListNodesResponse) obj; + + if (!getNodesList().equals(other.getNodesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getNodesCount() > 0) { + hash = (37 * hash) + NODES_FIELD_NUMBER; + hash = (53 * hash) + getNodesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.ListNodesResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.ListNodesResponse 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.tpu.v1.ListNodesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.ListNodesResponse 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.tpu.v1.ListNodesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.ListNodesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.ListNodesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.ListNodesResponse 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.tpu.v1.ListNodesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.ListNodesResponse 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.tpu.v1.ListNodesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.ListNodesResponse 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.tpu.v1.ListNodesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response for [ListNodes][google.cloud.tpu.v1.Tpu.ListNodes].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListNodesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.ListNodesResponse) + com.google.cloud.tpu.v1.ListNodesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListNodesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListNodesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListNodesResponse.class, + com.google.cloud.tpu.v1.ListNodesResponse.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.ListNodesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getNodesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + nodesBuilder_.clear(); + } + nextPageToken_ = ""; + + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListNodesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListNodesResponse getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.ListNodesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListNodesResponse build() { + com.google.cloud.tpu.v1.ListNodesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListNodesResponse buildPartial() { + com.google.cloud.tpu.v1.ListNodesResponse result = + new com.google.cloud.tpu.v1.ListNodesResponse(this); + int from_bitField0_ = bitField0_; + if (nodesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + nodes_ = java.util.Collections.unmodifiableList(nodes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.nodes_ = nodes_; + } else { + result.nodes_ = nodesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + if (((bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.unreachable_ = unreachable_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.ListNodesResponse) { + return mergeFrom((com.google.cloud.tpu.v1.ListNodesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.ListNodesResponse other) { + if (other == com.google.cloud.tpu.v1.ListNodesResponse.getDefaultInstance()) return this; + if (nodesBuilder_ == null) { + if (!other.nodes_.isEmpty()) { + if (nodes_.isEmpty()) { + nodes_ = other.nodes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNodesIsMutable(); + nodes_.addAll(other.nodes_); + } + onChanged(); + } + } else { + if (!other.nodes_.isEmpty()) { + if (nodesBuilder_.isEmpty()) { + nodesBuilder_.dispose(); + nodesBuilder_ = null; + nodes_ = other.nodes_; + bitField0_ = (bitField0_ & ~0x00000001); + nodesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNodesFieldBuilder() + : null; + } else { + nodesBuilder_.addAllMessages(other.nodes_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.ListNodesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.ListNodesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List nodes_ = java.util.Collections.emptyList(); + + private void ensureNodesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + nodes_ = new java.util.ArrayList(nodes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.Node, + com.google.cloud.tpu.v1.Node.Builder, + com.google.cloud.tpu.v1.NodeOrBuilder> + nodesBuilder_; + + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public java.util.List getNodesList() { + if (nodesBuilder_ == null) { + return java.util.Collections.unmodifiableList(nodes_); + } else { + return nodesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public int getNodesCount() { + if (nodesBuilder_ == null) { + return nodes_.size(); + } else { + return nodesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public com.google.cloud.tpu.v1.Node getNodes(int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public Builder setNodes(int index, com.google.cloud.tpu.v1.Node value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.set(index, value); + onChanged(); + } else { + nodesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public Builder setNodes(int index, com.google.cloud.tpu.v1.Node.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.set(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public Builder addNodes(com.google.cloud.tpu.v1.Node value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(value); + onChanged(); + } else { + nodesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public Builder addNodes(int index, com.google.cloud.tpu.v1.Node value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(index, value); + onChanged(); + } else { + nodesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public Builder addNodes(com.google.cloud.tpu.v1.Node.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public Builder addNodes(int index, com.google.cloud.tpu.v1.Node.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public Builder addAllNodes(java.lang.Iterable values) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, nodes_); + onChanged(); + } else { + nodesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public Builder clearNodes() { + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + nodesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public Builder removeNodes(int index) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.remove(index); + onChanged(); + } else { + nodesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public com.google.cloud.tpu.v1.Node.Builder getNodesBuilder(int index) { + return getNodesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public com.google.cloud.tpu.v1.NodeOrBuilder getNodesOrBuilder(int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public java.util.List getNodesOrBuilderList() { + if (nodesBuilder_ != null) { + return nodesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nodes_); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public com.google.cloud.tpu.v1.Node.Builder addNodesBuilder() { + return getNodesFieldBuilder().addBuilder(com.google.cloud.tpu.v1.Node.getDefaultInstance()); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public com.google.cloud.tpu.v1.Node.Builder addNodesBuilder(int index) { + return getNodesFieldBuilder() + .addBuilder(index, com.google.cloud.tpu.v1.Node.getDefaultInstance()); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public java.util.List getNodesBuilderList() { + return getNodesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.Node, + com.google.cloud.tpu.v1.Node.Builder, + com.google.cloud.tpu.v1.NodeOrBuilder> + getNodesFieldBuilder() { + if (nodesBuilder_ == null) { + nodesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.Node, + com.google.cloud.tpu.v1.Node.Builder, + com.google.cloud.tpu.v1.NodeOrBuilder>( + nodes_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + nodes_ = null; + } + return nodesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.ListNodesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.ListNodesResponse) + private static final com.google.cloud.tpu.v1.ListNodesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.ListNodesResponse(); + } + + public static com.google.cloud.tpu.v1.ListNodesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListNodesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListNodesResponse(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.tpu.v1.ListNodesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesResponseOrBuilder.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesResponseOrBuilder.java new file mode 100644 index 00000000..64efc2a9 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesResponseOrBuilder.java @@ -0,0 +1,152 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface ListNodesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.ListNodesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + java.util.List getNodesList(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + com.google.cloud.tpu.v1.Node getNodes(int index); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + int getNodesCount(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + java.util.List getNodesOrBuilderList(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + com.google.cloud.tpu.v1.NodeOrBuilder getNodesOrBuilder(int index); + + /** + * + * + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsRequest.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsRequest.java new file mode 100644 index 00000000..4c2510aa --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsRequest.java @@ -0,0 +1,1278 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + * + * + *
+ * Request for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListTensorFlowVersionsRequest} + */ +public final class ListTensorFlowVersionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.ListTensorFlowVersionsRequest) + ListTensorFlowVersionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListTensorFlowVersionsRequest.newBuilder() to construct. + private ListTensorFlowVersionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListTensorFlowVersionsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListTensorFlowVersionsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListTensorFlowVersionsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest.class, + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 5; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 6; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * Sort results.
+   * 
+ * + * string order_by = 6; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Sort results.
+   * 
+ * + * string order_by = 6; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, filter_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, orderBy_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, filter_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, orderBy_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest other = + (com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest 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.tpu.v1.ListTensorFlowVersionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest 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.tpu.v1.ListTensorFlowVersionsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest 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.tpu.v1.ListTensorFlowVersionsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest 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.tpu.v1.ListTensorFlowVersionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest 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.tpu.v1.ListTensorFlowVersionsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListTensorFlowVersionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.ListTensorFlowVersionsRequest) + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest.class, + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest build() { + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest buildPartial() { + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest result = + new com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest) { + return mergeFrom((com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest other) { + if (other == com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Sort results.
+     * 
+ * + * string order_by = 6; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Sort results.
+     * 
+ * + * string order_by = 6; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Sort results.
+     * 
+ * + * string order_by = 6; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Sort results.
+     * 
+ * + * string order_by = 6; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Sort results.
+     * 
+ * + * string order_by = 6; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.ListTensorFlowVersionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.ListTensorFlowVersionsRequest) + private static final com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest(); + } + + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTensorFlowVersionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListTensorFlowVersionsRequest(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.tpu.v1.ListTensorFlowVersionsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsRequestOrBuilder.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsRequestOrBuilder.java new file mode 100644 index 00000000..98a6e4d4 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsRequestOrBuilder.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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface ListTensorFlowVersionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.ListTensorFlowVersionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Sort results.
+   * 
+ * + * string order_by = 6; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Sort results.
+   * 
+ * + * string order_by = 6; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsResponse.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsResponse.java new file mode 100644 index 00000000..72d2ba52 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsResponse.java @@ -0,0 +1,1419 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + * + * + *
+ * Response for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListTensorFlowVersionsResponse} + */ +public final class ListTensorFlowVersionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.ListTensorFlowVersionsResponse) + ListTensorFlowVersionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListTensorFlowVersionsResponse.newBuilder() to construct. + private ListTensorFlowVersionsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListTensorFlowVersionsResponse() { + tensorflowVersions_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListTensorFlowVersionsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListTensorFlowVersionsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + tensorflowVersions_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + tensorflowVersions_.add( + input.readMessage( + com.google.cloud.tpu.v1.TensorFlowVersion.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + unreachable_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + tensorflowVersions_ = java.util.Collections.unmodifiableList(tensorflowVersions_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse.class, + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse.Builder.class); + } + + public static final int TENSORFLOW_VERSIONS_FIELD_NUMBER = 1; + private java.util.List tensorflowVersions_; + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + @java.lang.Override + public java.util.List getTensorflowVersionsList() { + return tensorflowVersions_; + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + @java.lang.Override + public java.util.List + getTensorflowVersionsOrBuilderList() { + return tensorflowVersions_; + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + @java.lang.Override + public int getTensorflowVersionsCount() { + return tensorflowVersions_.size(); + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v1.TensorFlowVersion getTensorflowVersions(int index) { + return tensorflowVersions_.get(index); + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v1.TensorFlowVersionOrBuilder getTensorflowVersionsOrBuilder( + int index) { + return tensorflowVersions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < tensorflowVersions_.size(); i++) { + output.writeMessage(1, tensorflowVersions_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < tensorflowVersions_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, tensorflowVersions_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse other = + (com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse) obj; + + if (!getTensorflowVersionsList().equals(other.getTensorflowVersionsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getTensorflowVersionsCount() > 0) { + hash = (37 * hash) + TENSORFLOW_VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getTensorflowVersionsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse 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.tpu.v1.ListTensorFlowVersionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse 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.tpu.v1.ListTensorFlowVersionsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse 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.tpu.v1.ListTensorFlowVersionsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse 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.tpu.v1.ListTensorFlowVersionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse 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.tpu.v1.ListTensorFlowVersionsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListTensorFlowVersionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.ListTensorFlowVersionsResponse) + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse.class, + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTensorflowVersionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (tensorflowVersionsBuilder_ == null) { + tensorflowVersions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + tensorflowVersionsBuilder_.clear(); + } + nextPageToken_ = ""; + + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse build() { + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse buildPartial() { + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse result = + new com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse(this); + int from_bitField0_ = bitField0_; + if (tensorflowVersionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + tensorflowVersions_ = java.util.Collections.unmodifiableList(tensorflowVersions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.tensorflowVersions_ = tensorflowVersions_; + } else { + result.tensorflowVersions_ = tensorflowVersionsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + if (((bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.unreachable_ = unreachable_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse) { + return mergeFrom((com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse other) { + if (other == com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse.getDefaultInstance()) + return this; + if (tensorflowVersionsBuilder_ == null) { + if (!other.tensorflowVersions_.isEmpty()) { + if (tensorflowVersions_.isEmpty()) { + tensorflowVersions_ = other.tensorflowVersions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTensorflowVersionsIsMutable(); + tensorflowVersions_.addAll(other.tensorflowVersions_); + } + onChanged(); + } + } else { + if (!other.tensorflowVersions_.isEmpty()) { + if (tensorflowVersionsBuilder_.isEmpty()) { + tensorflowVersionsBuilder_.dispose(); + tensorflowVersionsBuilder_ = null; + tensorflowVersions_ = other.tensorflowVersions_; + bitField0_ = (bitField0_ & ~0x00000001); + tensorflowVersionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTensorflowVersionsFieldBuilder() + : null; + } else { + tensorflowVersionsBuilder_.addAllMessages(other.tensorflowVersions_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List tensorflowVersions_ = + java.util.Collections.emptyList(); + + private void ensureTensorflowVersionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + tensorflowVersions_ = + new java.util.ArrayList(tensorflowVersions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.TensorFlowVersion, + com.google.cloud.tpu.v1.TensorFlowVersion.Builder, + com.google.cloud.tpu.v1.TensorFlowVersionOrBuilder> + tensorflowVersionsBuilder_; + + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public java.util.List getTensorflowVersionsList() { + if (tensorflowVersionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(tensorflowVersions_); + } else { + return tensorflowVersionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public int getTensorflowVersionsCount() { + if (tensorflowVersionsBuilder_ == null) { + return tensorflowVersions_.size(); + } else { + return tensorflowVersionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public com.google.cloud.tpu.v1.TensorFlowVersion getTensorflowVersions(int index) { + if (tensorflowVersionsBuilder_ == null) { + return tensorflowVersions_.get(index); + } else { + return tensorflowVersionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public Builder setTensorflowVersions( + int index, com.google.cloud.tpu.v1.TensorFlowVersion value) { + if (tensorflowVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorflowVersionsIsMutable(); + tensorflowVersions_.set(index, value); + onChanged(); + } else { + tensorflowVersionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public Builder setTensorflowVersions( + int index, com.google.cloud.tpu.v1.TensorFlowVersion.Builder builderForValue) { + if (tensorflowVersionsBuilder_ == null) { + ensureTensorflowVersionsIsMutable(); + tensorflowVersions_.set(index, builderForValue.build()); + onChanged(); + } else { + tensorflowVersionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public Builder addTensorflowVersions(com.google.cloud.tpu.v1.TensorFlowVersion value) { + if (tensorflowVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorflowVersionsIsMutable(); + tensorflowVersions_.add(value); + onChanged(); + } else { + tensorflowVersionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public Builder addTensorflowVersions( + int index, com.google.cloud.tpu.v1.TensorFlowVersion value) { + if (tensorflowVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorflowVersionsIsMutable(); + tensorflowVersions_.add(index, value); + onChanged(); + } else { + tensorflowVersionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public Builder addTensorflowVersions( + com.google.cloud.tpu.v1.TensorFlowVersion.Builder builderForValue) { + if (tensorflowVersionsBuilder_ == null) { + ensureTensorflowVersionsIsMutable(); + tensorflowVersions_.add(builderForValue.build()); + onChanged(); + } else { + tensorflowVersionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public Builder addTensorflowVersions( + int index, com.google.cloud.tpu.v1.TensorFlowVersion.Builder builderForValue) { + if (tensorflowVersionsBuilder_ == null) { + ensureTensorflowVersionsIsMutable(); + tensorflowVersions_.add(index, builderForValue.build()); + onChanged(); + } else { + tensorflowVersionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public Builder addAllTensorflowVersions( + java.lang.Iterable values) { + if (tensorflowVersionsBuilder_ == null) { + ensureTensorflowVersionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tensorflowVersions_); + onChanged(); + } else { + tensorflowVersionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public Builder clearTensorflowVersions() { + if (tensorflowVersionsBuilder_ == null) { + tensorflowVersions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + tensorflowVersionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public Builder removeTensorflowVersions(int index) { + if (tensorflowVersionsBuilder_ == null) { + ensureTensorflowVersionsIsMutable(); + tensorflowVersions_.remove(index); + onChanged(); + } else { + tensorflowVersionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public com.google.cloud.tpu.v1.TensorFlowVersion.Builder getTensorflowVersionsBuilder( + int index) { + return getTensorflowVersionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public com.google.cloud.tpu.v1.TensorFlowVersionOrBuilder getTensorflowVersionsOrBuilder( + int index) { + if (tensorflowVersionsBuilder_ == null) { + return tensorflowVersions_.get(index); + } else { + return tensorflowVersionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public java.util.List + getTensorflowVersionsOrBuilderList() { + if (tensorflowVersionsBuilder_ != null) { + return tensorflowVersionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tensorflowVersions_); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public com.google.cloud.tpu.v1.TensorFlowVersion.Builder addTensorflowVersionsBuilder() { + return getTensorflowVersionsFieldBuilder() + .addBuilder(com.google.cloud.tpu.v1.TensorFlowVersion.getDefaultInstance()); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public com.google.cloud.tpu.v1.TensorFlowVersion.Builder addTensorflowVersionsBuilder( + int index) { + return getTensorflowVersionsFieldBuilder() + .addBuilder(index, com.google.cloud.tpu.v1.TensorFlowVersion.getDefaultInstance()); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public java.util.List + getTensorflowVersionsBuilderList() { + return getTensorflowVersionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.TensorFlowVersion, + com.google.cloud.tpu.v1.TensorFlowVersion.Builder, + com.google.cloud.tpu.v1.TensorFlowVersionOrBuilder> + getTensorflowVersionsFieldBuilder() { + if (tensorflowVersionsBuilder_ == null) { + tensorflowVersionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.TensorFlowVersion, + com.google.cloud.tpu.v1.TensorFlowVersion.Builder, + com.google.cloud.tpu.v1.TensorFlowVersionOrBuilder>( + tensorflowVersions_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + tensorflowVersions_ = null; + } + return tensorflowVersionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.ListTensorFlowVersionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.ListTensorFlowVersionsResponse) + private static final com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse(); + } + + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTensorFlowVersionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListTensorFlowVersionsResponse(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.tpu.v1.ListTensorFlowVersionsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsResponseOrBuilder.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsResponseOrBuilder.java new file mode 100644 index 00000000..15d27ff3 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsResponseOrBuilder.java @@ -0,0 +1,153 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface ListTensorFlowVersionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.ListTensorFlowVersionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + java.util.List getTensorflowVersionsList(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + com.google.cloud.tpu.v1.TensorFlowVersion getTensorflowVersions(int index); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + int getTensorflowVersionsCount(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + java.util.List + getTensorflowVersionsOrBuilderList(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + com.google.cloud.tpu.v1.TensorFlowVersionOrBuilder getTensorflowVersionsOrBuilder(int index); + + /** + * + * + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/LocationName.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/LocationName.java new file mode 100644 index 00000000..e55aed86 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/LocationName.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.tpu.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + project = locationName.project; + location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NetworkEndpoint.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NetworkEndpoint.java new file mode 100644 index 00000000..0a94ed32 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NetworkEndpoint.java @@ -0,0 +1,723 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + * + * + *
+ * A network endpoint over which a TPU worker can be reached.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.NetworkEndpoint} + */ +public final class NetworkEndpoint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.NetworkEndpoint) + NetworkEndpointOrBuilder { + private static final long serialVersionUID = 0L; + // Use NetworkEndpoint.newBuilder() to construct. + private NetworkEndpoint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NetworkEndpoint() { + ipAddress_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NetworkEndpoint(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private NetworkEndpoint( + 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(); + + ipAddress_ = s; + break; + } + case 16: + { + port_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (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.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_NetworkEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_NetworkEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.NetworkEndpoint.class, + com.google.cloud.tpu.v1.NetworkEndpoint.Builder.class); + } + + public static final int IP_ADDRESS_FIELD_NUMBER = 1; + private volatile java.lang.Object ipAddress_; + /** + * + * + *
+   * The IP address of this network endpoint.
+   * 
+ * + * string ip_address = 1; + * + * @return The ipAddress. + */ + @java.lang.Override + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } + } + /** + * + * + *
+   * The IP address of this network endpoint.
+   * 
+ * + * string ip_address = 1; + * + * @return The bytes for ipAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PORT_FIELD_NUMBER = 2; + private int port_; + /** + * + * + *
+   * The port of this network endpoint.
+   * 
+ * + * int32 port = 2; + * + * @return The port. + */ + @java.lang.Override + public int getPort() { + return port_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getIpAddressBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ipAddress_); + } + if (port_ != 0) { + output.writeInt32(2, port_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getIpAddressBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, ipAddress_); + } + if (port_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, port_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.tpu.v1.NetworkEndpoint)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.NetworkEndpoint other = (com.google.cloud.tpu.v1.NetworkEndpoint) obj; + + if (!getIpAddress().equals(other.getIpAddress())) return false; + if (getPort() != other.getPort()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().hashCode(); + hash = (37 * hash) + PORT_FIELD_NUMBER; + hash = (53 * hash) + getPort(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.NetworkEndpoint parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.NetworkEndpoint 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.tpu.v1.NetworkEndpoint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.NetworkEndpoint 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.tpu.v1.NetworkEndpoint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.NetworkEndpoint parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.NetworkEndpoint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.NetworkEndpoint 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.tpu.v1.NetworkEndpoint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.NetworkEndpoint 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.tpu.v1.NetworkEndpoint parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.NetworkEndpoint 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.tpu.v1.NetworkEndpoint 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 network endpoint over which a TPU worker can be reached.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.NetworkEndpoint} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.NetworkEndpoint) + com.google.cloud.tpu.v1.NetworkEndpointOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_NetworkEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_NetworkEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.NetworkEndpoint.class, + com.google.cloud.tpu.v1.NetworkEndpoint.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.NetworkEndpoint.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(); + ipAddress_ = ""; + + port_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_NetworkEndpoint_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.NetworkEndpoint getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.NetworkEndpoint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.NetworkEndpoint build() { + com.google.cloud.tpu.v1.NetworkEndpoint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.NetworkEndpoint buildPartial() { + com.google.cloud.tpu.v1.NetworkEndpoint result = + new com.google.cloud.tpu.v1.NetworkEndpoint(this); + result.ipAddress_ = ipAddress_; + result.port_ = port_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.NetworkEndpoint) { + return mergeFrom((com.google.cloud.tpu.v1.NetworkEndpoint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.NetworkEndpoint other) { + if (other == com.google.cloud.tpu.v1.NetworkEndpoint.getDefaultInstance()) return this; + if (!other.getIpAddress().isEmpty()) { + ipAddress_ = other.ipAddress_; + onChanged(); + } + if (other.getPort() != 0) { + setPort(other.getPort()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.NetworkEndpoint parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.NetworkEndpoint) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object ipAddress_ = ""; + /** + * + * + *
+     * The IP address of this network endpoint.
+     * 
+ * + * string ip_address = 1; + * + * @return The ipAddress. + */ + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The IP address of this network endpoint.
+     * 
+ * + * string ip_address = 1; + * + * @return The bytes for ipAddress. + */ + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The IP address of this network endpoint.
+     * 
+ * + * string ip_address = 1; + * + * @param value The ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ipAddress_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The IP address of this network endpoint.
+     * 
+ * + * string ip_address = 1; + * + * @return This builder for chaining. + */ + public Builder clearIpAddress() { + + ipAddress_ = getDefaultInstance().getIpAddress(); + onChanged(); + return this; + } + /** + * + * + *
+     * The IP address of this network endpoint.
+     * 
+ * + * string ip_address = 1; + * + * @param value The bytes for ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ipAddress_ = value; + onChanged(); + return this; + } + + private int port_; + /** + * + * + *
+     * The port of this network endpoint.
+     * 
+ * + * int32 port = 2; + * + * @return The port. + */ + @java.lang.Override + public int getPort() { + return port_; + } + /** + * + * + *
+     * The port of this network endpoint.
+     * 
+ * + * int32 port = 2; + * + * @param value The port to set. + * @return This builder for chaining. + */ + public Builder setPort(int value) { + + port_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The port of this network endpoint.
+     * 
+ * + * int32 port = 2; + * + * @return This builder for chaining. + */ + public Builder clearPort() { + + port_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.NetworkEndpoint) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.NetworkEndpoint) + private static final com.google.cloud.tpu.v1.NetworkEndpoint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.NetworkEndpoint(); + } + + public static com.google.cloud.tpu.v1.NetworkEndpoint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NetworkEndpoint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new NetworkEndpoint(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.tpu.v1.NetworkEndpoint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NetworkEndpointOrBuilder.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NetworkEndpointOrBuilder.java new file mode 100644 index 00000000..02f2f949 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NetworkEndpointOrBuilder.java @@ -0,0 +1,63 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface NetworkEndpointOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.NetworkEndpoint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The IP address of this network endpoint.
+   * 
+ * + * string ip_address = 1; + * + * @return The ipAddress. + */ + java.lang.String getIpAddress(); + /** + * + * + *
+   * The IP address of this network endpoint.
+   * 
+ * + * string ip_address = 1; + * + * @return The bytes for ipAddress. + */ + com.google.protobuf.ByteString getIpAddressBytes(); + + /** + * + * + *
+   * The port of this network endpoint.
+   * 
+ * + * int32 port = 2; + * + * @return The port. + */ + int getPort(); +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/Node.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/Node.java new file mode 100644 index 00000000..281cf259 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/Node.java @@ -0,0 +1,5800 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + * + * + *
+ * A TPU instance.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.Node} + */ +public final class Node extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.Node) + NodeOrBuilder { + private static final long serialVersionUID = 0L; + // Use Node.newBuilder() to construct. + private Node(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Node() { + name_ = ""; + description_ = ""; + acceleratorType_ = ""; + ipAddress_ = ""; + port_ = ""; + state_ = 0; + healthDescription_ = ""; + tensorflowVersion_ = ""; + network_ = ""; + cidrBlock_ = ""; + serviceAccount_ = ""; + networkEndpoints_ = java.util.Collections.emptyList(); + health_ = 0; + apiVersion_ = 0; + symptoms_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Node(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Node( + 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 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + acceleratorType_ = s; + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + ipAddress_ = s; + break; + } + case 72: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + + healthDescription_ = s; + break; + } + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + + tensorflowVersion_ = s; + break; + } + case 98: + { + java.lang.String s = input.readStringRequireUtf8(); + + network_ = s; + break; + } + case 106: + { + java.lang.String s = input.readStringRequireUtf8(); + + cidrBlock_ = s; + break; + } + case 114: + { + java.lang.String s = input.readStringRequireUtf8(); + + port_ = s; + break; + } + case 122: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceAccount_ = s; + break; + } + case 130: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 138: + { + com.google.cloud.tpu.v1.SchedulingConfig.Builder subBuilder = null; + if (schedulingConfig_ != null) { + subBuilder = schedulingConfig_.toBuilder(); + } + schedulingConfig_ = + input.readMessage( + com.google.cloud.tpu.v1.SchedulingConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(schedulingConfig_); + schedulingConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 170: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + networkEndpoints_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + networkEndpoints_.add( + input.readMessage( + com.google.cloud.tpu.v1.NetworkEndpoint.parser(), extensionRegistry)); + break; + } + case 176: + { + int rawValue = input.readEnum(); + + health_ = rawValue; + break; + } + case 194: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 216: + { + useServiceNetworking_ = input.readBool(); + break; + } + case 304: + { + int rawValue = input.readEnum(); + + apiVersion_ = rawValue; + break; + } + case 314: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + symptoms_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + symptoms_.add( + input.readMessage(com.google.cloud.tpu.v1.Symptom.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + networkEndpoints_ = java.util.Collections.unmodifiableList(networkEndpoints_); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + symptoms_ = java.util.Collections.unmodifiableList(symptoms_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_Node_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 24: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_Node_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.Node.class, com.google.cloud.tpu.v1.Node.Builder.class); + } + + /** + * + * + *
+   * Represents the different states of a TPU node during its lifecycle.
+   * 
+ * + * Protobuf enum {@code google.cloud.tpu.v1.Node.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * TPU node state is not known/set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * TPU node is being created.
+     * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + * + * + *
+     * TPU node has been created and is fully usable.
+     * 
+ * + * READY = 2; + */ + READY(2), + /** + * + * + *
+     * TPU node is restarting.
+     * 
+ * + * RESTARTING = 3; + */ + RESTARTING(3), + /** + * + * + *
+     * TPU node is undergoing reimaging.
+     * 
+ * + * REIMAGING = 4; + */ + REIMAGING(4), + /** + * + * + *
+     * TPU node is being deleted.
+     * 
+ * + * DELETING = 5; + */ + DELETING(5), + /** + * + * + *
+     * TPU node is being repaired and may be unusable. Details can be
+     * found in the `help_description` field.
+     * 
+ * + * REPAIRING = 6; + */ + REPAIRING(6), + /** + * + * + *
+     * TPU node is stopped.
+     * 
+ * + * STOPPED = 8; + */ + STOPPED(8), + /** + * + * + *
+     * TPU node is currently stopping.
+     * 
+ * + * STOPPING = 9; + */ + STOPPING(9), + /** + * + * + *
+     * TPU node is currently starting.
+     * 
+ * + * STARTING = 10; + */ + STARTING(10), + /** + * + * + *
+     * TPU node has been preempted. Only applies to Preemptible TPU Nodes.
+     * 
+ * + * PREEMPTED = 11; + */ + PREEMPTED(11), + /** + * + * + *
+     * TPU node has been terminated due to maintenance or has reached the end of
+     * its life cycle (for preemptible nodes).
+     * 
+ * + * TERMINATED = 12; + */ + TERMINATED(12), + /** + * + * + *
+     * TPU node is currently hiding.
+     * 
+ * + * HIDING = 13; + */ + HIDING(13), + /** + * + * + *
+     * TPU node has been hidden.
+     * 
+ * + * HIDDEN = 14; + */ + HIDDEN(14), + /** + * + * + *
+     * TPU node is currently unhiding.
+     * 
+ * + * UNHIDING = 15; + */ + UNHIDING(15), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * TPU node state is not known/set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * TPU node is being created.
+     * 
+ * + * CREATING = 1; + */ + public static final int CREATING_VALUE = 1; + /** + * + * + *
+     * TPU node has been created and is fully usable.
+     * 
+ * + * READY = 2; + */ + public static final int READY_VALUE = 2; + /** + * + * + *
+     * TPU node is restarting.
+     * 
+ * + * RESTARTING = 3; + */ + public static final int RESTARTING_VALUE = 3; + /** + * + * + *
+     * TPU node is undergoing reimaging.
+     * 
+ * + * REIMAGING = 4; + */ + public static final int REIMAGING_VALUE = 4; + /** + * + * + *
+     * TPU node is being deleted.
+     * 
+ * + * DELETING = 5; + */ + public static final int DELETING_VALUE = 5; + /** + * + * + *
+     * TPU node is being repaired and may be unusable. Details can be
+     * found in the `help_description` field.
+     * 
+ * + * REPAIRING = 6; + */ + public static final int REPAIRING_VALUE = 6; + /** + * + * + *
+     * TPU node is stopped.
+     * 
+ * + * STOPPED = 8; + */ + public static final int STOPPED_VALUE = 8; + /** + * + * + *
+     * TPU node is currently stopping.
+     * 
+ * + * STOPPING = 9; + */ + public static final int STOPPING_VALUE = 9; + /** + * + * + *
+     * TPU node is currently starting.
+     * 
+ * + * STARTING = 10; + */ + public static final int STARTING_VALUE = 10; + /** + * + * + *
+     * TPU node has been preempted. Only applies to Preemptible TPU Nodes.
+     * 
+ * + * PREEMPTED = 11; + */ + public static final int PREEMPTED_VALUE = 11; + /** + * + * + *
+     * TPU node has been terminated due to maintenance or has reached the end of
+     * its life cycle (for preemptible nodes).
+     * 
+ * + * TERMINATED = 12; + */ + public static final int TERMINATED_VALUE = 12; + /** + * + * + *
+     * TPU node is currently hiding.
+     * 
+ * + * HIDING = 13; + */ + public static final int HIDING_VALUE = 13; + /** + * + * + *
+     * TPU node has been hidden.
+     * 
+ * + * HIDDEN = 14; + */ + public static final int HIDDEN_VALUE = 14; + /** + * + * + *
+     * TPU node is currently unhiding.
+     * 
+ * + * UNHIDING = 15; + */ + public static final int UNHIDING_VALUE = 15; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return CREATING; + case 2: + return READY; + case 3: + return RESTARTING; + case 4: + return REIMAGING; + case 5: + return DELETING; + case 6: + return REPAIRING; + case 8: + return STOPPED; + case 9: + return STOPPING; + case 10: + return STARTING; + case 11: + return PREEMPTED; + case 12: + return TERMINATED; + case 13: + return HIDING; + case 14: + return HIDDEN; + case 15: + return UNHIDING; + 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.tpu.v1.Node.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.tpu.v1.Node.State) + } + + /** + * + * + *
+   * Health defines the status of a TPU node as reported by
+   * Health Monitor.
+   * 
+ * + * Protobuf enum {@code google.cloud.tpu.v1.Node.Health} + */ + public enum Health implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Health status is unknown: not initialized or failed to retrieve.
+     * 
+ * + * HEALTH_UNSPECIFIED = 0; + */ + HEALTH_UNSPECIFIED(0), + /** + * + * + *
+     * The resource is healthy.
+     * 
+ * + * HEALTHY = 1; + */ + HEALTHY(1), + /** + * + * + *
+     * The resource is unhealthy.
+     * 
+ * + * DEPRECATED_UNHEALTHY = 2; + */ + DEPRECATED_UNHEALTHY(2), + /** + * + * + *
+     * The resource is unresponsive.
+     * 
+ * + * TIMEOUT = 3; + */ + TIMEOUT(3), + /** + * + * + *
+     * The in-guest ML stack is unhealthy.
+     * 
+ * + * UNHEALTHY_TENSORFLOW = 4; + */ + UNHEALTHY_TENSORFLOW(4), + /** + * + * + *
+     * The node is under maintenance/priority boost caused rescheduling and
+     * will resume running once rescheduled.
+     * 
+ * + * UNHEALTHY_MAINTENANCE = 5; + */ + UNHEALTHY_MAINTENANCE(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Health status is unknown: not initialized or failed to retrieve.
+     * 
+ * + * HEALTH_UNSPECIFIED = 0; + */ + public static final int HEALTH_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The resource is healthy.
+     * 
+ * + * HEALTHY = 1; + */ + public static final int HEALTHY_VALUE = 1; + /** + * + * + *
+     * The resource is unhealthy.
+     * 
+ * + * DEPRECATED_UNHEALTHY = 2; + */ + public static final int DEPRECATED_UNHEALTHY_VALUE = 2; + /** + * + * + *
+     * The resource is unresponsive.
+     * 
+ * + * TIMEOUT = 3; + */ + public static final int TIMEOUT_VALUE = 3; + /** + * + * + *
+     * The in-guest ML stack is unhealthy.
+     * 
+ * + * UNHEALTHY_TENSORFLOW = 4; + */ + public static final int UNHEALTHY_TENSORFLOW_VALUE = 4; + /** + * + * + *
+     * The node is under maintenance/priority boost caused rescheduling and
+     * will resume running once rescheduled.
+     * 
+ * + * UNHEALTHY_MAINTENANCE = 5; + */ + public static final int UNHEALTHY_MAINTENANCE_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 Health 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 Health forNumber(int value) { + switch (value) { + case 0: + return HEALTH_UNSPECIFIED; + case 1: + return HEALTHY; + case 2: + return DEPRECATED_UNHEALTHY; + case 3: + return TIMEOUT; + case 4: + return UNHEALTHY_TENSORFLOW; + case 5: + return UNHEALTHY_MAINTENANCE; + 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 Health findValueByNumber(int number) { + return Health.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.tpu.v1.Node.getDescriptor().getEnumTypes().get(1); + } + + private static final Health[] VALUES = values(); + + public static Health 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 Health(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.tpu.v1.Node.Health) + } + + /** + * + * + *
+   * TPU API Version.
+   * 
+ * + * Protobuf enum {@code google.cloud.tpu.v1.Node.ApiVersion} + */ + public enum ApiVersion implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * API version is unknown.
+     * 
+ * + * API_VERSION_UNSPECIFIED = 0; + */ + API_VERSION_UNSPECIFIED(0), + /** + * + * + *
+     * TPU API V1Alpha1 version.
+     * 
+ * + * V1_ALPHA1 = 1; + */ + V1_ALPHA1(1), + /** + * + * + *
+     * TPU API V1 version.
+     * 
+ * + * V1 = 2; + */ + V1(2), + /** + * + * + *
+     * TPU API V2Alpha1 version.
+     * 
+ * + * V2_ALPHA1 = 3; + */ + V2_ALPHA1(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * API version is unknown.
+     * 
+ * + * API_VERSION_UNSPECIFIED = 0; + */ + public static final int API_VERSION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * TPU API V1Alpha1 version.
+     * 
+ * + * V1_ALPHA1 = 1; + */ + public static final int V1_ALPHA1_VALUE = 1; + /** + * + * + *
+     * TPU API V1 version.
+     * 
+ * + * V1 = 2; + */ + public static final int V1_VALUE = 2; + /** + * + * + *
+     * TPU API V2Alpha1 version.
+     * 
+ * + * V2_ALPHA1 = 3; + */ + public static final int V2_ALPHA1_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 ApiVersion 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 ApiVersion forNumber(int value) { + switch (value) { + case 0: + return API_VERSION_UNSPECIFIED; + case 1: + return V1_ALPHA1; + case 2: + return V1; + case 3: + return V2_ALPHA1; + 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 ApiVersion findValueByNumber(int number) { + return ApiVersion.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.tpu.v1.Node.getDescriptor().getEnumTypes().get(2); + } + + private static final ApiVersion[] VALUES = values(); + + public static ApiVersion 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 ApiVersion(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.tpu.v1.Node.ApiVersion) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. Immutable. The name of the TPU
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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; + } + } + /** + * + * + *
+   * Output only. Immutable. The name of the TPU
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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 DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + * + * + *
+   * The user-supplied description of the TPU. Maximum of 512 characters.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * The user-supplied description of the TPU. Maximum of 512 characters.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACCELERATOR_TYPE_FIELD_NUMBER = 5; + private volatile java.lang.Object acceleratorType_; + /** + * + * + *
+   * Required. The type of hardware accelerators associated with this node.
+   * 
+ * + * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The acceleratorType. + */ + @java.lang.Override + public java.lang.String getAcceleratorType() { + java.lang.Object ref = acceleratorType_; + 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(); + acceleratorType_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The type of hardware accelerators associated with this node.
+   * 
+ * + * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for acceleratorType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAcceleratorTypeBytes() { + java.lang.Object ref = acceleratorType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + acceleratorType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IP_ADDRESS_FIELD_NUMBER = 8; + private volatile java.lang.Object ipAddress_; + /** + * + * + *
+   * Output only. DEPRECATED! Use network_endpoints instead.
+   * The network address for the TPU Node as visible to Compute Engine
+   * instances.
+   * 
+ * + * string ip_address = 8 [deprecated = true]; + * + * @return The ipAddress. + */ + @java.lang.Override + @java.lang.Deprecated + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. DEPRECATED! Use network_endpoints instead.
+   * The network address for the TPU Node as visible to Compute Engine
+   * instances.
+   * 
+ * + * string ip_address = 8 [deprecated = true]; + * + * @return The bytes for ipAddress. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PORT_FIELD_NUMBER = 14; + private volatile java.lang.Object port_; + /** + * + * + *
+   * Output only. DEPRECATED! Use network_endpoints instead.
+   * The network port for the TPU Node as visible to Compute Engine instances.
+   * 
+ * + * string port = 14 [deprecated = true]; + * + * @return The port. + */ + @java.lang.Override + @java.lang.Deprecated + public java.lang.String getPort() { + java.lang.Object ref = port_; + 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(); + port_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. DEPRECATED! Use network_endpoints instead.
+   * The network port for the TPU Node as visible to Compute Engine instances.
+   * 
+ * + * string port = 14 [deprecated = true]; + * + * @return The bytes for port. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.ByteString getPortBytes() { + java.lang.Object ref = port_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + port_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 9; + private int state_; + /** + * + * + *
+   * Output only. The current state for the TPU Node.
+   * 
+ * + * .google.cloud.tpu.v1.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. The current state for the TPU Node.
+   * 
+ * + * .google.cloud.tpu.v1.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.tpu.v1.Node.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v1.Node.State result = com.google.cloud.tpu.v1.Node.State.valueOf(state_); + return result == null ? com.google.cloud.tpu.v1.Node.State.UNRECOGNIZED : result; + } + + public static final int HEALTH_DESCRIPTION_FIELD_NUMBER = 10; + private volatile java.lang.Object healthDescription_; + /** + * + * + *
+   * Output only. If this field is populated, it contains a description of why the TPU Node
+   * is unhealthy.
+   * 
+ * + * string health_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The healthDescription. + */ + @java.lang.Override + public java.lang.String getHealthDescription() { + java.lang.Object ref = healthDescription_; + 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(); + healthDescription_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. If this field is populated, it contains a description of why the TPU Node
+   * is unhealthy.
+   * 
+ * + * string health_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for healthDescription. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHealthDescriptionBytes() { + java.lang.Object ref = healthDescription_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + healthDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TENSORFLOW_VERSION_FIELD_NUMBER = 11; + private volatile java.lang.Object tensorflowVersion_; + /** + * + * + *
+   * Required. The version of Tensorflow running in the Node.
+   * 
+ * + * string tensorflow_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tensorflowVersion. + */ + @java.lang.Override + public java.lang.String getTensorflowVersion() { + java.lang.Object ref = tensorflowVersion_; + 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(); + tensorflowVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The version of Tensorflow running in the Node.
+   * 
+ * + * string tensorflow_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tensorflowVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTensorflowVersionBytes() { + java.lang.Object ref = tensorflowVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tensorflowVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NETWORK_FIELD_NUMBER = 12; + private volatile java.lang.Object network_; + /** + * + * + *
+   * The name of a network they wish to peer the TPU node to. It must be a
+   * preexisting Compute Engine network inside of the project on which this API
+   * has been activated. If none is provided, "default" will be used.
+   * 
+ * + * string network = 12; + * + * @return The network. + */ + @java.lang.Override + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + 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(); + network_ = s; + return s; + } + } + /** + * + * + *
+   * The name of a network they wish to peer the TPU node to. It must be a
+   * preexisting Compute Engine network inside of the project on which this API
+   * has been activated. If none is provided, "default" will be used.
+   * 
+ * + * string network = 12; + * + * @return The bytes for network. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CIDR_BLOCK_FIELD_NUMBER = 13; + private volatile java.lang.Object cidrBlock_; + /** + * + * + *
+   * The CIDR block that the TPU node will use when selecting an IP address.
+   * This CIDR block must be a /29 block; the Compute Engine networks API
+   * forbids a smaller block, and using a larger block would be wasteful (a
+   * node can only consume one IP address). Errors will occur if the CIDR block
+   * has already been used for a currently existing TPU node, the CIDR block
+   * conflicts with any subnetworks in the user's provided network, or the
+   * provided network is peered with another network that is using that CIDR
+   * block.
+   * 
+ * + * string cidr_block = 13; + * + * @return The cidrBlock. + */ + @java.lang.Override + public java.lang.String getCidrBlock() { + java.lang.Object ref = cidrBlock_; + 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(); + cidrBlock_ = s; + return s; + } + } + /** + * + * + *
+   * The CIDR block that the TPU node will use when selecting an IP address.
+   * This CIDR block must be a /29 block; the Compute Engine networks API
+   * forbids a smaller block, and using a larger block would be wasteful (a
+   * node can only consume one IP address). Errors will occur if the CIDR block
+   * has already been used for a currently existing TPU node, the CIDR block
+   * conflicts with any subnetworks in the user's provided network, or the
+   * provided network is peered with another network that is using that CIDR
+   * block.
+   * 
+ * + * string cidr_block = 13; + * + * @return The bytes for cidrBlock. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCidrBlockBytes() { + java.lang.Object ref = cidrBlock_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cidrBlock_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ACCOUNT_FIELD_NUMBER = 15; + private volatile java.lang.Object serviceAccount_; + /** + * + * + *
+   * Output only. The service account used to run the tensor flow services within the node.
+   * To share resources, including Google Cloud Storage data, with the
+   * Tensorflow job running in the Node, this account must have permissions to
+   * that data.
+   * 
+ * + * string service_account = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The serviceAccount. + */ + @java.lang.Override + public java.lang.String getServiceAccount() { + java.lang.Object ref = serviceAccount_; + 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(); + serviceAccount_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The service account used to run the tensor flow services within the node.
+   * To share resources, including Google Cloud Storage data, with the
+   * Tensorflow job running in the Node, this account must have permissions to
+   * that data.
+   * 
+ * + * string service_account = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for serviceAccount. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceAccountBytes() { + java.lang.Object ref = serviceAccount_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 16; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time when the node was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The time when the node was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The time when the node was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int SCHEDULING_CONFIG_FIELD_NUMBER = 17; + private com.google.cloud.tpu.v1.SchedulingConfig schedulingConfig_; + /** + * + * + *
+   * The scheduling options for this node.
+   * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + * + * @return Whether the schedulingConfig field is set. + */ + @java.lang.Override + public boolean hasSchedulingConfig() { + return schedulingConfig_ != null; + } + /** + * + * + *
+   * The scheduling options for this node.
+   * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + * + * @return The schedulingConfig. + */ + @java.lang.Override + public com.google.cloud.tpu.v1.SchedulingConfig getSchedulingConfig() { + return schedulingConfig_ == null + ? com.google.cloud.tpu.v1.SchedulingConfig.getDefaultInstance() + : schedulingConfig_; + } + /** + * + * + *
+   * The scheduling options for this node.
+   * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + */ + @java.lang.Override + public com.google.cloud.tpu.v1.SchedulingConfigOrBuilder getSchedulingConfigOrBuilder() { + return getSchedulingConfig(); + } + + public static final int NETWORK_ENDPOINTS_FIELD_NUMBER = 21; + private java.util.List networkEndpoints_; + /** + * + * + *
+   * Output only. The network endpoints where TPU workers can be accessed and
+   * sent work. It is recommended that Tensorflow clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getNetworkEndpointsList() { + return networkEndpoints_; + } + /** + * + * + *
+   * Output only. The network endpoints where TPU workers can be accessed and
+   * sent work. It is recommended that Tensorflow clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getNetworkEndpointsOrBuilderList() { + return networkEndpoints_; + } + /** + * + * + *
+   * Output only. The network endpoints where TPU workers can be accessed and
+   * sent work. It is recommended that Tensorflow clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getNetworkEndpointsCount() { + return networkEndpoints_.size(); + } + /** + * + * + *
+   * Output only. The network endpoints where TPU workers can be accessed and
+   * sent work. It is recommended that Tensorflow clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.tpu.v1.NetworkEndpoint getNetworkEndpoints(int index) { + return networkEndpoints_.get(index); + } + /** + * + * + *
+   * Output only. The network endpoints where TPU workers can be accessed and
+   * sent work. It is recommended that Tensorflow clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.tpu.v1.NetworkEndpointOrBuilder getNetworkEndpointsOrBuilder(int index) { + return networkEndpoints_.get(index); + } + + public static final int HEALTH_FIELD_NUMBER = 22; + private int health_; + /** + * + * + *
+   * The health status of the TPU node.
+   * 
+ * + * .google.cloud.tpu.v1.Node.Health health = 22; + * + * @return The enum numeric value on the wire for health. + */ + @java.lang.Override + public int getHealthValue() { + return health_; + } + /** + * + * + *
+   * The health status of the TPU node.
+   * 
+ * + * .google.cloud.tpu.v1.Node.Health health = 22; + * + * @return The health. + */ + @java.lang.Override + public com.google.cloud.tpu.v1.Node.Health getHealth() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v1.Node.Health result = + com.google.cloud.tpu.v1.Node.Health.valueOf(health_); + return result == null ? com.google.cloud.tpu.v1.Node.Health.UNRECOGNIZED : result; + } + + public static final int LABELS_FIELD_NUMBER = 24; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_Node_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Resource labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 24; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Resource labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 24; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Resource labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 24; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Resource labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 24; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int USE_SERVICE_NETWORKING_FIELD_NUMBER = 27; + private boolean useServiceNetworking_; + /** + * + * + *
+   * Whether the VPC peering for the node is set up through Service Networking
+   * API. The VPC Peering should be set up before provisioning the node.
+   * If this field is set, cidr_block field should not be specified. If the
+   * network, that you want to peer the TPU Node to, is Shared VPC networks,
+   * the node must be created with this this field enabled.
+   * 
+ * + * bool use_service_networking = 27; + * + * @return The useServiceNetworking. + */ + @java.lang.Override + public boolean getUseServiceNetworking() { + return useServiceNetworking_; + } + + public static final int API_VERSION_FIELD_NUMBER = 38; + private int apiVersion_; + /** + * + * + *
+   * Output only. The API version that created this Node.
+   * 
+ * + * + * .google.cloud.tpu.v1.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for apiVersion. + */ + @java.lang.Override + public int getApiVersionValue() { + return apiVersion_; + } + /** + * + * + *
+   * Output only. The API version that created this Node.
+   * 
+ * + * + * .google.cloud.tpu.v1.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The apiVersion. + */ + @java.lang.Override + public com.google.cloud.tpu.v1.Node.ApiVersion getApiVersion() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v1.Node.ApiVersion result = + com.google.cloud.tpu.v1.Node.ApiVersion.valueOf(apiVersion_); + return result == null ? com.google.cloud.tpu.v1.Node.ApiVersion.UNRECOGNIZED : result; + } + + public static final int SYMPTOMS_FIELD_NUMBER = 39; + private java.util.List symptoms_; + /** + * + * + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getSymptomsList() { + return symptoms_; + } + /** + * + * + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getSymptomsOrBuilderList() { + return symptoms_; + } + /** + * + * + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getSymptomsCount() { + return symptoms_.size(); + } + /** + * + * + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.tpu.v1.Symptom getSymptoms(int index) { + return symptoms_.get(index); + } + /** + * + * + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.tpu.v1.SymptomOrBuilder getSymptomsOrBuilder(int index) { + return symptoms_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (!getAcceleratorTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, acceleratorType_); + } + if (!getIpAddressBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, ipAddress_); + } + if (state_ != com.google.cloud.tpu.v1.Node.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(9, state_); + } + if (!getHealthDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, healthDescription_); + } + if (!getTensorflowVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, tensorflowVersion_); + } + if (!getNetworkBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, network_); + } + if (!getCidrBlockBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, cidrBlock_); + } + if (!getPortBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, port_); + } + if (!getServiceAccountBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, serviceAccount_); + } + if (createTime_ != null) { + output.writeMessage(16, getCreateTime()); + } + if (schedulingConfig_ != null) { + output.writeMessage(17, getSchedulingConfig()); + } + for (int i = 0; i < networkEndpoints_.size(); i++) { + output.writeMessage(21, networkEndpoints_.get(i)); + } + if (health_ != com.google.cloud.tpu.v1.Node.Health.HEALTH_UNSPECIFIED.getNumber()) { + output.writeEnum(22, health_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 24); + if (useServiceNetworking_ != false) { + output.writeBool(27, useServiceNetworking_); + } + if (apiVersion_ + != com.google.cloud.tpu.v1.Node.ApiVersion.API_VERSION_UNSPECIFIED.getNumber()) { + output.writeEnum(38, apiVersion_); + } + for (int i = 0; i < symptoms_.size(); i++) { + output.writeMessage(39, symptoms_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (!getAcceleratorTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, acceleratorType_); + } + if (!getIpAddressBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, ipAddress_); + } + if (state_ != com.google.cloud.tpu.v1.Node.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, state_); + } + if (!getHealthDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, healthDescription_); + } + if (!getTensorflowVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, tensorflowVersion_); + } + if (!getNetworkBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, network_); + } + if (!getCidrBlockBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, cidrBlock_); + } + if (!getPortBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, port_); + } + if (!getServiceAccountBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, serviceAccount_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, getCreateTime()); + } + if (schedulingConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, getSchedulingConfig()); + } + for (int i = 0; i < networkEndpoints_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(21, networkEndpoints_.get(i)); + } + if (health_ != com.google.cloud.tpu.v1.Node.Health.HEALTH_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(22, health_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(24, labels__); + } + if (useServiceNetworking_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(27, useServiceNetworking_); + } + if (apiVersion_ + != com.google.cloud.tpu.v1.Node.ApiVersion.API_VERSION_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(38, apiVersion_); + } + for (int i = 0; i < symptoms_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(39, symptoms_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.tpu.v1.Node)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.Node other = (com.google.cloud.tpu.v1.Node) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getAcceleratorType().equals(other.getAcceleratorType())) return false; + if (!getIpAddress().equals(other.getIpAddress())) return false; + if (!getPort().equals(other.getPort())) return false; + if (state_ != other.state_) return false; + if (!getHealthDescription().equals(other.getHealthDescription())) return false; + if (!getTensorflowVersion().equals(other.getTensorflowVersion())) return false; + if (!getNetwork().equals(other.getNetwork())) return false; + if (!getCidrBlock().equals(other.getCidrBlock())) return false; + if (!getServiceAccount().equals(other.getServiceAccount())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasSchedulingConfig() != other.hasSchedulingConfig()) return false; + if (hasSchedulingConfig()) { + if (!getSchedulingConfig().equals(other.getSchedulingConfig())) return false; + } + if (!getNetworkEndpointsList().equals(other.getNetworkEndpointsList())) return false; + if (health_ != other.health_) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (getUseServiceNetworking() != other.getUseServiceNetworking()) return false; + if (apiVersion_ != other.apiVersion_) return false; + if (!getSymptomsList().equals(other.getSymptomsList())) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + ACCELERATOR_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getAcceleratorType().hashCode(); + hash = (37 * hash) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().hashCode(); + hash = (37 * hash) + PORT_FIELD_NUMBER; + hash = (53 * hash) + getPort().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + HEALTH_DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getHealthDescription().hashCode(); + hash = (37 * hash) + TENSORFLOW_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getTensorflowVersion().hashCode(); + hash = (37 * hash) + NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getNetwork().hashCode(); + hash = (37 * hash) + CIDR_BLOCK_FIELD_NUMBER; + hash = (53 * hash) + getCidrBlock().hashCode(); + hash = (37 * hash) + SERVICE_ACCOUNT_FIELD_NUMBER; + hash = (53 * hash) + getServiceAccount().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasSchedulingConfig()) { + hash = (37 * hash) + SCHEDULING_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getSchedulingConfig().hashCode(); + } + if (getNetworkEndpointsCount() > 0) { + hash = (37 * hash) + NETWORK_ENDPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getNetworkEndpointsList().hashCode(); + } + hash = (37 * hash) + HEALTH_FIELD_NUMBER; + hash = (53 * hash) + health_; + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + USE_SERVICE_NETWORKING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUseServiceNetworking()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + apiVersion_; + if (getSymptomsCount() > 0) { + hash = (37 * hash) + SYMPTOMS_FIELD_NUMBER; + hash = (53 * hash) + getSymptomsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.Node parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.Node 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.tpu.v1.Node parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.Node 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.tpu.v1.Node parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.Node parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.Node parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.Node 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.tpu.v1.Node parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.Node 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.tpu.v1.Node parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.Node 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.tpu.v1.Node 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 TPU instance.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.Node} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.Node) + com.google.cloud.tpu.v1.NodeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_Node_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 24: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 24: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_Node_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.Node.class, com.google.cloud.tpu.v1.Node.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.Node.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getNetworkEndpointsFieldBuilder(); + getSymptomsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + description_ = ""; + + acceleratorType_ = ""; + + ipAddress_ = ""; + + port_ = ""; + + state_ = 0; + + healthDescription_ = ""; + + tensorflowVersion_ = ""; + + network_ = ""; + + cidrBlock_ = ""; + + serviceAccount_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (schedulingConfigBuilder_ == null) { + schedulingConfig_ = null; + } else { + schedulingConfig_ = null; + schedulingConfigBuilder_ = null; + } + if (networkEndpointsBuilder_ == null) { + networkEndpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + networkEndpointsBuilder_.clear(); + } + health_ = 0; + + internalGetMutableLabels().clear(); + useServiceNetworking_ = false; + + apiVersion_ = 0; + + if (symptomsBuilder_ == null) { + symptoms_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + symptomsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_Node_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.Node getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.Node.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.Node build() { + com.google.cloud.tpu.v1.Node result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.Node buildPartial() { + com.google.cloud.tpu.v1.Node result = new com.google.cloud.tpu.v1.Node(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.description_ = description_; + result.acceleratorType_ = acceleratorType_; + result.ipAddress_ = ipAddress_; + result.port_ = port_; + result.state_ = state_; + result.healthDescription_ = healthDescription_; + result.tensorflowVersion_ = tensorflowVersion_; + result.network_ = network_; + result.cidrBlock_ = cidrBlock_; + result.serviceAccount_ = serviceAccount_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (schedulingConfigBuilder_ == null) { + result.schedulingConfig_ = schedulingConfig_; + } else { + result.schedulingConfig_ = schedulingConfigBuilder_.build(); + } + if (networkEndpointsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + networkEndpoints_ = java.util.Collections.unmodifiableList(networkEndpoints_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.networkEndpoints_ = networkEndpoints_; + } else { + result.networkEndpoints_ = networkEndpointsBuilder_.build(); + } + result.health_ = health_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.useServiceNetworking_ = useServiceNetworking_; + result.apiVersion_ = apiVersion_; + if (symptomsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + symptoms_ = java.util.Collections.unmodifiableList(symptoms_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.symptoms_ = symptoms_; + } else { + result.symptoms_ = symptomsBuilder_.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.tpu.v1.Node) { + return mergeFrom((com.google.cloud.tpu.v1.Node) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.Node other) { + if (other == com.google.cloud.tpu.v1.Node.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (!other.getAcceleratorType().isEmpty()) { + acceleratorType_ = other.acceleratorType_; + onChanged(); + } + if (!other.getIpAddress().isEmpty()) { + ipAddress_ = other.ipAddress_; + onChanged(); + } + if (!other.getPort().isEmpty()) { + port_ = other.port_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getHealthDescription().isEmpty()) { + healthDescription_ = other.healthDescription_; + onChanged(); + } + if (!other.getTensorflowVersion().isEmpty()) { + tensorflowVersion_ = other.tensorflowVersion_; + onChanged(); + } + if (!other.getNetwork().isEmpty()) { + network_ = other.network_; + onChanged(); + } + if (!other.getCidrBlock().isEmpty()) { + cidrBlock_ = other.cidrBlock_; + onChanged(); + } + if (!other.getServiceAccount().isEmpty()) { + serviceAccount_ = other.serviceAccount_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasSchedulingConfig()) { + mergeSchedulingConfig(other.getSchedulingConfig()); + } + if (networkEndpointsBuilder_ == null) { + if (!other.networkEndpoints_.isEmpty()) { + if (networkEndpoints_.isEmpty()) { + networkEndpoints_ = other.networkEndpoints_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNetworkEndpointsIsMutable(); + networkEndpoints_.addAll(other.networkEndpoints_); + } + onChanged(); + } + } else { + if (!other.networkEndpoints_.isEmpty()) { + if (networkEndpointsBuilder_.isEmpty()) { + networkEndpointsBuilder_.dispose(); + networkEndpointsBuilder_ = null; + networkEndpoints_ = other.networkEndpoints_; + bitField0_ = (bitField0_ & ~0x00000001); + networkEndpointsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNetworkEndpointsFieldBuilder() + : null; + } else { + networkEndpointsBuilder_.addAllMessages(other.networkEndpoints_); + } + } + } + if (other.health_ != 0) { + setHealthValue(other.getHealthValue()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (other.getUseServiceNetworking() != false) { + setUseServiceNetworking(other.getUseServiceNetworking()); + } + if (other.apiVersion_ != 0) { + setApiVersionValue(other.getApiVersionValue()); + } + if (symptomsBuilder_ == null) { + if (!other.symptoms_.isEmpty()) { + if (symptoms_.isEmpty()) { + symptoms_ = other.symptoms_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureSymptomsIsMutable(); + symptoms_.addAll(other.symptoms_); + } + onChanged(); + } + } else { + if (!other.symptoms_.isEmpty()) { + if (symptomsBuilder_.isEmpty()) { + symptomsBuilder_.dispose(); + symptomsBuilder_ = null; + symptoms_ = other.symptoms_; + bitField0_ = (bitField0_ & ~0x00000004); + symptomsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSymptomsFieldBuilder() + : null; + } else { + symptomsBuilder_.addAllMessages(other.symptoms_); + } + } + } + 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.tpu.v1.Node parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.Node) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. Immutable. The name of the TPU
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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; + } + } + /** + * + * + *
+     * Output only. Immutable. The name of the TPU
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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; + } + } + /** + * + * + *
+     * Output only. Immutable. The name of the TPU
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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; + } + /** + * + * + *
+     * Output only. Immutable. The name of the TPU
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. The name of the TPU
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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 description_ = ""; + /** + * + * + *
+     * The user-supplied description of the TPU. Maximum of 512 characters.
+     * 
+ * + * string description = 3; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The user-supplied description of the TPU. Maximum of 512 characters.
+     * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The user-supplied description of the TPU. Maximum of 512 characters.
+     * 
+ * + * string description = 3; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The user-supplied description of the TPU. Maximum of 512 characters.
+     * 
+ * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * The user-supplied description of the TPU. Maximum of 512 characters.
+     * 
+ * + * string description = 3; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.lang.Object acceleratorType_ = ""; + /** + * + * + *
+     * Required. The type of hardware accelerators associated with this node.
+     * 
+ * + * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The acceleratorType. + */ + public java.lang.String getAcceleratorType() { + java.lang.Object ref = acceleratorType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + acceleratorType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The type of hardware accelerators associated with this node.
+     * 
+ * + * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for acceleratorType. + */ + public com.google.protobuf.ByteString getAcceleratorTypeBytes() { + java.lang.Object ref = acceleratorType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + acceleratorType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The type of hardware accelerators associated with this node.
+     * 
+ * + * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The acceleratorType to set. + * @return This builder for chaining. + */ + public Builder setAcceleratorType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + acceleratorType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of hardware accelerators associated with this node.
+     * 
+ * + * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearAcceleratorType() { + + acceleratorType_ = getDefaultInstance().getAcceleratorType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of hardware accelerators associated with this node.
+     * 
+ * + * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for acceleratorType to set. + * @return This builder for chaining. + */ + public Builder setAcceleratorTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + acceleratorType_ = value; + onChanged(); + return this; + } + + private java.lang.Object ipAddress_ = ""; + /** + * + * + *
+     * Output only. DEPRECATED! Use network_endpoints instead.
+     * The network address for the TPU Node as visible to Compute Engine
+     * instances.
+     * 
+ * + * string ip_address = 8 [deprecated = true]; + * + * @return The ipAddress. + */ + @java.lang.Deprecated + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. DEPRECATED! Use network_endpoints instead.
+     * The network address for the TPU Node as visible to Compute Engine
+     * instances.
+     * 
+ * + * string ip_address = 8 [deprecated = true]; + * + * @return The bytes for ipAddress. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. DEPRECATED! Use network_endpoints instead.
+     * The network address for the TPU Node as visible to Compute Engine
+     * instances.
+     * 
+ * + * string ip_address = 8 [deprecated = true]; + * + * @param value The ipAddress to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setIpAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ipAddress_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. DEPRECATED! Use network_endpoints instead.
+     * The network address for the TPU Node as visible to Compute Engine
+     * instances.
+     * 
+ * + * string ip_address = 8 [deprecated = true]; + * + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearIpAddress() { + + ipAddress_ = getDefaultInstance().getIpAddress(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. DEPRECATED! Use network_endpoints instead.
+     * The network address for the TPU Node as visible to Compute Engine
+     * instances.
+     * 
+ * + * string ip_address = 8 [deprecated = true]; + * + * @param value The bytes for ipAddress to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setIpAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ipAddress_ = value; + onChanged(); + return this; + } + + private java.lang.Object port_ = ""; + /** + * + * + *
+     * Output only. DEPRECATED! Use network_endpoints instead.
+     * The network port for the TPU Node as visible to Compute Engine instances.
+     * 
+ * + * string port = 14 [deprecated = true]; + * + * @return The port. + */ + @java.lang.Deprecated + public java.lang.String getPort() { + java.lang.Object ref = port_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + port_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. DEPRECATED! Use network_endpoints instead.
+     * The network port for the TPU Node as visible to Compute Engine instances.
+     * 
+ * + * string port = 14 [deprecated = true]; + * + * @return The bytes for port. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getPortBytes() { + java.lang.Object ref = port_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + port_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. DEPRECATED! Use network_endpoints instead.
+     * The network port for the TPU Node as visible to Compute Engine instances.
+     * 
+ * + * string port = 14 [deprecated = true]; + * + * @param value The port to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setPort(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + port_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. DEPRECATED! Use network_endpoints instead.
+     * The network port for the TPU Node as visible to Compute Engine instances.
+     * 
+ * + * string port = 14 [deprecated = true]; + * + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearPort() { + + port_ = getDefaultInstance().getPort(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. DEPRECATED! Use network_endpoints instead.
+     * The network port for the TPU Node as visible to Compute Engine instances.
+     * 
+ * + * string port = 14 [deprecated = true]; + * + * @param value The bytes for port to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setPortBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + port_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The current state for the TPU Node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. The current state for the TPU Node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state for the TPU Node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.tpu.v1.Node.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v1.Node.State result = + com.google.cloud.tpu.v1.Node.State.valueOf(state_); + return result == null ? com.google.cloud.tpu.v1.Node.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The current state for the TPU Node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.tpu.v1.Node.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state for the TPU Node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object healthDescription_ = ""; + /** + * + * + *
+     * Output only. If this field is populated, it contains a description of why the TPU Node
+     * is unhealthy.
+     * 
+ * + * string health_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The healthDescription. + */ + public java.lang.String getHealthDescription() { + java.lang.Object ref = healthDescription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + healthDescription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. If this field is populated, it contains a description of why the TPU Node
+     * is unhealthy.
+     * 
+ * + * string health_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for healthDescription. + */ + public com.google.protobuf.ByteString getHealthDescriptionBytes() { + java.lang.Object ref = healthDescription_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + healthDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. If this field is populated, it contains a description of why the TPU Node
+     * is unhealthy.
+     * 
+ * + * string health_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The healthDescription to set. + * @return This builder for chaining. + */ + public Builder setHealthDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + healthDescription_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. If this field is populated, it contains a description of why the TPU Node
+     * is unhealthy.
+     * 
+ * + * string health_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearHealthDescription() { + + healthDescription_ = getDefaultInstance().getHealthDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. If this field is populated, it contains a description of why the TPU Node
+     * is unhealthy.
+     * 
+ * + * string health_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for healthDescription to set. + * @return This builder for chaining. + */ + public Builder setHealthDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + healthDescription_ = value; + onChanged(); + return this; + } + + private java.lang.Object tensorflowVersion_ = ""; + /** + * + * + *
+     * Required. The version of Tensorflow running in the Node.
+     * 
+ * + * string tensorflow_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tensorflowVersion. + */ + public java.lang.String getTensorflowVersion() { + java.lang.Object ref = tensorflowVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tensorflowVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The version of Tensorflow running in the Node.
+     * 
+ * + * string tensorflow_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tensorflowVersion. + */ + public com.google.protobuf.ByteString getTensorflowVersionBytes() { + java.lang.Object ref = tensorflowVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tensorflowVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The version of Tensorflow running in the Node.
+     * 
+ * + * string tensorflow_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The tensorflowVersion to set. + * @return This builder for chaining. + */ + public Builder setTensorflowVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + tensorflowVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The version of Tensorflow running in the Node.
+     * 
+ * + * string tensorflow_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearTensorflowVersion() { + + tensorflowVersion_ = getDefaultInstance().getTensorflowVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The version of Tensorflow running in the Node.
+     * 
+ * + * string tensorflow_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for tensorflowVersion to set. + * @return This builder for chaining. + */ + public Builder setTensorflowVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + tensorflowVersion_ = value; + onChanged(); + return this; + } + + private java.lang.Object network_ = ""; + /** + * + * + *
+     * The name of a network they wish to peer the TPU node to. It must be a
+     * preexisting Compute Engine network inside of the project on which this API
+     * has been activated. If none is provided, "default" will be used.
+     * 
+ * + * string network = 12; + * + * @return The network. + */ + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of a network they wish to peer the TPU node to. It must be a
+     * preexisting Compute Engine network inside of the project on which this API
+     * has been activated. If none is provided, "default" will be used.
+     * 
+ * + * string network = 12; + * + * @return The bytes for network. + */ + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of a network they wish to peer the TPU node to. It must be a
+     * preexisting Compute Engine network inside of the project on which this API
+     * has been activated. If none is provided, "default" will be used.
+     * 
+ * + * string network = 12; + * + * @param value The network to set. + * @return This builder for chaining. + */ + public Builder setNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + network_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of a network they wish to peer the TPU node to. It must be a
+     * preexisting Compute Engine network inside of the project on which this API
+     * has been activated. If none is provided, "default" will be used.
+     * 
+ * + * string network = 12; + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + + network_ = getDefaultInstance().getNetwork(); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of a network they wish to peer the TPU node to. It must be a
+     * preexisting Compute Engine network inside of the project on which this API
+     * has been activated. If none is provided, "default" will be used.
+     * 
+ * + * string network = 12; + * + * @param value The bytes for network to set. + * @return This builder for chaining. + */ + public Builder setNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + network_ = value; + onChanged(); + return this; + } + + private java.lang.Object cidrBlock_ = ""; + /** + * + * + *
+     * The CIDR block that the TPU node will use when selecting an IP address.
+     * This CIDR block must be a /29 block; the Compute Engine networks API
+     * forbids a smaller block, and using a larger block would be wasteful (a
+     * node can only consume one IP address). Errors will occur if the CIDR block
+     * has already been used for a currently existing TPU node, the CIDR block
+     * conflicts with any subnetworks in the user's provided network, or the
+     * provided network is peered with another network that is using that CIDR
+     * block.
+     * 
+ * + * string cidr_block = 13; + * + * @return The cidrBlock. + */ + public java.lang.String getCidrBlock() { + java.lang.Object ref = cidrBlock_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cidrBlock_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The CIDR block that the TPU node will use when selecting an IP address.
+     * This CIDR block must be a /29 block; the Compute Engine networks API
+     * forbids a smaller block, and using a larger block would be wasteful (a
+     * node can only consume one IP address). Errors will occur if the CIDR block
+     * has already been used for a currently existing TPU node, the CIDR block
+     * conflicts with any subnetworks in the user's provided network, or the
+     * provided network is peered with another network that is using that CIDR
+     * block.
+     * 
+ * + * string cidr_block = 13; + * + * @return The bytes for cidrBlock. + */ + public com.google.protobuf.ByteString getCidrBlockBytes() { + java.lang.Object ref = cidrBlock_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cidrBlock_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The CIDR block that the TPU node will use when selecting an IP address.
+     * This CIDR block must be a /29 block; the Compute Engine networks API
+     * forbids a smaller block, and using a larger block would be wasteful (a
+     * node can only consume one IP address). Errors will occur if the CIDR block
+     * has already been used for a currently existing TPU node, the CIDR block
+     * conflicts with any subnetworks in the user's provided network, or the
+     * provided network is peered with another network that is using that CIDR
+     * block.
+     * 
+ * + * string cidr_block = 13; + * + * @param value The cidrBlock to set. + * @return This builder for chaining. + */ + public Builder setCidrBlock(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + cidrBlock_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The CIDR block that the TPU node will use when selecting an IP address.
+     * This CIDR block must be a /29 block; the Compute Engine networks API
+     * forbids a smaller block, and using a larger block would be wasteful (a
+     * node can only consume one IP address). Errors will occur if the CIDR block
+     * has already been used for a currently existing TPU node, the CIDR block
+     * conflicts with any subnetworks in the user's provided network, or the
+     * provided network is peered with another network that is using that CIDR
+     * block.
+     * 
+ * + * string cidr_block = 13; + * + * @return This builder for chaining. + */ + public Builder clearCidrBlock() { + + cidrBlock_ = getDefaultInstance().getCidrBlock(); + onChanged(); + return this; + } + /** + * + * + *
+     * The CIDR block that the TPU node will use when selecting an IP address.
+     * This CIDR block must be a /29 block; the Compute Engine networks API
+     * forbids a smaller block, and using a larger block would be wasteful (a
+     * node can only consume one IP address). Errors will occur if the CIDR block
+     * has already been used for a currently existing TPU node, the CIDR block
+     * conflicts with any subnetworks in the user's provided network, or the
+     * provided network is peered with another network that is using that CIDR
+     * block.
+     * 
+ * + * string cidr_block = 13; + * + * @param value The bytes for cidrBlock to set. + * @return This builder for chaining. + */ + public Builder setCidrBlockBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + cidrBlock_ = value; + onChanged(); + return this; + } + + private java.lang.Object serviceAccount_ = ""; + /** + * + * + *
+     * Output only. The service account used to run the tensor flow services within the node.
+     * To share resources, including Google Cloud Storage data, with the
+     * Tensorflow job running in the Node, this account must have permissions to
+     * that data.
+     * 
+ * + * string service_account = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The serviceAccount. + */ + public java.lang.String getServiceAccount() { + java.lang.Object ref = serviceAccount_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccount_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The service account used to run the tensor flow services within the node.
+     * To share resources, including Google Cloud Storage data, with the
+     * Tensorflow job running in the Node, this account must have permissions to
+     * that data.
+     * 
+ * + * string service_account = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for serviceAccount. + */ + public com.google.protobuf.ByteString getServiceAccountBytes() { + java.lang.Object ref = serviceAccount_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The service account used to run the tensor flow services within the node.
+     * To share resources, including Google Cloud Storage data, with the
+     * Tensorflow job running in the Node, this account must have permissions to
+     * that data.
+     * 
+ * + * string service_account = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The serviceAccount to set. + * @return This builder for chaining. + */ + public Builder setServiceAccount(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceAccount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The service account used to run the tensor flow services within the node.
+     * To share resources, including Google Cloud Storage data, with the
+     * Tensorflow job running in the Node, this account must have permissions to
+     * that data.
+     * 
+ * + * string service_account = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearServiceAccount() { + + serviceAccount_ = getDefaultInstance().getServiceAccount(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The service account used to run the tensor flow services within the node.
+     * To share resources, including Google Cloud Storage data, with the
+     * Tensorflow job running in the Node, this account must have permissions to
+     * that data.
+     * 
+ * + * string service_account = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for serviceAccount to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceAccount_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The time when the node was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The time when the node was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time when the node was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the node was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the node was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the node was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the node was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the node was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The time when the node was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.cloud.tpu.v1.SchedulingConfig schedulingConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v1.SchedulingConfig, + com.google.cloud.tpu.v1.SchedulingConfig.Builder, + com.google.cloud.tpu.v1.SchedulingConfigOrBuilder> + schedulingConfigBuilder_; + /** + * + * + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + * + * @return Whether the schedulingConfig field is set. + */ + public boolean hasSchedulingConfig() { + return schedulingConfigBuilder_ != null || schedulingConfig_ != null; + } + /** + * + * + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + * + * @return The schedulingConfig. + */ + public com.google.cloud.tpu.v1.SchedulingConfig getSchedulingConfig() { + if (schedulingConfigBuilder_ == null) { + return schedulingConfig_ == null + ? com.google.cloud.tpu.v1.SchedulingConfig.getDefaultInstance() + : schedulingConfig_; + } else { + return schedulingConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + */ + public Builder setSchedulingConfig(com.google.cloud.tpu.v1.SchedulingConfig value) { + if (schedulingConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + schedulingConfig_ = value; + onChanged(); + } else { + schedulingConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + */ + public Builder setSchedulingConfig( + com.google.cloud.tpu.v1.SchedulingConfig.Builder builderForValue) { + if (schedulingConfigBuilder_ == null) { + schedulingConfig_ = builderForValue.build(); + onChanged(); + } else { + schedulingConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + */ + public Builder mergeSchedulingConfig(com.google.cloud.tpu.v1.SchedulingConfig value) { + if (schedulingConfigBuilder_ == null) { + if (schedulingConfig_ != null) { + schedulingConfig_ = + com.google.cloud.tpu.v1.SchedulingConfig.newBuilder(schedulingConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + schedulingConfig_ = value; + } + onChanged(); + } else { + schedulingConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + */ + public Builder clearSchedulingConfig() { + if (schedulingConfigBuilder_ == null) { + schedulingConfig_ = null; + onChanged(); + } else { + schedulingConfig_ = null; + schedulingConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + */ + public com.google.cloud.tpu.v1.SchedulingConfig.Builder getSchedulingConfigBuilder() { + + onChanged(); + return getSchedulingConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + */ + public com.google.cloud.tpu.v1.SchedulingConfigOrBuilder getSchedulingConfigOrBuilder() { + if (schedulingConfigBuilder_ != null) { + return schedulingConfigBuilder_.getMessageOrBuilder(); + } else { + return schedulingConfig_ == null + ? com.google.cloud.tpu.v1.SchedulingConfig.getDefaultInstance() + : schedulingConfig_; + } + } + /** + * + * + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v1.SchedulingConfig, + com.google.cloud.tpu.v1.SchedulingConfig.Builder, + com.google.cloud.tpu.v1.SchedulingConfigOrBuilder> + getSchedulingConfigFieldBuilder() { + if (schedulingConfigBuilder_ == null) { + schedulingConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v1.SchedulingConfig, + com.google.cloud.tpu.v1.SchedulingConfig.Builder, + com.google.cloud.tpu.v1.SchedulingConfigOrBuilder>( + getSchedulingConfig(), getParentForChildren(), isClean()); + schedulingConfig_ = null; + } + return schedulingConfigBuilder_; + } + + private java.util.List networkEndpoints_ = + java.util.Collections.emptyList(); + + private void ensureNetworkEndpointsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + networkEndpoints_ = + new java.util.ArrayList(networkEndpoints_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.NetworkEndpoint, + com.google.cloud.tpu.v1.NetworkEndpoint.Builder, + com.google.cloud.tpu.v1.NetworkEndpointOrBuilder> + networkEndpointsBuilder_; + + /** + * + * + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getNetworkEndpointsList() { + if (networkEndpointsBuilder_ == null) { + return java.util.Collections.unmodifiableList(networkEndpoints_); + } else { + return networkEndpointsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getNetworkEndpointsCount() { + if (networkEndpointsBuilder_ == null) { + return networkEndpoints_.size(); + } else { + return networkEndpointsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v1.NetworkEndpoint getNetworkEndpoints(int index) { + if (networkEndpointsBuilder_ == null) { + return networkEndpoints_.get(index); + } else { + return networkEndpointsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNetworkEndpoints(int index, com.google.cloud.tpu.v1.NetworkEndpoint value) { + if (networkEndpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNetworkEndpointsIsMutable(); + networkEndpoints_.set(index, value); + onChanged(); + } else { + networkEndpointsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNetworkEndpoints( + int index, com.google.cloud.tpu.v1.NetworkEndpoint.Builder builderForValue) { + if (networkEndpointsBuilder_ == null) { + ensureNetworkEndpointsIsMutable(); + networkEndpoints_.set(index, builderForValue.build()); + onChanged(); + } else { + networkEndpointsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNetworkEndpoints(com.google.cloud.tpu.v1.NetworkEndpoint value) { + if (networkEndpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNetworkEndpointsIsMutable(); + networkEndpoints_.add(value); + onChanged(); + } else { + networkEndpointsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNetworkEndpoints(int index, com.google.cloud.tpu.v1.NetworkEndpoint value) { + if (networkEndpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNetworkEndpointsIsMutable(); + networkEndpoints_.add(index, value); + onChanged(); + } else { + networkEndpointsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNetworkEndpoints( + com.google.cloud.tpu.v1.NetworkEndpoint.Builder builderForValue) { + if (networkEndpointsBuilder_ == null) { + ensureNetworkEndpointsIsMutable(); + networkEndpoints_.add(builderForValue.build()); + onChanged(); + } else { + networkEndpointsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNetworkEndpoints( + int index, com.google.cloud.tpu.v1.NetworkEndpoint.Builder builderForValue) { + if (networkEndpointsBuilder_ == null) { + ensureNetworkEndpointsIsMutable(); + networkEndpoints_.add(index, builderForValue.build()); + onChanged(); + } else { + networkEndpointsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllNetworkEndpoints( + java.lang.Iterable values) { + if (networkEndpointsBuilder_ == null) { + ensureNetworkEndpointsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, networkEndpoints_); + onChanged(); + } else { + networkEndpointsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearNetworkEndpoints() { + if (networkEndpointsBuilder_ == null) { + networkEndpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + networkEndpointsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeNetworkEndpoints(int index) { + if (networkEndpointsBuilder_ == null) { + ensureNetworkEndpointsIsMutable(); + networkEndpoints_.remove(index); + onChanged(); + } else { + networkEndpointsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v1.NetworkEndpoint.Builder getNetworkEndpointsBuilder(int index) { + return getNetworkEndpointsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v1.NetworkEndpointOrBuilder getNetworkEndpointsOrBuilder( + int index) { + if (networkEndpointsBuilder_ == null) { + return networkEndpoints_.get(index); + } else { + return networkEndpointsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getNetworkEndpointsOrBuilderList() { + if (networkEndpointsBuilder_ != null) { + return networkEndpointsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(networkEndpoints_); + } + } + /** + * + * + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v1.NetworkEndpoint.Builder addNetworkEndpointsBuilder() { + return getNetworkEndpointsFieldBuilder() + .addBuilder(com.google.cloud.tpu.v1.NetworkEndpoint.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v1.NetworkEndpoint.Builder addNetworkEndpointsBuilder(int index) { + return getNetworkEndpointsFieldBuilder() + .addBuilder(index, com.google.cloud.tpu.v1.NetworkEndpoint.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getNetworkEndpointsBuilderList() { + return getNetworkEndpointsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.NetworkEndpoint, + com.google.cloud.tpu.v1.NetworkEndpoint.Builder, + com.google.cloud.tpu.v1.NetworkEndpointOrBuilder> + getNetworkEndpointsFieldBuilder() { + if (networkEndpointsBuilder_ == null) { + networkEndpointsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.NetworkEndpoint, + com.google.cloud.tpu.v1.NetworkEndpoint.Builder, + com.google.cloud.tpu.v1.NetworkEndpointOrBuilder>( + networkEndpoints_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + networkEndpoints_ = null; + } + return networkEndpointsBuilder_; + } + + private int health_ = 0; + /** + * + * + *
+     * The health status of the TPU node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.Health health = 22; + * + * @return The enum numeric value on the wire for health. + */ + @java.lang.Override + public int getHealthValue() { + return health_; + } + /** + * + * + *
+     * The health status of the TPU node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.Health health = 22; + * + * @param value The enum numeric value on the wire for health to set. + * @return This builder for chaining. + */ + public Builder setHealthValue(int value) { + + health_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The health status of the TPU node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.Health health = 22; + * + * @return The health. + */ + @java.lang.Override + public com.google.cloud.tpu.v1.Node.Health getHealth() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v1.Node.Health result = + com.google.cloud.tpu.v1.Node.Health.valueOf(health_); + return result == null ? com.google.cloud.tpu.v1.Node.Health.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The health status of the TPU node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.Health health = 22; + * + * @param value The health to set. + * @return This builder for chaining. + */ + public Builder setHealth(com.google.cloud.tpu.v1.Node.Health value) { + if (value == null) { + throw new NullPointerException(); + } + + health_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The health status of the TPU node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.Health health = 22; + * + * @return This builder for chaining. + */ + public Builder clearHealth() { + + health_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Resource labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 24; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Resource labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 24; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Resource labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 24; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Resource labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 24; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Resource labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 24; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Resource labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 24; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Resource labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 24; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private boolean useServiceNetworking_; + /** + * + * + *
+     * Whether the VPC peering for the node is set up through Service Networking
+     * API. The VPC Peering should be set up before provisioning the node.
+     * If this field is set, cidr_block field should not be specified. If the
+     * network, that you want to peer the TPU Node to, is Shared VPC networks,
+     * the node must be created with this this field enabled.
+     * 
+ * + * bool use_service_networking = 27; + * + * @return The useServiceNetworking. + */ + @java.lang.Override + public boolean getUseServiceNetworking() { + return useServiceNetworking_; + } + /** + * + * + *
+     * Whether the VPC peering for the node is set up through Service Networking
+     * API. The VPC Peering should be set up before provisioning the node.
+     * If this field is set, cidr_block field should not be specified. If the
+     * network, that you want to peer the TPU Node to, is Shared VPC networks,
+     * the node must be created with this this field enabled.
+     * 
+ * + * bool use_service_networking = 27; + * + * @param value The useServiceNetworking to set. + * @return This builder for chaining. + */ + public Builder setUseServiceNetworking(boolean value) { + + useServiceNetworking_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether the VPC peering for the node is set up through Service Networking
+     * API. The VPC Peering should be set up before provisioning the node.
+     * If this field is set, cidr_block field should not be specified. If the
+     * network, that you want to peer the TPU Node to, is Shared VPC networks,
+     * the node must be created with this this field enabled.
+     * 
+ * + * bool use_service_networking = 27; + * + * @return This builder for chaining. + */ + public Builder clearUseServiceNetworking() { + + useServiceNetworking_ = false; + onChanged(); + return this; + } + + private int apiVersion_ = 0; + /** + * + * + *
+     * Output only. The API version that created this Node.
+     * 
+ * + * + * .google.cloud.tpu.v1.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for apiVersion. + */ + @java.lang.Override + public int getApiVersionValue() { + return apiVersion_; + } + /** + * + * + *
+     * Output only. The API version that created this Node.
+     * 
+ * + * + * .google.cloud.tpu.v1.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionValue(int value) { + + apiVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The API version that created this Node.
+     * 
+ * + * + * .google.cloud.tpu.v1.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The apiVersion. + */ + @java.lang.Override + public com.google.cloud.tpu.v1.Node.ApiVersion getApiVersion() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v1.Node.ApiVersion result = + com.google.cloud.tpu.v1.Node.ApiVersion.valueOf(apiVersion_); + return result == null ? com.google.cloud.tpu.v1.Node.ApiVersion.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The API version that created this Node.
+     * 
+ * + * + * .google.cloud.tpu.v1.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(com.google.cloud.tpu.v1.Node.ApiVersion value) { + if (value == null) { + throw new NullPointerException(); + } + + apiVersion_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The API version that created this Node.
+     * 
+ * + * + * .google.cloud.tpu.v1.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + + apiVersion_ = 0; + onChanged(); + return this; + } + + private java.util.List symptoms_ = + java.util.Collections.emptyList(); + + private void ensureSymptomsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + symptoms_ = new java.util.ArrayList(symptoms_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.Symptom, + com.google.cloud.tpu.v1.Symptom.Builder, + com.google.cloud.tpu.v1.SymptomOrBuilder> + symptomsBuilder_; + + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getSymptomsList() { + if (symptomsBuilder_ == null) { + return java.util.Collections.unmodifiableList(symptoms_); + } else { + return symptomsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getSymptomsCount() { + if (symptomsBuilder_ == null) { + return symptoms_.size(); + } else { + return symptomsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v1.Symptom getSymptoms(int index) { + if (symptomsBuilder_ == null) { + return symptoms_.get(index); + } else { + return symptomsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSymptoms(int index, com.google.cloud.tpu.v1.Symptom value) { + if (symptomsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSymptomsIsMutable(); + symptoms_.set(index, value); + onChanged(); + } else { + symptomsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSymptoms(int index, com.google.cloud.tpu.v1.Symptom.Builder builderForValue) { + if (symptomsBuilder_ == null) { + ensureSymptomsIsMutable(); + symptoms_.set(index, builderForValue.build()); + onChanged(); + } else { + symptomsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addSymptoms(com.google.cloud.tpu.v1.Symptom value) { + if (symptomsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSymptomsIsMutable(); + symptoms_.add(value); + onChanged(); + } else { + symptomsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addSymptoms(int index, com.google.cloud.tpu.v1.Symptom value) { + if (symptomsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSymptomsIsMutable(); + symptoms_.add(index, value); + onChanged(); + } else { + symptomsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addSymptoms(com.google.cloud.tpu.v1.Symptom.Builder builderForValue) { + if (symptomsBuilder_ == null) { + ensureSymptomsIsMutable(); + symptoms_.add(builderForValue.build()); + onChanged(); + } else { + symptomsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addSymptoms(int index, com.google.cloud.tpu.v1.Symptom.Builder builderForValue) { + if (symptomsBuilder_ == null) { + ensureSymptomsIsMutable(); + symptoms_.add(index, builderForValue.build()); + onChanged(); + } else { + symptomsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllSymptoms( + java.lang.Iterable values) { + if (symptomsBuilder_ == null) { + ensureSymptomsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, symptoms_); + onChanged(); + } else { + symptomsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearSymptoms() { + if (symptomsBuilder_ == null) { + symptoms_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + symptomsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeSymptoms(int index) { + if (symptomsBuilder_ == null) { + ensureSymptomsIsMutable(); + symptoms_.remove(index); + onChanged(); + } else { + symptomsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v1.Symptom.Builder getSymptomsBuilder(int index) { + return getSymptomsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v1.SymptomOrBuilder getSymptomsOrBuilder(int index) { + if (symptomsBuilder_ == null) { + return symptoms_.get(index); + } else { + return symptomsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getSymptomsOrBuilderList() { + if (symptomsBuilder_ != null) { + return symptomsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(symptoms_); + } + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v1.Symptom.Builder addSymptomsBuilder() { + return getSymptomsFieldBuilder() + .addBuilder(com.google.cloud.tpu.v1.Symptom.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v1.Symptom.Builder addSymptomsBuilder(int index) { + return getSymptomsFieldBuilder() + .addBuilder(index, com.google.cloud.tpu.v1.Symptom.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getSymptomsBuilderList() { + return getSymptomsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.Symptom, + com.google.cloud.tpu.v1.Symptom.Builder, + com.google.cloud.tpu.v1.SymptomOrBuilder> + getSymptomsFieldBuilder() { + if (symptomsBuilder_ == null) { + symptomsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.Symptom, + com.google.cloud.tpu.v1.Symptom.Builder, + com.google.cloud.tpu.v1.SymptomOrBuilder>( + symptoms_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + symptoms_ = null; + } + return symptomsBuilder_; + } + + @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.tpu.v1.Node) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.Node) + private static final com.google.cloud.tpu.v1.Node DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.Node(); + } + + public static com.google.cloud.tpu.v1.Node getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Node parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Node(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.tpu.v1.Node getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NodeName.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NodeName.java new file mode 100644 index 00000000..a2a26077 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NodeName.java @@ -0,0 +1,217 @@ +/* + * 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.tpu.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 NodeName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_NODE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}/nodes/{node}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String node; + + @Deprecated + protected NodeName() { + project = null; + location = null; + node = null; + } + + private NodeName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + node = Preconditions.checkNotNull(builder.getNode()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getNode() { + return node; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static NodeName of(String project, String location, String node) { + return newBuilder().setProject(project).setLocation(location).setNode(node).build(); + } + + public static String format(String project, String location, String node) { + return newBuilder().setProject(project).setLocation(location).setNode(node).build().toString(); + } + + public static NodeName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_NODE.validatedMatch( + formattedString, "NodeName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("node")); + } + + 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 (NodeName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_NODE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (node != null) { + fieldMapBuilder.put("node", node); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_NODE.instantiate( + "project", project, "location", location, "node", node); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + NodeName that = ((NodeName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.node, that.node); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(node); + return h; + } + + /** Builder for projects/{project}/locations/{location}/nodes/{node}. */ + public static class Builder { + private String project; + private String location; + private String node; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getNode() { + return node; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setNode(String node) { + this.node = node; + return this; + } + + private Builder(NodeName nodeName) { + project = nodeName.project; + location = nodeName.location; + node = nodeName.node; + } + + public NodeName build() { + return new NodeName(this); + } + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NodeOrBuilder.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NodeOrBuilder.java new file mode 100644 index 00000000..9d6569f3 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NodeOrBuilder.java @@ -0,0 +1,673 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface NodeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.Node) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Immutable. The name of the TPU
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. Immutable. The name of the TPU
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The user-supplied description of the TPU. Maximum of 512 characters.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * The user-supplied description of the TPU. Maximum of 512 characters.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Required. The type of hardware accelerators associated with this node.
+   * 
+ * + * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The acceleratorType. + */ + java.lang.String getAcceleratorType(); + /** + * + * + *
+   * Required. The type of hardware accelerators associated with this node.
+   * 
+ * + * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for acceleratorType. + */ + com.google.protobuf.ByteString getAcceleratorTypeBytes(); + + /** + * + * + *
+   * Output only. DEPRECATED! Use network_endpoints instead.
+   * The network address for the TPU Node as visible to Compute Engine
+   * instances.
+   * 
+ * + * string ip_address = 8 [deprecated = true]; + * + * @return The ipAddress. + */ + @java.lang.Deprecated + java.lang.String getIpAddress(); + /** + * + * + *
+   * Output only. DEPRECATED! Use network_endpoints instead.
+   * The network address for the TPU Node as visible to Compute Engine
+   * instances.
+   * 
+ * + * string ip_address = 8 [deprecated = true]; + * + * @return The bytes for ipAddress. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getIpAddressBytes(); + + /** + * + * + *
+   * Output only. DEPRECATED! Use network_endpoints instead.
+   * The network port for the TPU Node as visible to Compute Engine instances.
+   * 
+ * + * string port = 14 [deprecated = true]; + * + * @return The port. + */ + @java.lang.Deprecated + java.lang.String getPort(); + /** + * + * + *
+   * Output only. DEPRECATED! Use network_endpoints instead.
+   * The network port for the TPU Node as visible to Compute Engine instances.
+   * 
+ * + * string port = 14 [deprecated = true]; + * + * @return The bytes for port. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getPortBytes(); + + /** + * + * + *
+   * Output only. The current state for the TPU Node.
+   * 
+ * + * .google.cloud.tpu.v1.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The current state for the TPU Node.
+   * 
+ * + * .google.cloud.tpu.v1.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.tpu.v1.Node.State getState(); + + /** + * + * + *
+   * Output only. If this field is populated, it contains a description of why the TPU Node
+   * is unhealthy.
+   * 
+ * + * string health_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The healthDescription. + */ + java.lang.String getHealthDescription(); + /** + * + * + *
+   * Output only. If this field is populated, it contains a description of why the TPU Node
+   * is unhealthy.
+   * 
+ * + * string health_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for healthDescription. + */ + com.google.protobuf.ByteString getHealthDescriptionBytes(); + + /** + * + * + *
+   * Required. The version of Tensorflow running in the Node.
+   * 
+ * + * string tensorflow_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tensorflowVersion. + */ + java.lang.String getTensorflowVersion(); + /** + * + * + *
+   * Required. The version of Tensorflow running in the Node.
+   * 
+ * + * string tensorflow_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tensorflowVersion. + */ + com.google.protobuf.ByteString getTensorflowVersionBytes(); + + /** + * + * + *
+   * The name of a network they wish to peer the TPU node to. It must be a
+   * preexisting Compute Engine network inside of the project on which this API
+   * has been activated. If none is provided, "default" will be used.
+   * 
+ * + * string network = 12; + * + * @return The network. + */ + java.lang.String getNetwork(); + /** + * + * + *
+   * The name of a network they wish to peer the TPU node to. It must be a
+   * preexisting Compute Engine network inside of the project on which this API
+   * has been activated. If none is provided, "default" will be used.
+   * 
+ * + * string network = 12; + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); + + /** + * + * + *
+   * The CIDR block that the TPU node will use when selecting an IP address.
+   * This CIDR block must be a /29 block; the Compute Engine networks API
+   * forbids a smaller block, and using a larger block would be wasteful (a
+   * node can only consume one IP address). Errors will occur if the CIDR block
+   * has already been used for a currently existing TPU node, the CIDR block
+   * conflicts with any subnetworks in the user's provided network, or the
+   * provided network is peered with another network that is using that CIDR
+   * block.
+   * 
+ * + * string cidr_block = 13; + * + * @return The cidrBlock. + */ + java.lang.String getCidrBlock(); + /** + * + * + *
+   * The CIDR block that the TPU node will use when selecting an IP address.
+   * This CIDR block must be a /29 block; the Compute Engine networks API
+   * forbids a smaller block, and using a larger block would be wasteful (a
+   * node can only consume one IP address). Errors will occur if the CIDR block
+   * has already been used for a currently existing TPU node, the CIDR block
+   * conflicts with any subnetworks in the user's provided network, or the
+   * provided network is peered with another network that is using that CIDR
+   * block.
+   * 
+ * + * string cidr_block = 13; + * + * @return The bytes for cidrBlock. + */ + com.google.protobuf.ByteString getCidrBlockBytes(); + + /** + * + * + *
+   * Output only. The service account used to run the tensor flow services within the node.
+   * To share resources, including Google Cloud Storage data, with the
+   * Tensorflow job running in the Node, this account must have permissions to
+   * that data.
+   * 
+ * + * string service_account = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The serviceAccount. + */ + java.lang.String getServiceAccount(); + /** + * + * + *
+   * Output only. The service account used to run the tensor flow services within the node.
+   * To share resources, including Google Cloud Storage data, with the
+   * Tensorflow job running in the Node, this account must have permissions to
+   * that data.
+   * 
+ * + * string service_account = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for serviceAccount. + */ + com.google.protobuf.ByteString getServiceAccountBytes(); + + /** + * + * + *
+   * Output only. The time when the node was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time when the node was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time when the node was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * The scheduling options for this node.
+   * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + * + * @return Whether the schedulingConfig field is set. + */ + boolean hasSchedulingConfig(); + /** + * + * + *
+   * The scheduling options for this node.
+   * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + * + * @return The schedulingConfig. + */ + com.google.cloud.tpu.v1.SchedulingConfig getSchedulingConfig(); + /** + * + * + *
+   * The scheduling options for this node.
+   * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + */ + com.google.cloud.tpu.v1.SchedulingConfigOrBuilder getSchedulingConfigOrBuilder(); + + /** + * + * + *
+   * Output only. The network endpoints where TPU workers can be accessed and
+   * sent work. It is recommended that Tensorflow clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getNetworkEndpointsList(); + /** + * + * + *
+   * Output only. The network endpoints where TPU workers can be accessed and
+   * sent work. It is recommended that Tensorflow clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.tpu.v1.NetworkEndpoint getNetworkEndpoints(int index); + /** + * + * + *
+   * Output only. The network endpoints where TPU workers can be accessed and
+   * sent work. It is recommended that Tensorflow clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getNetworkEndpointsCount(); + /** + * + * + *
+   * Output only. The network endpoints where TPU workers can be accessed and
+   * sent work. It is recommended that Tensorflow clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getNetworkEndpointsOrBuilderList(); + /** + * + * + *
+   * Output only. The network endpoints where TPU workers can be accessed and
+   * sent work. It is recommended that Tensorflow clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.tpu.v1.NetworkEndpointOrBuilder getNetworkEndpointsOrBuilder(int index); + + /** + * + * + *
+   * The health status of the TPU node.
+   * 
+ * + * .google.cloud.tpu.v1.Node.Health health = 22; + * + * @return The enum numeric value on the wire for health. + */ + int getHealthValue(); + /** + * + * + *
+   * The health status of the TPU node.
+   * 
+ * + * .google.cloud.tpu.v1.Node.Health health = 22; + * + * @return The health. + */ + com.google.cloud.tpu.v1.Node.Health getHealth(); + + /** + * + * + *
+   * Resource labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 24; + */ + int getLabelsCount(); + /** + * + * + *
+   * Resource labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 24; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Resource labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 24; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Resource labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 24; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Resource labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 24; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Whether the VPC peering for the node is set up through Service Networking
+   * API. The VPC Peering should be set up before provisioning the node.
+   * If this field is set, cidr_block field should not be specified. If the
+   * network, that you want to peer the TPU Node to, is Shared VPC networks,
+   * the node must be created with this this field enabled.
+   * 
+ * + * bool use_service_networking = 27; + * + * @return The useServiceNetworking. + */ + boolean getUseServiceNetworking(); + + /** + * + * + *
+   * Output only. The API version that created this Node.
+   * 
+ * + * + * .google.cloud.tpu.v1.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for apiVersion. + */ + int getApiVersionValue(); + /** + * + * + *
+   * Output only. The API version that created this Node.
+   * 
+ * + * + * .google.cloud.tpu.v1.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The apiVersion. + */ + com.google.cloud.tpu.v1.Node.ApiVersion getApiVersion(); + + /** + * + * + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getSymptomsList(); + /** + * + * + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.tpu.v1.Symptom getSymptoms(int index); + /** + * + * + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getSymptomsCount(); + /** + * + * + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getSymptomsOrBuilderList(); + /** + * + * + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.tpu.v1.SymptomOrBuilder getSymptomsOrBuilder(int index); +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/OperationMetadata.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/OperationMetadata.java new file mode 100644 index 00000000..258de67b --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/OperationMetadata.java @@ -0,0 +1,1808 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + * + * + *
+ * Metadata describing an [Operation][google.longrunning.Operation]
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusDetail_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OperationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + target_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + verb_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + statusDetail_ = s; + break; + } + case 48: + { + cancelRequested_ = input.readBool(); + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + apiVersion_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.OperationMetadata.class, + com.google.cloud.tpu.v1.OperationMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int TARGET_FIELD_NUMBER = 3; + private volatile java.lang.Object target_; + /** + * + * + *
+   * Target of the operation - for example
+   * projects/project-1/connectivityTests/test-1
+   * 
+ * + * string target = 3; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } + } + /** + * + * + *
+   * Target of the operation - for example
+   * projects/project-1/connectivityTests/test-1
+   * 
+ * + * string target = 3; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + private volatile java.lang.Object verb_; + /** + * + * + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_DETAIL_FIELD_NUMBER = 5; + private volatile java.lang.Object statusDetail_; + /** + * + * + *
+   * Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5; + * + * @return The statusDetail. + */ + @java.lang.Override + public java.lang.String getStatusDetail() { + java.lang.Object ref = statusDetail_; + 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(); + statusDetail_ = s; + return s; + } + } + /** + * + * + *
+   * Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5; + * + * @return The bytes for statusDetail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusDetailBytes() { + java.lang.Object ref = statusDetail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusDetail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CANCEL_REQUESTED_FIELD_NUMBER = 6; + private boolean cancelRequested_; + /** + * + * + *
+   * Specifies if cancellation was requested for the operation.
+   * 
+ * + * bool cancel_requested = 6; + * + * @return The cancelRequested. + */ + @java.lang.Override + public boolean getCancelRequested() { + return cancelRequested_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + private volatile java.lang.Object apiVersion_; + /** + * + * + *
+   * API version.
+   * 
+ * + * string api_version = 7; + * + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } + } + /** + * + * + *
+   * API version.
+   * 
+ * + * string api_version = 7; + * + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (!getTargetBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!getVerbBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!getStatusDetailBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusDetail_); + } + if (cancelRequested_ != false) { + output.writeBool(6, cancelRequested_); + } + if (!getApiVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, apiVersion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!getTargetBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!getVerbBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!getStatusDetailBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusDetail_); + } + if (cancelRequested_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, cancelRequested_); + } + if (!getApiVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, apiVersion_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.tpu.v1.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.OperationMetadata other = + (com.google.cloud.tpu.v1.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusDetail().equals(other.getStatusDetail())) return false; + if (getCancelRequested() != other.getCancelRequested()) return false; + if (!getApiVersion().equals(other.getApiVersion())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getStatusDetail().hashCode(); + hash = (37 * hash) + CANCEL_REQUESTED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCancelRequested()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.OperationMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.OperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.OperationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.OperationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.OperationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.OperationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.tpu.v1.OperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Metadata describing an [Operation][google.longrunning.Operation]
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.OperationMetadata) + com.google.cloud.tpu.v1.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.OperationMetadata.class, + com.google.cloud.tpu.v1.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.OperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + target_ = ""; + + verb_ = ""; + + statusDetail_ = ""; + + cancelRequested_ = false; + + apiVersion_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.OperationMetadata build() { + com.google.cloud.tpu.v1.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.OperationMetadata buildPartial() { + com.google.cloud.tpu.v1.OperationMetadata result = + new com.google.cloud.tpu.v1.OperationMetadata(this); + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.target_ = target_; + result.verb_ = verb_; + result.statusDetail_ = statusDetail_; + result.cancelRequested_ = cancelRequested_; + result.apiVersion_ = apiVersion_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.OperationMetadata) { + return mergeFrom((com.google.cloud.tpu.v1.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.OperationMetadata other) { + if (other == com.google.cloud.tpu.v1.OperationMetadata.getDefaultInstance()) return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + onChanged(); + } + if (!other.getStatusDetail().isEmpty()) { + statusDetail_ = other.statusDetail_; + onChanged(); + } + if (other.getCancelRequested() != false) { + setCancelRequested(other.getCancelRequested()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.OperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.OperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + /** + * + * + *
+     * Target of the operation - for example
+     * projects/project-1/connectivityTests/test-1
+     * 
+ * + * string target = 3; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Target of the operation - for example
+     * projects/project-1/connectivityTests/test-1
+     * 
+ * + * string target = 3; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Target of the operation - for example
+     * projects/project-1/connectivityTests/test-1
+     * 
+ * + * string target = 3; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + target_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Target of the operation - for example
+     * projects/project-1/connectivityTests/test-1
+     * 
+ * + * string target = 3; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + + target_ = getDefaultInstance().getTarget(); + onChanged(); + return this; + } + /** + * + * + *
+     * Target of the operation - for example
+     * projects/project-1/connectivityTests/test-1
+     * 
+ * + * string target = 3; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + target_ = value; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + verb_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + + verb_ = getDefaultInstance().getVerb(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + verb_ = value; + onChanged(); + return this; + } + + private java.lang.Object statusDetail_ = ""; + /** + * + * + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * + * @return The statusDetail. + */ + public java.lang.String getStatusDetail() { + java.lang.Object ref = statusDetail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusDetail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * + * @return The bytes for statusDetail. + */ + public com.google.protobuf.ByteString getStatusDetailBytes() { + java.lang.Object ref = statusDetail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusDetail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * + * @param value The statusDetail to set. + * @return This builder for chaining. + */ + public Builder setStatusDetail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + statusDetail_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * + * @return This builder for chaining. + */ + public Builder clearStatusDetail() { + + statusDetail_ = getDefaultInstance().getStatusDetail(); + onChanged(); + return this; + } + /** + * + * + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * + * @param value The bytes for statusDetail to set. + * @return This builder for chaining. + */ + public Builder setStatusDetailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + statusDetail_ = value; + onChanged(); + return this; + } + + private boolean cancelRequested_; + /** + * + * + *
+     * Specifies if cancellation was requested for the operation.
+     * 
+ * + * bool cancel_requested = 6; + * + * @return The cancelRequested. + */ + @java.lang.Override + public boolean getCancelRequested() { + return cancelRequested_; + } + /** + * + * + *
+     * Specifies if cancellation was requested for the operation.
+     * 
+ * + * bool cancel_requested = 6; + * + * @param value The cancelRequested to set. + * @return This builder for chaining. + */ + public Builder setCancelRequested(boolean value) { + + cancelRequested_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies if cancellation was requested for the operation.
+     * 
+ * + * bool cancel_requested = 6; + * + * @return This builder for chaining. + */ + public Builder clearCancelRequested() { + + cancelRequested_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + * + * + *
+     * API version.
+     * 
+ * + * string api_version = 7; + * + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * API version.
+     * 
+ * + * string api_version = 7; + * + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * API version.
+     * 
+ * + * string api_version = 7; + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + apiVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * API version.
+     * 
+ * + * string api_version = 7; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + + apiVersion_ = getDefaultInstance().getApiVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * API version.
+     * 
+ * + * string api_version = 7; + * + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + apiVersion_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.OperationMetadata) + private static final com.google.cloud.tpu.v1.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.OperationMetadata(); + } + + public static com.google.cloud.tpu.v1.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OperationMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/OperationMetadataOrBuilder.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/OperationMetadataOrBuilder.java new file mode 100644 index 00000000..8192fc69 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/OperationMetadataOrBuilder.java @@ -0,0 +1,210 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Target of the operation - for example
+   * projects/project-1/connectivityTests/test-1
+   * 
+ * + * string target = 3; + * + * @return The target. + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Target of the operation - for example
+   * projects/project-1/connectivityTests/test-1
+   * 
+ * + * string target = 3; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * + * @return The verb. + */ + java.lang.String getVerb(); + /** + * + * + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
+   * Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5; + * + * @return The statusDetail. + */ + java.lang.String getStatusDetail(); + /** + * + * + *
+   * Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5; + * + * @return The bytes for statusDetail. + */ + com.google.protobuf.ByteString getStatusDetailBytes(); + + /** + * + * + *
+   * Specifies if cancellation was requested for the operation.
+   * 
+ * + * bool cancel_requested = 6; + * + * @return The cancelRequested. + */ + boolean getCancelRequested(); + + /** + * + * + *
+   * API version.
+   * 
+ * + * string api_version = 7; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + /** + * + * + *
+   * API version.
+   * 
+ * + * string api_version = 7; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ReimageNodeRequest.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ReimageNodeRequest.java new file mode 100644 index 00000000..20cca9ca --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ReimageNodeRequest.java @@ -0,0 +1,813 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + * + * + *
+ * Request for [ReimageNode][google.cloud.tpu.v1.Tpu.ReimageNode].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ReimageNodeRequest} + */ +public final class ReimageNodeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.ReimageNodeRequest) + ReimageNodeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReimageNodeRequest.newBuilder() to construct. + private ReimageNodeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReimageNodeRequest() { + name_ = ""; + tensorflowVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReimageNodeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ReimageNodeRequest( + 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(); + + tensorflowVersion_ = 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.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ReimageNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ReimageNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ReimageNodeRequest.class, + com.google.cloud.tpu.v1.ReimageNodeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * The resource name.
+   * 
+ * + * 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 TENSORFLOW_VERSION_FIELD_NUMBER = 2; + private volatile java.lang.Object tensorflowVersion_; + /** + * + * + *
+   * The version for reimage to create.
+   * 
+ * + * string tensorflow_version = 2; + * + * @return The tensorflowVersion. + */ + @java.lang.Override + public java.lang.String getTensorflowVersion() { + java.lang.Object ref = tensorflowVersion_; + 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(); + tensorflowVersion_ = s; + return s; + } + } + /** + * + * + *
+   * The version for reimage to create.
+   * 
+ * + * string tensorflow_version = 2; + * + * @return The bytes for tensorflowVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTensorflowVersionBytes() { + java.lang.Object ref = tensorflowVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tensorflowVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getTensorflowVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, tensorflowVersion_); + } + 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 (!getTensorflowVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, tensorflowVersion_); + } + 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.tpu.v1.ReimageNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.ReimageNodeRequest other = + (com.google.cloud.tpu.v1.ReimageNodeRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getTensorflowVersion().equals(other.getTensorflowVersion())) 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) + TENSORFLOW_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getTensorflowVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.ReimageNodeRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.ReimageNodeRequest 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.tpu.v1.ReimageNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.ReimageNodeRequest 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.tpu.v1.ReimageNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.ReimageNodeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.ReimageNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.ReimageNodeRequest 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.tpu.v1.ReimageNodeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.ReimageNodeRequest 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.tpu.v1.ReimageNodeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.ReimageNodeRequest 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.tpu.v1.ReimageNodeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for [ReimageNode][google.cloud.tpu.v1.Tpu.ReimageNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ReimageNodeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.ReimageNodeRequest) + com.google.cloud.tpu.v1.ReimageNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ReimageNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ReimageNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ReimageNodeRequest.class, + com.google.cloud.tpu.v1.ReimageNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.ReimageNodeRequest.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_ = ""; + + tensorflowVersion_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_ReimageNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ReimageNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.ReimageNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ReimageNodeRequest build() { + com.google.cloud.tpu.v1.ReimageNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ReimageNodeRequest buildPartial() { + com.google.cloud.tpu.v1.ReimageNodeRequest result = + new com.google.cloud.tpu.v1.ReimageNodeRequest(this); + result.name_ = name_; + result.tensorflowVersion_ = tensorflowVersion_; + 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.tpu.v1.ReimageNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v1.ReimageNodeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.ReimageNodeRequest other) { + if (other == com.google.cloud.tpu.v1.ReimageNodeRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getTensorflowVersion().isEmpty()) { + tensorflowVersion_ = other.tensorflowVersion_; + 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.tpu.v1.ReimageNodeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.ReimageNodeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name.
+     * 
+ * + * 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 tensorflowVersion_ = ""; + /** + * + * + *
+     * The version for reimage to create.
+     * 
+ * + * string tensorflow_version = 2; + * + * @return The tensorflowVersion. + */ + public java.lang.String getTensorflowVersion() { + java.lang.Object ref = tensorflowVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tensorflowVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The version for reimage to create.
+     * 
+ * + * string tensorflow_version = 2; + * + * @return The bytes for tensorflowVersion. + */ + public com.google.protobuf.ByteString getTensorflowVersionBytes() { + java.lang.Object ref = tensorflowVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tensorflowVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The version for reimage to create.
+     * 
+ * + * string tensorflow_version = 2; + * + * @param value The tensorflowVersion to set. + * @return This builder for chaining. + */ + public Builder setTensorflowVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + tensorflowVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The version for reimage to create.
+     * 
+ * + * string tensorflow_version = 2; + * + * @return This builder for chaining. + */ + public Builder clearTensorflowVersion() { + + tensorflowVersion_ = getDefaultInstance().getTensorflowVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * The version for reimage to create.
+     * 
+ * + * string tensorflow_version = 2; + * + * @param value The bytes for tensorflowVersion to set. + * @return This builder for chaining. + */ + public Builder setTensorflowVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + tensorflowVersion_ = 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.tpu.v1.ReimageNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.ReimageNodeRequest) + private static final com.google.cloud.tpu.v1.ReimageNodeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.ReimageNodeRequest(); + } + + public static com.google.cloud.tpu.v1.ReimageNodeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReimageNodeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReimageNodeRequest(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.tpu.v1.ReimageNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ReimageNodeRequestOrBuilder.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ReimageNodeRequestOrBuilder.java new file mode 100644 index 00000000..e44a725d --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ReimageNodeRequestOrBuilder.java @@ -0,0 +1,75 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface ReimageNodeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.ReimageNodeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The version for reimage to create.
+   * 
+ * + * string tensorflow_version = 2; + * + * @return The tensorflowVersion. + */ + java.lang.String getTensorflowVersion(); + /** + * + * + *
+   * The version for reimage to create.
+   * 
+ * + * string tensorflow_version = 2; + * + * @return The bytes for tensorflowVersion. + */ + com.google.protobuf.ByteString getTensorflowVersionBytes(); +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SchedulingConfig.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SchedulingConfig.java new file mode 100644 index 00000000..9a6d2606 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SchedulingConfig.java @@ -0,0 +1,633 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + * + * + *
+ * Sets the scheduling options for this node.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.SchedulingConfig} + */ +public final class SchedulingConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.SchedulingConfig) + SchedulingConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use SchedulingConfig.newBuilder() to construct. + private SchedulingConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SchedulingConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SchedulingConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SchedulingConfig( + 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: + { + preemptible_ = input.readBool(); + break; + } + case 16: + { + reserved_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_SchedulingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_SchedulingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.SchedulingConfig.class, + com.google.cloud.tpu.v1.SchedulingConfig.Builder.class); + } + + public static final int PREEMPTIBLE_FIELD_NUMBER = 1; + private boolean preemptible_; + /** + * + * + *
+   * Defines whether the node is preemptible.
+   * 
+ * + * bool preemptible = 1; + * + * @return The preemptible. + */ + @java.lang.Override + public boolean getPreemptible() { + return preemptible_; + } + + public static final int RESERVED_FIELD_NUMBER = 2; + private boolean reserved_; + /** + * + * + *
+   * Whether the node is created under a reservation.
+   * 
+ * + * bool reserved = 2; + * + * @return The reserved. + */ + @java.lang.Override + public boolean getReserved() { + return reserved_; + } + + 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 (preemptible_ != false) { + output.writeBool(1, preemptible_); + } + if (reserved_ != false) { + output.writeBool(2, reserved_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (preemptible_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, preemptible_); + } + if (reserved_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, reserved_); + } + 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.tpu.v1.SchedulingConfig)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.SchedulingConfig other = (com.google.cloud.tpu.v1.SchedulingConfig) obj; + + if (getPreemptible() != other.getPreemptible()) return false; + if (getReserved() != other.getReserved()) 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) + PREEMPTIBLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPreemptible()); + hash = (37 * hash) + RESERVED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReserved()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.SchedulingConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.SchedulingConfig 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.tpu.v1.SchedulingConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.SchedulingConfig 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.tpu.v1.SchedulingConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.SchedulingConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.SchedulingConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.SchedulingConfig 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.tpu.v1.SchedulingConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.SchedulingConfig 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.tpu.v1.SchedulingConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.SchedulingConfig 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.tpu.v1.SchedulingConfig 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; + } + /** + * + * + *
+   * Sets the scheduling options for this node.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.SchedulingConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.SchedulingConfig) + com.google.cloud.tpu.v1.SchedulingConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_SchedulingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_SchedulingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.SchedulingConfig.class, + com.google.cloud.tpu.v1.SchedulingConfig.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.SchedulingConfig.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(); + preemptible_ = false; + + reserved_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_SchedulingConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.SchedulingConfig getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.SchedulingConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.SchedulingConfig build() { + com.google.cloud.tpu.v1.SchedulingConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.SchedulingConfig buildPartial() { + com.google.cloud.tpu.v1.SchedulingConfig result = + new com.google.cloud.tpu.v1.SchedulingConfig(this); + result.preemptible_ = preemptible_; + result.reserved_ = reserved_; + 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.tpu.v1.SchedulingConfig) { + return mergeFrom((com.google.cloud.tpu.v1.SchedulingConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.SchedulingConfig other) { + if (other == com.google.cloud.tpu.v1.SchedulingConfig.getDefaultInstance()) return this; + if (other.getPreemptible() != false) { + setPreemptible(other.getPreemptible()); + } + if (other.getReserved() != false) { + setReserved(other.getReserved()); + } + 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.tpu.v1.SchedulingConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.SchedulingConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean preemptible_; + /** + * + * + *
+     * Defines whether the node is preemptible.
+     * 
+ * + * bool preemptible = 1; + * + * @return The preemptible. + */ + @java.lang.Override + public boolean getPreemptible() { + return preemptible_; + } + /** + * + * + *
+     * Defines whether the node is preemptible.
+     * 
+ * + * bool preemptible = 1; + * + * @param value The preemptible to set. + * @return This builder for chaining. + */ + public Builder setPreemptible(boolean value) { + + preemptible_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Defines whether the node is preemptible.
+     * 
+ * + * bool preemptible = 1; + * + * @return This builder for chaining. + */ + public Builder clearPreemptible() { + + preemptible_ = false; + onChanged(); + return this; + } + + private boolean reserved_; + /** + * + * + *
+     * Whether the node is created under a reservation.
+     * 
+ * + * bool reserved = 2; + * + * @return The reserved. + */ + @java.lang.Override + public boolean getReserved() { + return reserved_; + } + /** + * + * + *
+     * Whether the node is created under a reservation.
+     * 
+ * + * bool reserved = 2; + * + * @param value The reserved to set. + * @return This builder for chaining. + */ + public Builder setReserved(boolean value) { + + reserved_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether the node is created under a reservation.
+     * 
+ * + * bool reserved = 2; + * + * @return This builder for chaining. + */ + public Builder clearReserved() { + + reserved_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.SchedulingConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.SchedulingConfig) + private static final com.google.cloud.tpu.v1.SchedulingConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.SchedulingConfig(); + } + + public static com.google.cloud.tpu.v1.SchedulingConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SchedulingConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SchedulingConfig(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.tpu.v1.SchedulingConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SchedulingConfigOrBuilder.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SchedulingConfigOrBuilder.java new file mode 100644 index 00000000..d747b81c --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SchedulingConfigOrBuilder.java @@ -0,0 +1,51 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface SchedulingConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.SchedulingConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Defines whether the node is preemptible.
+   * 
+ * + * bool preemptible = 1; + * + * @return The preemptible. + */ + boolean getPreemptible(); + + /** + * + * + *
+   * Whether the node is created under a reservation.
+   * 
+ * + * bool reserved = 2; + * + * @return The reserved. + */ + boolean getReserved(); +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StartNodeRequest.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StartNodeRequest.java new file mode 100644 index 00000000..16f17f61 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StartNodeRequest.java @@ -0,0 +1,633 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + * + * + *
+ * Request for [StartNode][google.cloud.tpu.v1.Tpu.StartNode].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.StartNodeRequest} + */ +public final class StartNodeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.StartNodeRequest) + StartNodeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StartNodeRequest.newBuilder() to construct. + private StartNodeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StartNodeRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StartNodeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StartNodeRequest( + 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.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_StartNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_StartNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.StartNodeRequest.class, + com.google.cloud.tpu.v1.StartNodeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * The resource name.
+   * 
+ * + * 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; + } + } + + 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.tpu.v1.StartNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.StartNodeRequest other = (com.google.cloud.tpu.v1.StartNodeRequest) 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.tpu.v1.StartNodeRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.StartNodeRequest 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.tpu.v1.StartNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.StartNodeRequest 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.tpu.v1.StartNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.StartNodeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.StartNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.StartNodeRequest 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.tpu.v1.StartNodeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.StartNodeRequest 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.tpu.v1.StartNodeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.StartNodeRequest 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.tpu.v1.StartNodeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for [StartNode][google.cloud.tpu.v1.Tpu.StartNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.StartNodeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.StartNodeRequest) + com.google.cloud.tpu.v1.StartNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_StartNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_StartNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.StartNodeRequest.class, + com.google.cloud.tpu.v1.StartNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.StartNodeRequest.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.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_StartNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.StartNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.StartNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.StartNodeRequest build() { + com.google.cloud.tpu.v1.StartNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.StartNodeRequest buildPartial() { + com.google.cloud.tpu.v1.StartNodeRequest result = + new com.google.cloud.tpu.v1.StartNodeRequest(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.tpu.v1.StartNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v1.StartNodeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.StartNodeRequest other) { + if (other == com.google.cloud.tpu.v1.StartNodeRequest.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.tpu.v1.StartNodeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.StartNodeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name.
+     * 
+ * + * 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; + } + + @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.tpu.v1.StartNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.StartNodeRequest) + private static final com.google.cloud.tpu.v1.StartNodeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.StartNodeRequest(); + } + + public static com.google.cloud.tpu.v1.StartNodeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StartNodeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StartNodeRequest(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.tpu.v1.StartNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StartNodeRequestOrBuilder.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StartNodeRequestOrBuilder.java new file mode 100644 index 00000000..23baa871 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StartNodeRequestOrBuilder.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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface StartNodeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.StartNodeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StopNodeRequest.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StopNodeRequest.java new file mode 100644 index 00000000..9984c390 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StopNodeRequest.java @@ -0,0 +1,633 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + * + * + *
+ * Request for [StopNode][google.cloud.tpu.v1.Tpu.StopNode].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.StopNodeRequest} + */ +public final class StopNodeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.StopNodeRequest) + StopNodeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StopNodeRequest.newBuilder() to construct. + private StopNodeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StopNodeRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StopNodeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StopNodeRequest( + 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.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_StopNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_StopNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.StopNodeRequest.class, + com.google.cloud.tpu.v1.StopNodeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * The resource name.
+   * 
+ * + * 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; + } + } + + 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.tpu.v1.StopNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.StopNodeRequest other = (com.google.cloud.tpu.v1.StopNodeRequest) 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.tpu.v1.StopNodeRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.StopNodeRequest 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.tpu.v1.StopNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.StopNodeRequest 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.tpu.v1.StopNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.StopNodeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.StopNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.StopNodeRequest 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.tpu.v1.StopNodeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.StopNodeRequest 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.tpu.v1.StopNodeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.StopNodeRequest 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.tpu.v1.StopNodeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for [StopNode][google.cloud.tpu.v1.Tpu.StopNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.StopNodeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.StopNodeRequest) + com.google.cloud.tpu.v1.StopNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_StopNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_StopNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.StopNodeRequest.class, + com.google.cloud.tpu.v1.StopNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.StopNodeRequest.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.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_StopNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.StopNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.StopNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.StopNodeRequest build() { + com.google.cloud.tpu.v1.StopNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.StopNodeRequest buildPartial() { + com.google.cloud.tpu.v1.StopNodeRequest result = + new com.google.cloud.tpu.v1.StopNodeRequest(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.tpu.v1.StopNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v1.StopNodeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.StopNodeRequest other) { + if (other == com.google.cloud.tpu.v1.StopNodeRequest.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.tpu.v1.StopNodeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.StopNodeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name.
+     * 
+ * + * 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; + } + + @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.tpu.v1.StopNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.StopNodeRequest) + private static final com.google.cloud.tpu.v1.StopNodeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.StopNodeRequest(); + } + + public static com.google.cloud.tpu.v1.StopNodeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StopNodeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StopNodeRequest(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.tpu.v1.StopNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StopNodeRequestOrBuilder.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StopNodeRequestOrBuilder.java new file mode 100644 index 00000000..e340f417 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StopNodeRequestOrBuilder.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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface StopNodeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.StopNodeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/Symptom.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/Symptom.java new file mode 100644 index 00000000..51e4fb00 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/Symptom.java @@ -0,0 +1,1480 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + * + * + *
+ * A Symptom instance.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.Symptom} + */ +public final class Symptom extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.Symptom) + SymptomOrBuilder { + private static final long serialVersionUID = 0L; + // Use Symptom.newBuilder() to construct. + private Symptom(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Symptom() { + symptomType_ = 0; + details_ = ""; + workerId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Symptom(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Symptom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + int rawValue = input.readEnum(); + + symptomType_ = rawValue; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + details_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + workerId_ = 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.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_Symptom_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_Symptom_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.Symptom.class, com.google.cloud.tpu.v1.Symptom.Builder.class); + } + + /** + * + * + *
+   * SymptomType represents the different types of Symptoms that a TPU can be
+   * at.
+   * 
+ * + * Protobuf enum {@code google.cloud.tpu.v1.Symptom.SymptomType} + */ + public enum SymptomType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified symptom.
+     * 
+ * + * SYMPTOM_TYPE_UNSPECIFIED = 0; + */ + SYMPTOM_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * TPU VM memory is low.
+     * 
+ * + * LOW_MEMORY = 1; + */ + LOW_MEMORY(1), + /** + * + * + *
+     * TPU runtime is out of memory.
+     * 
+ * + * OUT_OF_MEMORY = 2; + */ + OUT_OF_MEMORY(2), + /** + * + * + *
+     * TPU runtime execution has timed out.
+     * 
+ * + * EXECUTE_TIMED_OUT = 3; + */ + EXECUTE_TIMED_OUT(3), + /** + * + * + *
+     * TPU runtime fails to construct a mesh that recognizes each TPU device's
+     * neighbors.
+     * 
+ * + * MESH_BUILD_FAIL = 4; + */ + MESH_BUILD_FAIL(4), + /** + * + * + *
+     * TPU HBM is out of memory.
+     * 
+ * + * HBM_OUT_OF_MEMORY = 5; + */ + HBM_OUT_OF_MEMORY(5), + /** + * + * + *
+     * Abusive behaviors have been identified on the current project.
+     * 
+ * + * PROJECT_ABUSE = 6; + */ + PROJECT_ABUSE(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified symptom.
+     * 
+ * + * SYMPTOM_TYPE_UNSPECIFIED = 0; + */ + public static final int SYMPTOM_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * TPU VM memory is low.
+     * 
+ * + * LOW_MEMORY = 1; + */ + public static final int LOW_MEMORY_VALUE = 1; + /** + * + * + *
+     * TPU runtime is out of memory.
+     * 
+ * + * OUT_OF_MEMORY = 2; + */ + public static final int OUT_OF_MEMORY_VALUE = 2; + /** + * + * + *
+     * TPU runtime execution has timed out.
+     * 
+ * + * EXECUTE_TIMED_OUT = 3; + */ + public static final int EXECUTE_TIMED_OUT_VALUE = 3; + /** + * + * + *
+     * TPU runtime fails to construct a mesh that recognizes each TPU device's
+     * neighbors.
+     * 
+ * + * MESH_BUILD_FAIL = 4; + */ + public static final int MESH_BUILD_FAIL_VALUE = 4; + /** + * + * + *
+     * TPU HBM is out of memory.
+     * 
+ * + * HBM_OUT_OF_MEMORY = 5; + */ + public static final int HBM_OUT_OF_MEMORY_VALUE = 5; + /** + * + * + *
+     * Abusive behaviors have been identified on the current project.
+     * 
+ * + * PROJECT_ABUSE = 6; + */ + public static final int PROJECT_ABUSE_VALUE = 6; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SymptomType 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 SymptomType forNumber(int value) { + switch (value) { + case 0: + return SYMPTOM_TYPE_UNSPECIFIED; + case 1: + return LOW_MEMORY; + case 2: + return OUT_OF_MEMORY; + case 3: + return EXECUTE_TIMED_OUT; + case 4: + return MESH_BUILD_FAIL; + case 5: + return HBM_OUT_OF_MEMORY; + case 6: + return PROJECT_ABUSE; + 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 SymptomType findValueByNumber(int number) { + return SymptomType.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.tpu.v1.Symptom.getDescriptor().getEnumTypes().get(0); + } + + private static final SymptomType[] VALUES = values(); + + public static SymptomType 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 SymptomType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.tpu.v1.Symptom.SymptomType) + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Timestamp when the Symptom is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Timestamp when the Symptom is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Timestamp when the Symptom is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int SYMPTOM_TYPE_FIELD_NUMBER = 2; + private int symptomType_; + /** + * + * + *
+   * Type of the Symptom.
+   * 
+ * + * .google.cloud.tpu.v1.Symptom.SymptomType symptom_type = 2; + * + * @return The enum numeric value on the wire for symptomType. + */ + @java.lang.Override + public int getSymptomTypeValue() { + return symptomType_; + } + /** + * + * + *
+   * Type of the Symptom.
+   * 
+ * + * .google.cloud.tpu.v1.Symptom.SymptomType symptom_type = 2; + * + * @return The symptomType. + */ + @java.lang.Override + public com.google.cloud.tpu.v1.Symptom.SymptomType getSymptomType() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v1.Symptom.SymptomType result = + com.google.cloud.tpu.v1.Symptom.SymptomType.valueOf(symptomType_); + return result == null ? com.google.cloud.tpu.v1.Symptom.SymptomType.UNRECOGNIZED : result; + } + + public static final int DETAILS_FIELD_NUMBER = 3; + private volatile java.lang.Object details_; + /** + * + * + *
+   * Detailed information of the current Symptom.
+   * 
+ * + * string details = 3; + * + * @return The details. + */ + @java.lang.Override + public java.lang.String getDetails() { + java.lang.Object ref = details_; + 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(); + details_ = s; + return s; + } + } + /** + * + * + *
+   * Detailed information of the current Symptom.
+   * 
+ * + * string details = 3; + * + * @return The bytes for details. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDetailsBytes() { + java.lang.Object ref = details_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + details_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WORKER_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object workerId_; + /** + * + * + *
+   * A string used to uniquely distinguish a worker within a TPU node.
+   * 
+ * + * string worker_id = 4; + * + * @return The workerId. + */ + @java.lang.Override + public java.lang.String getWorkerId() { + java.lang.Object ref = workerId_; + 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(); + workerId_ = s; + return s; + } + } + /** + * + * + *
+   * A string used to uniquely distinguish a worker within a TPU node.
+   * 
+ * + * string worker_id = 4; + * + * @return The bytes for workerId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getWorkerIdBytes() { + java.lang.Object ref = workerId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workerId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (symptomType_ + != com.google.cloud.tpu.v1.Symptom.SymptomType.SYMPTOM_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, symptomType_); + } + if (!getDetailsBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, details_); + } + if (!getWorkerIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, workerId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (symptomType_ + != com.google.cloud.tpu.v1.Symptom.SymptomType.SYMPTOM_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, symptomType_); + } + if (!getDetailsBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, details_); + } + if (!getWorkerIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, workerId_); + } + 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.tpu.v1.Symptom)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.Symptom other = (com.google.cloud.tpu.v1.Symptom) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (symptomType_ != other.symptomType_) return false; + if (!getDetails().equals(other.getDetails())) return false; + if (!getWorkerId().equals(other.getWorkerId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + SYMPTOM_TYPE_FIELD_NUMBER; + hash = (53 * hash) + symptomType_; + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetails().hashCode(); + hash = (37 * hash) + WORKER_ID_FIELD_NUMBER; + hash = (53 * hash) + getWorkerId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.Symptom parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.Symptom 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.tpu.v1.Symptom parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.Symptom 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.tpu.v1.Symptom parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.Symptom parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.Symptom parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.Symptom 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.tpu.v1.Symptom parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.Symptom 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.tpu.v1.Symptom parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.Symptom 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.tpu.v1.Symptom 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 Symptom instance.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.Symptom} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.Symptom) + com.google.cloud.tpu.v1.SymptomOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_Symptom_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_Symptom_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.Symptom.class, com.google.cloud.tpu.v1.Symptom.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.Symptom.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + symptomType_ = 0; + + details_ = ""; + + workerId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_Symptom_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.Symptom getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.Symptom.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.Symptom build() { + com.google.cloud.tpu.v1.Symptom result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.Symptom buildPartial() { + com.google.cloud.tpu.v1.Symptom result = new com.google.cloud.tpu.v1.Symptom(this); + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.symptomType_ = symptomType_; + result.details_ = details_; + result.workerId_ = workerId_; + 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.tpu.v1.Symptom) { + return mergeFrom((com.google.cloud.tpu.v1.Symptom) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.Symptom other) { + if (other == com.google.cloud.tpu.v1.Symptom.getDefaultInstance()) return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.symptomType_ != 0) { + setSymptomTypeValue(other.getSymptomTypeValue()); + } + if (!other.getDetails().isEmpty()) { + details_ = other.details_; + onChanged(); + } + if (!other.getWorkerId().isEmpty()) { + workerId_ = other.workerId_; + 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.tpu.v1.Symptom parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.Symptom) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Timestamp when the Symptom is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Timestamp when the Symptom is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Timestamp when the Symptom is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Timestamp when the Symptom is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Timestamp when the Symptom is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Timestamp when the Symptom is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Timestamp when the Symptom is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Timestamp when the Symptom is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Timestamp when the Symptom is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private int symptomType_ = 0; + /** + * + * + *
+     * Type of the Symptom.
+     * 
+ * + * .google.cloud.tpu.v1.Symptom.SymptomType symptom_type = 2; + * + * @return The enum numeric value on the wire for symptomType. + */ + @java.lang.Override + public int getSymptomTypeValue() { + return symptomType_; + } + /** + * + * + *
+     * Type of the Symptom.
+     * 
+ * + * .google.cloud.tpu.v1.Symptom.SymptomType symptom_type = 2; + * + * @param value The enum numeric value on the wire for symptomType to set. + * @return This builder for chaining. + */ + public Builder setSymptomTypeValue(int value) { + + symptomType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Type of the Symptom.
+     * 
+ * + * .google.cloud.tpu.v1.Symptom.SymptomType symptom_type = 2; + * + * @return The symptomType. + */ + @java.lang.Override + public com.google.cloud.tpu.v1.Symptom.SymptomType getSymptomType() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v1.Symptom.SymptomType result = + com.google.cloud.tpu.v1.Symptom.SymptomType.valueOf(symptomType_); + return result == null ? com.google.cloud.tpu.v1.Symptom.SymptomType.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Type of the Symptom.
+     * 
+ * + * .google.cloud.tpu.v1.Symptom.SymptomType symptom_type = 2; + * + * @param value The symptomType to set. + * @return This builder for chaining. + */ + public Builder setSymptomType(com.google.cloud.tpu.v1.Symptom.SymptomType value) { + if (value == null) { + throw new NullPointerException(); + } + + symptomType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Type of the Symptom.
+     * 
+ * + * .google.cloud.tpu.v1.Symptom.SymptomType symptom_type = 2; + * + * @return This builder for chaining. + */ + public Builder clearSymptomType() { + + symptomType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object details_ = ""; + /** + * + * + *
+     * Detailed information of the current Symptom.
+     * 
+ * + * string details = 3; + * + * @return The details. + */ + public java.lang.String getDetails() { + java.lang.Object ref = details_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + details_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Detailed information of the current Symptom.
+     * 
+ * + * string details = 3; + * + * @return The bytes for details. + */ + public com.google.protobuf.ByteString getDetailsBytes() { + java.lang.Object ref = details_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + details_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Detailed information of the current Symptom.
+     * 
+ * + * string details = 3; + * + * @param value The details to set. + * @return This builder for chaining. + */ + public Builder setDetails(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + details_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Detailed information of the current Symptom.
+     * 
+ * + * string details = 3; + * + * @return This builder for chaining. + */ + public Builder clearDetails() { + + details_ = getDefaultInstance().getDetails(); + onChanged(); + return this; + } + /** + * + * + *
+     * Detailed information of the current Symptom.
+     * 
+ * + * string details = 3; + * + * @param value The bytes for details to set. + * @return This builder for chaining. + */ + public Builder setDetailsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + details_ = value; + onChanged(); + return this; + } + + private java.lang.Object workerId_ = ""; + /** + * + * + *
+     * A string used to uniquely distinguish a worker within a TPU node.
+     * 
+ * + * string worker_id = 4; + * + * @return The workerId. + */ + public java.lang.String getWorkerId() { + java.lang.Object ref = workerId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workerId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A string used to uniquely distinguish a worker within a TPU node.
+     * 
+ * + * string worker_id = 4; + * + * @return The bytes for workerId. + */ + public com.google.protobuf.ByteString getWorkerIdBytes() { + java.lang.Object ref = workerId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workerId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A string used to uniquely distinguish a worker within a TPU node.
+     * 
+ * + * string worker_id = 4; + * + * @param value The workerId to set. + * @return This builder for chaining. + */ + public Builder setWorkerId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + workerId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A string used to uniquely distinguish a worker within a TPU node.
+     * 
+ * + * string worker_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearWorkerId() { + + workerId_ = getDefaultInstance().getWorkerId(); + onChanged(); + return this; + } + /** + * + * + *
+     * A string used to uniquely distinguish a worker within a TPU node.
+     * 
+ * + * string worker_id = 4; + * + * @param value The bytes for workerId to set. + * @return This builder for chaining. + */ + public Builder setWorkerIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + workerId_ = 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.tpu.v1.Symptom) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.Symptom) + private static final com.google.cloud.tpu.v1.Symptom DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.Symptom(); + } + + public static com.google.cloud.tpu.v1.Symptom getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Symptom parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Symptom(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.tpu.v1.Symptom getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SymptomOrBuilder.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SymptomOrBuilder.java new file mode 100644 index 00000000..72ba143f --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SymptomOrBuilder.java @@ -0,0 +1,135 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface SymptomOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.Symptom) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Timestamp when the Symptom is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Timestamp when the Symptom is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Timestamp when the Symptom is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Type of the Symptom.
+   * 
+ * + * .google.cloud.tpu.v1.Symptom.SymptomType symptom_type = 2; + * + * @return The enum numeric value on the wire for symptomType. + */ + int getSymptomTypeValue(); + /** + * + * + *
+   * Type of the Symptom.
+   * 
+ * + * .google.cloud.tpu.v1.Symptom.SymptomType symptom_type = 2; + * + * @return The symptomType. + */ + com.google.cloud.tpu.v1.Symptom.SymptomType getSymptomType(); + + /** + * + * + *
+   * Detailed information of the current Symptom.
+   * 
+ * + * string details = 3; + * + * @return The details. + */ + java.lang.String getDetails(); + /** + * + * + *
+   * Detailed information of the current Symptom.
+   * 
+ * + * string details = 3; + * + * @return The bytes for details. + */ + com.google.protobuf.ByteString getDetailsBytes(); + + /** + * + * + *
+   * A string used to uniquely distinguish a worker within a TPU node.
+   * 
+ * + * string worker_id = 4; + * + * @return The workerId. + */ + java.lang.String getWorkerId(); + /** + * + * + *
+   * A string used to uniquely distinguish a worker within a TPU node.
+   * 
+ * + * string worker_id = 4; + * + * @return The bytes for workerId. + */ + com.google.protobuf.ByteString getWorkerIdBytes(); +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersion.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersion.java new file mode 100644 index 00000000..a2ccd16b --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersion.java @@ -0,0 +1,813 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + * + * + *
+ * A tensorflow version that a Node can be configured with.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.TensorFlowVersion} + */ +public final class TensorFlowVersion extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.TensorFlowVersion) + TensorFlowVersionOrBuilder { + private static final long serialVersionUID = 0L; + // Use TensorFlowVersion.newBuilder() to construct. + private TensorFlowVersion(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TensorFlowVersion() { + name_ = ""; + version_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TensorFlowVersion(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TensorFlowVersion( + 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(); + + version_ = 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.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_TensorFlowVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_TensorFlowVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.TensorFlowVersion.class, + com.google.cloud.tpu.v1.TensorFlowVersion.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * The resource name.
+   * 
+ * + * 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 VERSION_FIELD_NUMBER = 2; + private volatile java.lang.Object version_; + /** + * + * + *
+   * the tensorflow version.
+   * 
+ * + * string version = 2; + * + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + java.lang.Object ref = version_; + 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(); + version_ = s; + return s; + } + } + /** + * + * + *
+   * the tensorflow version.
+   * 
+ * + * string version = 2; + * + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, version_); + } + 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 (!getVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, version_); + } + 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.tpu.v1.TensorFlowVersion)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.TensorFlowVersion other = + (com.google.cloud.tpu.v1.TensorFlowVersion) obj; + + if (!getName().equals(other.getName())) return false; + if (!getVersion().equals(other.getVersion())) 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) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.TensorFlowVersion parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.TensorFlowVersion 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.tpu.v1.TensorFlowVersion parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.TensorFlowVersion 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.tpu.v1.TensorFlowVersion parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v1.TensorFlowVersion parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v1.TensorFlowVersion parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.TensorFlowVersion 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.tpu.v1.TensorFlowVersion parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.TensorFlowVersion 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.tpu.v1.TensorFlowVersion parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v1.TensorFlowVersion 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.tpu.v1.TensorFlowVersion 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 tensorflow version that a Node can be configured with.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.TensorFlowVersion} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.TensorFlowVersion) + com.google.cloud.tpu.v1.TensorFlowVersionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_TensorFlowVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_TensorFlowVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.TensorFlowVersion.class, + com.google.cloud.tpu.v1.TensorFlowVersion.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.TensorFlowVersion.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_ = ""; + + version_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto + .internal_static_google_cloud_tpu_v1_TensorFlowVersion_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.TensorFlowVersion getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.TensorFlowVersion.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.TensorFlowVersion build() { + com.google.cloud.tpu.v1.TensorFlowVersion result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.TensorFlowVersion buildPartial() { + com.google.cloud.tpu.v1.TensorFlowVersion result = + new com.google.cloud.tpu.v1.TensorFlowVersion(this); + result.name_ = name_; + result.version_ = version_; + 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.tpu.v1.TensorFlowVersion) { + return mergeFrom((com.google.cloud.tpu.v1.TensorFlowVersion) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.TensorFlowVersion other) { + if (other == com.google.cloud.tpu.v1.TensorFlowVersion.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + 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.tpu.v1.TensorFlowVersion parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.TensorFlowVersion) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name.
+     * 
+ * + * 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 version_ = ""; + /** + * + * + *
+     * the tensorflow version.
+     * 
+ * + * string version = 2; + * + * @return The version. + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * the tensorflow version.
+     * 
+ * + * string version = 2; + * + * @return The bytes for version. + */ + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * the tensorflow version.
+     * 
+ * + * string version = 2; + * + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + version_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * the tensorflow version.
+     * 
+ * + * string version = 2; + * + * @return This builder for chaining. + */ + public Builder clearVersion() { + + version_ = getDefaultInstance().getVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * the tensorflow version.
+     * 
+ * + * string version = 2; + * + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + version_ = 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.tpu.v1.TensorFlowVersion) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.TensorFlowVersion) + private static final com.google.cloud.tpu.v1.TensorFlowVersion DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.TensorFlowVersion(); + } + + public static com.google.cloud.tpu.v1.TensorFlowVersion getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TensorFlowVersion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TensorFlowVersion(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.tpu.v1.TensorFlowVersion getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersionName.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersionName.java new file mode 100644 index 00000000..f7d4f58c --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersionName.java @@ -0,0 +1,231 @@ +/* + * 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.tpu.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 TensorFlowVersionName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_TENSOR_FLOW_VERSION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/tensorFlowVersions/{tensor_flow_version}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String tensorFlowVersion; + + @Deprecated + protected TensorFlowVersionName() { + project = null; + location = null; + tensorFlowVersion = null; + } + + private TensorFlowVersionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + tensorFlowVersion = Preconditions.checkNotNull(builder.getTensorFlowVersion()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getTensorFlowVersion() { + return tensorFlowVersion; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static TensorFlowVersionName of( + String project, String location, String tensorFlowVersion) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setTensorFlowVersion(tensorFlowVersion) + .build(); + } + + public static String format(String project, String location, String tensorFlowVersion) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setTensorFlowVersion(tensorFlowVersion) + .build() + .toString(); + } + + public static TensorFlowVersionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_TENSOR_FLOW_VERSION.validatedMatch( + formattedString, "TensorFlowVersionName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), matchMap.get("location"), matchMap.get("tensor_flow_version")); + } + + 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 (TensorFlowVersionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_TENSOR_FLOW_VERSION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (tensorFlowVersion != null) { + fieldMapBuilder.put("tensor_flow_version", tensorFlowVersion); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_TENSOR_FLOW_VERSION.instantiate( + "project", project, "location", location, "tensor_flow_version", tensorFlowVersion); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + TensorFlowVersionName that = ((TensorFlowVersionName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.tensorFlowVersion, that.tensorFlowVersion); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(tensorFlowVersion); + return h; + } + + /** + * Builder for projects/{project}/locations/{location}/tensorFlowVersions/{tensor_flow_version}. + */ + public static class Builder { + private String project; + private String location; + private String tensorFlowVersion; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getTensorFlowVersion() { + return tensorFlowVersion; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setTensorFlowVersion(String tensorFlowVersion) { + this.tensorFlowVersion = tensorFlowVersion; + return this; + } + + private Builder(TensorFlowVersionName tensorFlowVersionName) { + project = tensorFlowVersionName.project; + location = tensorFlowVersionName.location; + tensorFlowVersion = tensorFlowVersionName.tensorFlowVersion; + } + + public TensorFlowVersionName build() { + return new TensorFlowVersionName(this); + } + } +} diff --git a/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersionOrBuilder.java b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersionOrBuilder.java new file mode 100644 index 00000000..7192ca2d --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersionOrBuilder.java @@ -0,0 +1,75 @@ +/* + * 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/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface TensorFlowVersionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.TensorFlowVersion) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * the tensorflow version.
+   * 
+ * + * string version = 2; + * + * @return The version. + */ + java.lang.String getVersion(); + /** + * + * + *
+   * the tensorflow version.
+   * 
+ * + * string version = 2; + * + * @return The bytes for version. + */ + com.google.protobuf.ByteString getVersionBytes(); +} diff --git a/proto-google-cloud-tpu-v1/src/main/proto/google/cloud/tpu/v1/cloud_tpu.proto b/proto-google-cloud-tpu-v1/src/main/proto/google/cloud/tpu/v1/cloud_tpu.proto new file mode 100644 index 00000000..08e83550 --- /dev/null +++ b/proto-google-cloud-tpu-v1/src/main/proto/google/cloud/tpu/v1/cloud_tpu.proto @@ -0,0 +1,622 @@ +// 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.tpu.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/tpu/v1;tpu"; +option java_multiple_files = true; +option java_outer_classname = "CloudTpuProto"; +option java_package = "com.google.cloud.tpu.v1"; + +// Manages TPU nodes and other resources +// +// TPU API v1 +service Tpu { + option (google.api.default_host) = "tpu.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists nodes. + rpc ListNodes(ListNodesRequest) returns (ListNodesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/nodes" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the details of a node. + rpc GetNode(GetNodeRequest) returns (Node) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/nodes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a node. + rpc CreateNode(CreateNodeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/nodes" + body: "node" + }; + option (google.api.method_signature) = "parent,node,node_id"; + option (google.longrunning.operation_info) = { + response_type: "Node" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a node. + rpc DeleteNode(DeleteNodeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/nodes/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Node" + metadata_type: "OperationMetadata" + }; + } + + // Reimages a node's OS. + rpc ReimageNode(ReimageNodeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/nodes/*}:reimage" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Node" + metadata_type: "OperationMetadata" + }; + } + + // Stops a node. + rpc StopNode(StopNodeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/nodes/*}:stop" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Node" + metadata_type: "OperationMetadata" + }; + } + + // Starts a node. + rpc StartNode(StartNodeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/nodes/*}:start" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Node" + metadata_type: "OperationMetadata" + }; + } + + // List TensorFlow versions supported by this API. + rpc ListTensorFlowVersions(ListTensorFlowVersionsRequest) returns (ListTensorFlowVersionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/tensorflowVersions" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets TensorFlow Version. + rpc GetTensorFlowVersion(GetTensorFlowVersionRequest) returns (TensorFlowVersion) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/tensorflowVersions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists accelerator types supported by this API. + rpc ListAcceleratorTypes(ListAcceleratorTypesRequest) returns (ListAcceleratorTypesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/acceleratorTypes" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets AcceleratorType. + rpc GetAcceleratorType(GetAcceleratorTypeRequest) returns (AcceleratorType) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/acceleratorTypes/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Sets the scheduling options for this node. +message SchedulingConfig { + // Defines whether the node is preemptible. + bool preemptible = 1; + + // Whether the node is created under a reservation. + bool reserved = 2; +} + +// A network endpoint over which a TPU worker can be reached. +message NetworkEndpoint { + // The IP address of this network endpoint. + string ip_address = 1; + + // The port of this network endpoint. + int32 port = 2; +} + +// A TPU instance. +message Node { + option (google.api.resource) = { + type: "tpu.googleapis.com/Node" + pattern: "projects/{project}/locations/{location}/nodes/{node}" + }; + + // Represents the different states of a TPU node during its lifecycle. + enum State { + // TPU node state is not known/set. + STATE_UNSPECIFIED = 0; + + // TPU node is being created. + CREATING = 1; + + // TPU node has been created and is fully usable. + READY = 2; + + // TPU node is restarting. + RESTARTING = 3; + + // TPU node is undergoing reimaging. + REIMAGING = 4; + + // TPU node is being deleted. + DELETING = 5; + + // TPU node is being repaired and may be unusable. Details can be + // found in the `help_description` field. + REPAIRING = 6; + + // TPU node is stopped. + STOPPED = 8; + + // TPU node is currently stopping. + STOPPING = 9; + + // TPU node is currently starting. + STARTING = 10; + + // TPU node has been preempted. Only applies to Preemptible TPU Nodes. + PREEMPTED = 11; + + // TPU node has been terminated due to maintenance or has reached the end of + // its life cycle (for preemptible nodes). + TERMINATED = 12; + + // TPU node is currently hiding. + HIDING = 13; + + // TPU node has been hidden. + HIDDEN = 14; + + // TPU node is currently unhiding. + UNHIDING = 15; + } + + // Health defines the status of a TPU node as reported by + // Health Monitor. + enum Health { + // Health status is unknown: not initialized or failed to retrieve. + HEALTH_UNSPECIFIED = 0; + + // The resource is healthy. + HEALTHY = 1; + + // The resource is unhealthy. + DEPRECATED_UNHEALTHY = 2; + + // The resource is unresponsive. + TIMEOUT = 3; + + // The in-guest ML stack is unhealthy. + UNHEALTHY_TENSORFLOW = 4; + + // The node is under maintenance/priority boost caused rescheduling and + // will resume running once rescheduled. + UNHEALTHY_MAINTENANCE = 5; + } + + // TPU API Version. + enum ApiVersion { + // API version is unknown. + API_VERSION_UNSPECIFIED = 0; + + // TPU API V1Alpha1 version. + V1_ALPHA1 = 1; + + // TPU API V1 version. + V1 = 2; + + // TPU API V2Alpha1 version. + V2_ALPHA1 = 3; + } + + // Output only. Immutable. The name of the TPU + string name = 1 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // The user-supplied description of the TPU. Maximum of 512 characters. + string description = 3; + + // Required. The type of hardware accelerators associated with this node. + string accelerator_type = 5 [(google.api.field_behavior) = REQUIRED]; + + // Output only. DEPRECATED! Use network_endpoints instead. + // The network address for the TPU Node as visible to Compute Engine + // instances. + string ip_address = 8 [deprecated = true]; + + // Output only. DEPRECATED! Use network_endpoints instead. + // The network port for the TPU Node as visible to Compute Engine instances. + string port = 14 [deprecated = true]; + + // Output only. The current state for the TPU Node. + State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If this field is populated, it contains a description of why the TPU Node + // is unhealthy. + string health_description = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The version of Tensorflow running in the Node. + string tensorflow_version = 11 [(google.api.field_behavior) = REQUIRED]; + + // The name of a network they wish to peer the TPU node to. It must be a + // preexisting Compute Engine network inside of the project on which this API + // has been activated. If none is provided, "default" will be used. + string network = 12; + + // The CIDR block that the TPU node will use when selecting an IP address. + // This CIDR block must be a /29 block; the Compute Engine networks API + // forbids a smaller block, and using a larger block would be wasteful (a + // node can only consume one IP address). Errors will occur if the CIDR block + // has already been used for a currently existing TPU node, the CIDR block + // conflicts with any subnetworks in the user's provided network, or the + // provided network is peered with another network that is using that CIDR + // block. + string cidr_block = 13; + + // Output only. The service account used to run the tensor flow services within the node. + // To share resources, including Google Cloud Storage data, with the + // Tensorflow job running in the Node, this account must have permissions to + // that data. + string service_account = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the node was created. + google.protobuf.Timestamp create_time = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The scheduling options for this node. + SchedulingConfig scheduling_config = 17; + + // Output only. The network endpoints where TPU workers can be accessed and + // sent work. It is recommended that Tensorflow clients of the node reach out + // to the 0th entry in this map first. + repeated NetworkEndpoint network_endpoints = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The health status of the TPU node. + Health health = 22; + + // Resource labels to represent user-provided metadata. + map labels = 24; + + // Whether the VPC peering for the node is set up through Service Networking + // API. The VPC Peering should be set up before provisioning the node. + // If this field is set, cidr_block field should not be specified. If the + // network, that you want to peer the TPU Node to, is Shared VPC networks, + // the node must be created with this this field enabled. + bool use_service_networking = 27; + + // Output only. The API version that created this Node. + ApiVersion api_version = 38 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Symptoms that have occurred to the TPU Node. + repeated Symptom symptoms = 39 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request for [ListNodes][google.cloud.tpu.v1.Tpu.ListNodes]. +message ListNodesRequest { + // Required. The parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "tpu.googleapis.com/Node" + } + ]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; +} + +// Response for [ListNodes][google.cloud.tpu.v1.Tpu.ListNodes]. +message ListNodesResponse { + // The listed nodes. + repeated Node nodes = 1; + + // The next page token or empty if none. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request for [GetNode][google.cloud.tpu.v1.Tpu.GetNode]. +message GetNodeRequest { + // Required. The resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "tpu.googleapis.com/Node" + } + ]; +} + +// Request for [CreateNode][google.cloud.tpu.v1.Tpu.CreateNode]. +message CreateNodeRequest { + // Required. The parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "tpu.googleapis.com/Node" + } + ]; + + // The unqualified resource name. + string node_id = 2; + + // Required. The node. + Node node = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for [DeleteNode][google.cloud.tpu.v1.Tpu.DeleteNode]. +message DeleteNodeRequest { + // Required. The resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "tpu.googleapis.com/Node" + } + ]; +} + +// Request for [ReimageNode][google.cloud.tpu.v1.Tpu.ReimageNode]. +message ReimageNodeRequest { + // The resource name. + string name = 1; + + // The version for reimage to create. + string tensorflow_version = 2; +} + +// Request for [StopNode][google.cloud.tpu.v1.Tpu.StopNode]. +message StopNodeRequest { + // The resource name. + string name = 1; +} + +// Request for [StartNode][google.cloud.tpu.v1.Tpu.StartNode]. +message StartNodeRequest { + // The resource name. + string name = 1; +} + +// A tensorflow version that a Node can be configured with. +message TensorFlowVersion { + option (google.api.resource) = { + type: "tpu.googleapis.com/TensorFlowVersion" + pattern: "projects/{project}/locations/{location}/tensorFlowVersions/{tensor_flow_version}" + }; + + // The resource name. + string name = 1; + + // the tensorflow version. + string version = 2; +} + +// Request for [GetTensorFlowVersion][google.cloud.tpu.v1.Tpu.GetTensorFlowVersion]. +message GetTensorFlowVersionRequest { + // Required. The resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "tpu.googleapis.com/TensorFlowVersion" + } + ]; +} + +// Request for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions]. +message ListTensorFlowVersionsRequest { + // Required. The parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "tpu.googleapis.com/TensorFlowVersion" + } + ]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; + + // List filter. + string filter = 5; + + // Sort results. + string order_by = 6; +} + +// Response for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions]. +message ListTensorFlowVersionsResponse { + // The listed nodes. + repeated TensorFlowVersion tensorflow_versions = 1; + + // The next page token or empty if none. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// A accelerator type that a Node can be configured with. +message AcceleratorType { + option (google.api.resource) = { + type: "tpu.googleapis.com/AcceleratorType" + pattern: "projects/{project}/locations/{location}/acceleratorTypes/{accelerator_type}" + }; + + // The resource name. + string name = 1; + + // the accelerator type. + string type = 2; +} + +// Request for [GetAcceleratorType][google.cloud.tpu.v1.Tpu.GetAcceleratorType]. +message GetAcceleratorTypeRequest { + // Required. The resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "tpu.googleapis.com/AcceleratorType" + } + ]; +} + +// Request for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes]. +message ListAcceleratorTypesRequest { + // Required. The parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "tpu.googleapis.com/AcceleratorType" + } + ]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; + + // List filter. + string filter = 5; + + // Sort results. + string order_by = 6; +} + +// Response for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes]. +message ListAcceleratorTypesResponse { + // The listed nodes. + repeated AcceleratorType accelerator_types = 1; + + // The next page token or empty if none. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Note: the following OperationMetadata message was added manually. +// This is caused by a conflict with some other message and will +// be resolved separately. Please make sure to add this message back +// if it's removed during public proto regeneration. + +// Metadata describing an [Operation][google.longrunning.Operation] +message OperationMetadata { + // The time the operation was created. + google.protobuf.Timestamp create_time = 1; + + // The time the operation finished running. + google.protobuf.Timestamp end_time = 2; + + // Target of the operation - for example + // projects/project-1/connectivityTests/test-1 + string target = 3; + + // Name of the verb executed by the operation. + string verb = 4; + + // Human-readable status of the operation, if any. + string status_detail = 5; + + // Specifies if cancellation was requested for the operation. + bool cancel_requested = 6; + + // API version. + string api_version = 7; +} + +// A Symptom instance. +message Symptom { + // SymptomType represents the different types of Symptoms that a TPU can be + // at. + enum SymptomType { + // Unspecified symptom. + SYMPTOM_TYPE_UNSPECIFIED = 0; + + // TPU VM memory is low. + LOW_MEMORY = 1; + + // TPU runtime is out of memory. + OUT_OF_MEMORY = 2; + + // TPU runtime execution has timed out. + EXECUTE_TIMED_OUT = 3; + + // TPU runtime fails to construct a mesh that recognizes each TPU device's + // neighbors. + MESH_BUILD_FAIL = 4; + + // TPU HBM is out of memory. + HBM_OUT_OF_MEMORY = 5; + + // Abusive behaviors have been identified on the current project. + PROJECT_ABUSE = 6; + } + + // Timestamp when the Symptom is created. + google.protobuf.Timestamp create_time = 1; + + // Type of the Symptom. + SymptomType symptom_type = 2; + + // Detailed information of the current Symptom. + string details = 3; + + // A string used to uniquely distinguish a worker within a TPU node. + string worker_id = 4; +} diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..fdedcbad --- /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-tpu", + "^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..68d1dd0a --- /dev/null +++ b/samples/install-without-bom/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + com.google.cloud + tpu-install-without-bom + jar + Google Cloud TPU Install Without Bom + https://github.com/googleapis/java-tpu + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + google-cloud-tpu + 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..4ea4a3bd --- /dev/null +++ b/samples/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud-tpu-samples + 0.0.1-SNAPSHOT + pom + Google Cloud TPU Samples Parent + https://github.com/googleapis/java-tpu + + 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..52ea5823 --- /dev/null +++ b/samples/snapshot/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + com.google.cloud + tpu-snapshot + jar + Google Cloud TPU Snapshot Samples + https://github.com/googleapis/java-tpu + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-tpu + 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..b12bddf2 --- /dev/null +++ b/samples/snippets/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + com.google.cloud + tpu-snippets + jar + Google Cloud TPU Snippets + https://github.com/googleapis/java-tpu + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-tpu + 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..2913b315 --- /dev/null +++ b/versions.txt @@ -0,0 +1,6 @@ +# Format: +# module:released-version:current-version + +google-cloud-tpu:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-tpu-v1:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-tpu-v1:0.0.0:0.0.1-SNAPSHOT