From cf1039ae489de3bd78c58492dff2690f5573d6fc Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 9 Nov 2021 10:07:08 -0500 Subject: [PATCH] feat: TPU v2alpha1 public protos (#99) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: TPU v2alpha1 public protos Committer: @rosbo PiperOrigin-RevId: 403400668 Source-Link: https://github.com/googleapis/googleapis/commit/8f48b9778f9f875ac1931acccb1ff7bada71a372 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f966fd02bd0d248e9adeffe3bb2daa53bf44a252 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjk2NmZkMDJiZDBkMjQ4ZTlhZGVmZmUzYmIyZGFhNTNiZjQ0YTI1MiJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: remove unused dependencies * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Neenu1995 --- google-cloud-tpu-bom/pom.xml | 10 + google-cloud-tpu/pom.xml | 9 + .../google/cloud/tpu/v2alpha1/TpuClient.java | 1710 +++++ .../cloud/tpu/v2alpha1/TpuSettings.java | 391 + .../cloud/tpu/v2alpha1/gapic_metadata.json | 57 + .../cloud/tpu/v2alpha1/package-info.java | 40 + .../v2alpha1/stub/GrpcTpuCallableFactory.java | 115 + .../cloud/tpu/v2alpha1/stub/GrpcTpuStub.java | 654 ++ .../cloud/tpu/v2alpha1/stub/TpuStub.java | 162 + .../tpu/v2alpha1/stub/TpuStubSettings.java | 1017 +++ .../google/cloud/tpu/v2alpha1/MockTpu.java | 59 + .../cloud/tpu/v2alpha1/MockTpuImpl.java | 332 + .../cloud/tpu/v2alpha1/TpuClientTest.java | 1175 +++ grpc-google-cloud-tpu-v2alpha1/pom.xml | 69 + .../google/cloud/tpu/v2alpha1/TpuGrpc.java | 1720 +++++ pom.xml | 12 + .../clirr-ignored-differences.xml | 19 + proto-google-cloud-tpu-v2alpha1/pom.xml | 42 + .../cloud/tpu/v2alpha1/AcceleratorType.java | 813 ++ .../tpu/v2alpha1/AcceleratorTypeName.java | 227 + .../v2alpha1/AcceleratorTypeOrBuilder.java | 75 + .../cloud/tpu/v2alpha1/AccessConfig.java | 634 ++ .../tpu/v2alpha1/AccessConfigOrBuilder.java | 50 + .../cloud/tpu/v2alpha1/AttachedDisk.java | 974 +++ .../tpu/v2alpha1/AttachedDiskOrBuilder.java | 81 + .../cloud/tpu/v2alpha1/CloudTpuProto.java | 724 ++ .../cloud/tpu/v2alpha1/CreateNodeRequest.java | 1108 +++ .../v2alpha1/CreateNodeRequestOrBuilder.java | 117 + .../cloud/tpu/v2alpha1/DeleteNodeRequest.java | 649 ++ .../v2alpha1/DeleteNodeRequestOrBuilder.java | 54 + .../GenerateServiceIdentityRequest.java | 657 ++ ...nerateServiceIdentityRequestOrBuilder.java | 54 + .../GenerateServiceIdentityResponse.java | 742 ++ ...erateServiceIdentityResponseOrBuilder.java | 60 + .../v2alpha1/GetAcceleratorTypeRequest.java | 653 ++ .../GetAcceleratorTypeRequestOrBuilder.java | 54 + .../v2alpha1/GetGuestAttributesRequest.java | 1125 +++ .../GetGuestAttributesRequestOrBuilder.java | 134 + .../v2alpha1/GetGuestAttributesResponse.java | 965 +++ .../GetGuestAttributesResponseOrBuilder.java | 77 + .../cloud/tpu/v2alpha1/GetNodeRequest.java | 648 ++ .../tpu/v2alpha1/GetNodeRequestOrBuilder.java | 54 + .../v2alpha1/GetRuntimeVersionRequest.java | 653 ++ .../GetRuntimeVersionRequestOrBuilder.java | 54 + .../cloud/tpu/v2alpha1/GuestAttributes.java | 927 +++ .../tpu/v2alpha1/GuestAttributesEntry.java | 994 +++ .../GuestAttributesEntryOrBuilder.java | 100 + .../v2alpha1/GuestAttributesOrBuilder.java | 89 + .../tpu/v2alpha1/GuestAttributesValue.java | 955 +++ .../GuestAttributesValueOrBuilder.java | 77 + .../v2alpha1/ListAcceleratorTypesRequest.java | 1280 ++++ .../ListAcceleratorTypesRequestOrBuilder.java | 142 + .../ListAcceleratorTypesResponse.java | 1420 ++++ ...ListAcceleratorTypesResponseOrBuilder.java | 153 + .../cloud/tpu/v2alpha1/ListNodesRequest.java | 917 +++ .../v2alpha1/ListNodesRequestOrBuilder.java | 92 + .../cloud/tpu/v2alpha1/ListNodesResponse.java | 1400 ++++ .../v2alpha1/ListNodesResponseOrBuilder.java | 152 + .../v2alpha1/ListRuntimeVersionsRequest.java | 1280 ++++ .../ListRuntimeVersionsRequestOrBuilder.java | 142 + .../v2alpha1/ListRuntimeVersionsResponse.java | 1419 ++++ .../ListRuntimeVersionsResponseOrBuilder.java | 153 + .../cloud/tpu/v2alpha1/LocationName.java | 192 + .../cloud/tpu/v2alpha1/NetworkConfig.java | 932 +++ .../tpu/v2alpha1/NetworkConfigOrBuilder.java | 96 + .../cloud/tpu/v2alpha1/NetworkEndpoint.java | 1002 +++ .../v2alpha1/NetworkEndpointOrBuilder.java | 98 + .../com/google/cloud/tpu/v2alpha1/Node.java | 6651 +++++++++++++++++ .../google/cloud/tpu/v2alpha1/NodeName.java | 217 + .../cloud/tpu/v2alpha1/NodeOrBuilder.java | 791 ++ .../cloud/tpu/v2alpha1/OperationMetadata.java | 1809 +++++ .../v2alpha1/OperationMetadataOrBuilder.java | 210 + .../cloud/tpu/v2alpha1/RuntimeVersion.java | 813 ++ .../tpu/v2alpha1/RuntimeVersionName.java | 227 + .../tpu/v2alpha1/RuntimeVersionOrBuilder.java | 75 + .../cloud/tpu/v2alpha1/SchedulingConfig.java | 634 ++ .../v2alpha1/SchedulingConfigOrBuilder.java | 51 + .../cloud/tpu/v2alpha1/ServiceAccount.java | 934 +++ .../tpu/v2alpha1/ServiceAccountOrBuilder.java | 107 + .../cloud/tpu/v2alpha1/ServiceIdentity.java | 634 ++ .../v2alpha1/ServiceIdentityOrBuilder.java | 50 + .../cloud/tpu/v2alpha1/StartNodeRequest.java | 634 ++ .../v2alpha1/StartNodeRequestOrBuilder.java | 50 + .../cloud/tpu/v2alpha1/StopNodeRequest.java | 634 ++ .../v2alpha1/StopNodeRequestOrBuilder.java | 50 + .../google/cloud/tpu/v2alpha1/Symptom.java | 1485 ++++ .../cloud/tpu/v2alpha1/SymptomOrBuilder.java | 135 + .../cloud/tpu/v2alpha1/UpdateNodeRequest.java | 1031 +++ .../v2alpha1/UpdateNodeRequestOrBuilder.java | 104 + .../google/cloud/tpu/v2alpha1/cloud_tpu.proto | 782 ++ versions.txt | 2 + 91 files changed, 51151 insertions(+) create mode 100644 google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuClient.java create mode 100644 google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuSettings.java create mode 100644 google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/gapic_metadata.json create mode 100644 google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/package-info.java create mode 100644 google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/GrpcTpuCallableFactory.java create mode 100644 google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/GrpcTpuStub.java create mode 100644 google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStub.java create mode 100644 google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStubSettings.java create mode 100644 google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockTpu.java create mode 100644 google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockTpuImpl.java create mode 100644 google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/TpuClientTest.java create mode 100644 grpc-google-cloud-tpu-v2alpha1/pom.xml create mode 100644 grpc-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/TpuGrpc.java create mode 100644 proto-google-cloud-tpu-v2alpha1/clirr-ignored-differences.xml create mode 100644 proto-google-cloud-tpu-v2alpha1/pom.xml create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorType.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorTypeName.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorTypeOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AccessConfig.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AccessConfigOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AttachedDisk.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AttachedDiskOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CloudTpuProto.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CreateNodeRequest.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CreateNodeRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteNodeRequest.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteNodeRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityRequest.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityResponse.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityResponseOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetAcceleratorTypeRequest.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetAcceleratorTypeRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesRequest.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesResponse.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesResponseOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetNodeRequest.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetNodeRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetRuntimeVersionRequest.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetRuntimeVersionRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributes.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesEntry.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesEntryOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesValue.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesValueOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesRequest.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesResponse.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesResponseOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesRequest.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesResponse.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesResponseOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsRequest.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsResponse.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsResponseOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/LocationName.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfig.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfigOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkEndpoint.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkEndpointOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/Node.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NodeName.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NodeOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/OperationMetadata.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/OperationMetadataOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersion.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersionName.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersionOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SchedulingConfig.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SchedulingConfigOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceAccount.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceAccountOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceIdentity.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceIdentityOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StartNodeRequest.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StartNodeRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StopNodeRequest.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StopNodeRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/Symptom.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SymptomOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequest.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequestOrBuilder.java create mode 100644 proto-google-cloud-tpu-v2alpha1/src/main/proto/google/cloud/tpu/v2alpha1/cloud_tpu.proto diff --git a/google-cloud-tpu-bom/pom.xml b/google-cloud-tpu-bom/pom.xml index 57d71e96..a115d39a 100644 --- a/google-cloud-tpu-bom/pom.xml +++ b/google-cloud-tpu-bom/pom.xml @@ -63,11 +63,21 @@ grpc-google-cloud-tpu-v1 2.1.4-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-tpu-v2alpha1 + 2.1.4-SNAPSHOT + com.google.api.grpc proto-google-cloud-tpu-v1 2.1.4-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-tpu-v2alpha1 + 2.1.4-SNAPSHOT + diff --git a/google-cloud-tpu/pom.xml b/google-cloud-tpu/pom.xml index 78fc6cf4..2f10c890 100644 --- a/google-cloud-tpu/pom.xml +++ b/google-cloud-tpu/pom.xml @@ -42,6 +42,10 @@ proto-google-common-protos + + com.google.api.grpc + proto-google-cloud-tpu-v2alpha1 + com.google.api.grpc proto-google-cloud-tpu-v1 @@ -76,6 +80,11 @@ grpc-google-cloud-tpu-v1 test + + com.google.api.grpc + grpc-google-cloud-tpu-v2alpha1 + test + com.google.api diff --git a/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuClient.java b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuClient.java new file mode 100644 index 00000000..34050be6 --- /dev/null +++ b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuClient.java @@ -0,0 +1,1710 @@ +/* + * 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.v2alpha1; + +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.v2alpha1.stub.TpuStub; +import com.google.cloud.tpu.v2alpha1.stub.TpuStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Manages TPU nodes and other resources + * + *

TPU API v2alpha1 + * + *

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. + */ +@BetaApi +@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()) {
+   *   NodeName parent = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]");
+   *   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(NodeName 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 = LocationName.of("[PROJECT]", "[LOCATION]").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(LocationName.of("[PROJECT]", "[LOCATION]").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(LocationName.of("[PROJECT]", "[LOCATION]").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(LocationName.of("[PROJECT]", "[LOCATION]").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. + /** + * Stops a node. This operation is only available with single TPU nodes. + * + *

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. This operation is only available with single TPU nodes. + * + *

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. This operation is only available with single TPU nodes. + * + *

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. + /** + * Updates the configurations of a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   Node node = Node.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Node response = tpuClient.updateNodeAsync(node, updateMask).get();
+   * }
+   * }
+ * + * @param node Required. The node. Only fields specified in update_mask are updated. + * @param updateMask Required. Mask of fields from [Node][Tpu.Node] to update. Supported fields: + * None. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateNodeAsync( + Node node, FieldMask updateMask) { + UpdateNodeRequest request = + UpdateNodeRequest.newBuilder().setNode(node).setUpdateMask(updateMask).build(); + return updateNodeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the configurations of a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   UpdateNodeRequest request =
+   *       UpdateNodeRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setNode(Node.newBuilder().build())
+   *           .build();
+   *   Node response = tpuClient.updateNodeAsync(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 updateNodeAsync(UpdateNodeRequest request) { + return updateNodeOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the configurations of a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   UpdateNodeRequest request =
+   *       UpdateNodeRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setNode(Node.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       tpuClient.updateNodeOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Node response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateNodeOperationCallable() { + return stub.updateNodeOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the configurations of a node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   UpdateNodeRequest request =
+   *       UpdateNodeRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setNode(Node.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = tpuClient.updateNodeCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateNodeCallable() { + return stub.updateNodeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Generates the Cloud TPU service identity for the project. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   GenerateServiceIdentityRequest request =
+   *       GenerateServiceIdentityRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .build();
+   *   GenerateServiceIdentityResponse response = tpuClient.generateServiceIdentity(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 GenerateServiceIdentityResponse generateServiceIdentity( + GenerateServiceIdentityRequest request) { + return generateServiceIdentityCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Generates the Cloud TPU service identity for the project. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   GenerateServiceIdentityRequest request =
+   *       GenerateServiceIdentityRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       tpuClient.generateServiceIdentityCallable().futureCall(request);
+   *   // Do something.
+   *   GenerateServiceIdentityResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + generateServiceIdentityCallable() { + return stub.generateServiceIdentityCallable(); + } + + // 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(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists runtime versions supported by this API. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   RuntimeVersionName parent =
+   *       RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]");
+   *   for (RuntimeVersion element : tpuClient.listRuntimeVersions(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 ListRuntimeVersionsPagedResponse listRuntimeVersions(RuntimeVersionName parent) { + ListRuntimeVersionsRequest request = + ListRuntimeVersionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listRuntimeVersions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists runtime versions supported by this API. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   String parent =
+   *       RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]").toString();
+   *   for (RuntimeVersion element : tpuClient.listRuntimeVersions(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 ListRuntimeVersionsPagedResponse listRuntimeVersions(String parent) { + ListRuntimeVersionsRequest request = + ListRuntimeVersionsRequest.newBuilder().setParent(parent).build(); + return listRuntimeVersions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists runtime versions supported by this API. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   ListRuntimeVersionsRequest request =
+   *       ListRuntimeVersionsRequest.newBuilder()
+   *           .setParent(
+   *               RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (RuntimeVersion element : tpuClient.listRuntimeVersions(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 ListRuntimeVersionsPagedResponse listRuntimeVersions( + ListRuntimeVersionsRequest request) { + return listRuntimeVersionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists runtime versions supported by this API. + * + *

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   GetRuntimeVersionRequest request =
+   *       GetRuntimeVersionRequest.newBuilder()
+   *           .setName(
+   *               RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]").toString())
+   *           .build();
+   *   RuntimeVersion response = tpuClient.getRuntimeVersion(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 RuntimeVersion getRuntimeVersion(GetRuntimeVersionRequest request) { + return getRuntimeVersionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a runtime version. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   GetRuntimeVersionRequest request =
+   *       GetRuntimeVersionRequest.newBuilder()
+   *           .setName(
+   *               RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]").toString())
+   *           .build();
+   *   ApiFuture future = tpuClient.getRuntimeVersionCallable().futureCall(request);
+   *   // Do something.
+   *   RuntimeVersion response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getRuntimeVersionCallable() { + return stub.getRuntimeVersionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the guest attributes for the node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   GetGuestAttributesRequest request =
+   *       GetGuestAttributesRequest.newBuilder()
+   *           .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
+   *           .setQueryPath("queryPath-1807004403")
+   *           .addAllWorkerIds(new ArrayList())
+   *           .build();
+   *   GetGuestAttributesResponse response = tpuClient.getGuestAttributes(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 GetGuestAttributesResponse getGuestAttributes(GetGuestAttributesRequest request) { + return getGuestAttributesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the guest attributes for the node. + * + *

Sample code: + * + *

{@code
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   GetGuestAttributesRequest request =
+   *       GetGuestAttributesRequest.newBuilder()
+   *           .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
+   *           .setQueryPath("queryPath-1807004403")
+   *           .addAllWorkerIds(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       tpuClient.getGuestAttributesCallable().futureCall(request);
+   *   // Do something.
+   *   GetGuestAttributesResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getGuestAttributesCallable() { + return stub.getGuestAttributesCallable(); + } + + @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, input -> 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 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, + input -> 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); + } + } + + public static class ListRuntimeVersionsPagedResponse + extends AbstractPagedListResponse< + ListRuntimeVersionsRequest, + ListRuntimeVersionsResponse, + RuntimeVersion, + ListRuntimeVersionsPage, + ListRuntimeVersionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListRuntimeVersionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListRuntimeVersionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListRuntimeVersionsPagedResponse(ListRuntimeVersionsPage page) { + super(page, ListRuntimeVersionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListRuntimeVersionsPage + extends AbstractPage< + ListRuntimeVersionsRequest, + ListRuntimeVersionsResponse, + RuntimeVersion, + ListRuntimeVersionsPage> { + + private ListRuntimeVersionsPage( + PageContext + context, + ListRuntimeVersionsResponse response) { + super(context, response); + } + + private static ListRuntimeVersionsPage createEmptyPage() { + return new ListRuntimeVersionsPage(null, null); + } + + @Override + protected ListRuntimeVersionsPage createPage( + PageContext + context, + ListRuntimeVersionsResponse response) { + return new ListRuntimeVersionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListRuntimeVersionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListRuntimeVersionsRequest, + ListRuntimeVersionsResponse, + RuntimeVersion, + ListRuntimeVersionsPage, + ListRuntimeVersionsFixedSizeCollection> { + + private ListRuntimeVersionsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListRuntimeVersionsFixedSizeCollection createEmptyCollection() { + return new ListRuntimeVersionsFixedSizeCollection(null, 0); + } + + @Override + protected ListRuntimeVersionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListRuntimeVersionsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuSettings.java b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuSettings.java new file mode 100644 index 00000000..9bf9cd4b --- /dev/null +++ b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuSettings.java @@ -0,0 +1,391 @@ +/* + * 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.v2alpha1; + +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListRuntimeVersionsPagedResponse; + +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.v2alpha1.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();
+ * }
+ */ +@BetaApi +@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 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 updateNode. */ + public UnaryCallSettings updateNodeSettings() { + return ((TpuStubSettings) getStubSettings()).updateNodeSettings(); + } + + /** Returns the object with the settings used for calls to updateNode. */ + public OperationCallSettings + updateNodeOperationSettings() { + return ((TpuStubSettings) getStubSettings()).updateNodeOperationSettings(); + } + + /** Returns the object with the settings used for calls to generateServiceIdentity. */ + public UnaryCallSettings + generateServiceIdentitySettings() { + return ((TpuStubSettings) getStubSettings()).generateServiceIdentitySettings(); + } + + /** 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(); + } + + /** Returns the object with the settings used for calls to listRuntimeVersions. */ + public PagedCallSettings< + ListRuntimeVersionsRequest, ListRuntimeVersionsResponse, ListRuntimeVersionsPagedResponse> + listRuntimeVersionsSettings() { + return ((TpuStubSettings) getStubSettings()).listRuntimeVersionsSettings(); + } + + /** Returns the object with the settings used for calls to getRuntimeVersion. */ + public UnaryCallSettings getRuntimeVersionSettings() { + return ((TpuStubSettings) getStubSettings()).getRuntimeVersionSettings(); + } + + /** Returns the object with the settings used for calls to getGuestAttributes. */ + public UnaryCallSettings + getGuestAttributesSettings() { + return ((TpuStubSettings) getStubSettings()).getGuestAttributesSettings(); + } + + 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()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to 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 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 updateNode. */ + public UnaryCallSettings.Builder updateNodeSettings() { + return getStubSettingsBuilder().updateNodeSettings(); + } + + /** Returns the builder for the settings used for calls to updateNode. */ + public OperationCallSettings.Builder + updateNodeOperationSettings() { + return getStubSettingsBuilder().updateNodeOperationSettings(); + } + + /** Returns the builder for the settings used for calls to generateServiceIdentity. */ + public UnaryCallSettings.Builder< + GenerateServiceIdentityRequest, GenerateServiceIdentityResponse> + generateServiceIdentitySettings() { + return getStubSettingsBuilder().generateServiceIdentitySettings(); + } + + /** 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(); + } + + /** Returns the builder for the settings used for calls to listRuntimeVersions. */ + public PagedCallSettings.Builder< + ListRuntimeVersionsRequest, + ListRuntimeVersionsResponse, + ListRuntimeVersionsPagedResponse> + listRuntimeVersionsSettings() { + return getStubSettingsBuilder().listRuntimeVersionsSettings(); + } + + /** Returns the builder for the settings used for calls to getRuntimeVersion. */ + public UnaryCallSettings.Builder + getRuntimeVersionSettings() { + return getStubSettingsBuilder().getRuntimeVersionSettings(); + } + + /** Returns the builder for the settings used for calls to getGuestAttributes. */ + public UnaryCallSettings.Builder + getGuestAttributesSettings() { + return getStubSettingsBuilder().getGuestAttributesSettings(); + } + + @Override + public TpuSettings build() throws IOException { + return new TpuSettings(this); + } + } +} diff --git a/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/gapic_metadata.json b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/gapic_metadata.json new file mode 100644 index 00000000..db678f19 --- /dev/null +++ b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/gapic_metadata.json @@ -0,0 +1,57 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.tpu.v2alpha1", + "libraryPackage": "com.google.cloud.tpu.v2alpha1", + "services": { + "Tpu": { + "clients": { + "grpc": { + "libraryClient": "TpuClient", + "rpcs": { + "CreateNode": { + "methods": ["createNodeAsync", "createNodeAsync", "createNodeAsync", "createNodeOperationCallable", "createNodeCallable"] + }, + "DeleteNode": { + "methods": ["deleteNodeAsync", "deleteNodeAsync", "deleteNodeAsync", "deleteNodeOperationCallable", "deleteNodeCallable"] + }, + "GenerateServiceIdentity": { + "methods": ["generateServiceIdentity", "generateServiceIdentityCallable"] + }, + "GetAcceleratorType": { + "methods": ["getAcceleratorType", "getAcceleratorType", "getAcceleratorType", "getAcceleratorTypeCallable"] + }, + "GetGuestAttributes": { + "methods": ["getGuestAttributes", "getGuestAttributesCallable"] + }, + "GetNode": { + "methods": ["getNode", "getNode", "getNode", "getNodeCallable"] + }, + "GetRuntimeVersion": { + "methods": ["getRuntimeVersion", "getRuntimeVersion", "getRuntimeVersion", "getRuntimeVersionCallable"] + }, + "ListAcceleratorTypes": { + "methods": ["listAcceleratorTypes", "listAcceleratorTypes", "listAcceleratorTypes", "listAcceleratorTypesPagedCallable", "listAcceleratorTypesCallable"] + }, + "ListNodes": { + "methods": ["listNodes", "listNodes", "listNodes", "listNodesPagedCallable", "listNodesCallable"] + }, + "ListRuntimeVersions": { + "methods": ["listRuntimeVersions", "listRuntimeVersions", "listRuntimeVersions", "listRuntimeVersionsPagedCallable", "listRuntimeVersionsCallable"] + }, + "StartNode": { + "methods": ["startNodeAsync", "startNodeOperationCallable", "startNodeCallable"] + }, + "StopNode": { + "methods": ["stopNodeAsync", "stopNodeOperationCallable", "stopNodeCallable"] + }, + "UpdateNode": { + "methods": ["updateNodeAsync", "updateNodeAsync", "updateNodeOperationCallable", "updateNodeCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/package-info.java b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/package-info.java new file mode 100644 index 00000000..8f0680cb --- /dev/null +++ b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/package-info.java @@ -0,0 +1,40 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Cloud TPU API + * + *

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

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

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

TPU API v2alpha1 + * + *

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.v2alpha1; + +import javax.annotation.Generated; diff --git a/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/GrpcTpuCallableFactory.java b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/GrpcTpuCallableFactory.java new file mode 100644 index 00000000..0c8ac5c2 --- /dev/null +++ b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/GrpcTpuCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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.v2alpha1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Tpu service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@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/v2alpha1/stub/GrpcTpuStub.java b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/GrpcTpuStub.java new file mode 100644 index 00000000..4f98a470 --- /dev/null +++ b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/GrpcTpuStub.java @@ -0,0 +1,654 @@ +/* + * 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.v2alpha1.stub; + +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListRuntimeVersionsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.tpu.v2alpha1.AcceleratorType; +import com.google.cloud.tpu.v2alpha1.CreateNodeRequest; +import com.google.cloud.tpu.v2alpha1.DeleteNodeRequest; +import com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest; +import com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse; +import com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest; +import com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest; +import com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse; +import com.google.cloud.tpu.v2alpha1.GetNodeRequest; +import com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest; +import com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest; +import com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse; +import com.google.cloud.tpu.v2alpha1.ListNodesRequest; +import com.google.cloud.tpu.v2alpha1.ListNodesResponse; +import com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest; +import com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse; +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.OperationMetadata; +import com.google.cloud.tpu.v2alpha1.RuntimeVersion; +import com.google.cloud.tpu.v2alpha1.StartNodeRequest; +import com.google.cloud.tpu.v2alpha1.StopNodeRequest; +import com.google.cloud.tpu.v2alpha1.UpdateNodeRequest; +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.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. + */ +@BetaApi +@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.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.Tpu/DeleteNode") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteNodeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor stopNodeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v2alpha1.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.v2alpha1.Tpu/StartNode") + .setRequestMarshaller(ProtoUtils.marshaller(StartNodeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor updateNodeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v2alpha1.Tpu/UpdateNode") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateNodeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + GenerateServiceIdentityRequest, GenerateServiceIdentityResponse> + generateServiceIdentityMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v2alpha1.Tpu/GenerateServiceIdentity") + .setRequestMarshaller( + ProtoUtils.marshaller(GenerateServiceIdentityRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GenerateServiceIdentityResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listAcceleratorTypesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v2alpha1.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.v2alpha1.Tpu/GetAcceleratorType") + .setRequestMarshaller( + ProtoUtils.marshaller(GetAcceleratorTypeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(AcceleratorType.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listRuntimeVersionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v2alpha1.Tpu/ListRuntimeVersions") + .setRequestMarshaller( + ProtoUtils.marshaller(ListRuntimeVersionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListRuntimeVersionsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getRuntimeVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v2alpha1.Tpu/GetRuntimeVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(GetRuntimeVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RuntimeVersion.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getGuestAttributesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v2alpha1.Tpu/GetGuestAttributes") + .setRequestMarshaller( + ProtoUtils.marshaller(GetGuestAttributesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GetGuestAttributesResponse.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 stopNodeCallable; + private final OperationCallable + stopNodeOperationCallable; + private final UnaryCallable startNodeCallable; + private final OperationCallable + startNodeOperationCallable; + private final UnaryCallable updateNodeCallable; + private final OperationCallable + updateNodeOperationCallable; + private final UnaryCallable + generateServiceIdentityCallable; + private final UnaryCallable + listAcceleratorTypesCallable; + private final UnaryCallable + listAcceleratorTypesPagedCallable; + private final UnaryCallable + getAcceleratorTypeCallable; + private final UnaryCallable + listRuntimeVersionsCallable; + private final UnaryCallable + listRuntimeVersionsPagedCallable; + private final UnaryCallable getRuntimeVersionCallable; + private final UnaryCallable + getGuestAttributesCallable; + + 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( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getNodeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getNodeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createNodeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createNodeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteNodeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteNodeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings stopNodeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(stopNodeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings startNodeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(startNodeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings updateNodeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateNodeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("node.name", String.valueOf(request.getNode().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + generateServiceIdentityTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(generateServiceIdentityMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + listAcceleratorTypesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listAcceleratorTypesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + getAcceleratorTypeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getAcceleratorTypeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listRuntimeVersionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listRuntimeVersionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getRuntimeVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getRuntimeVersionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + getGuestAttributesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getGuestAttributesMethodDescriptor) + .setParamsExtractor( + 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.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.updateNodeCallable = + callableFactory.createUnaryCallable( + updateNodeTransportSettings, settings.updateNodeSettings(), clientContext); + this.updateNodeOperationCallable = + callableFactory.createOperationCallable( + updateNodeTransportSettings, + settings.updateNodeOperationSettings(), + clientContext, + operationsStub); + this.generateServiceIdentityCallable = + callableFactory.createUnaryCallable( + generateServiceIdentityTransportSettings, + settings.generateServiceIdentitySettings(), + 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.listRuntimeVersionsCallable = + callableFactory.createUnaryCallable( + listRuntimeVersionsTransportSettings, + settings.listRuntimeVersionsSettings(), + clientContext); + this.listRuntimeVersionsPagedCallable = + callableFactory.createPagedCallable( + listRuntimeVersionsTransportSettings, + settings.listRuntimeVersionsSettings(), + clientContext); + this.getRuntimeVersionCallable = + callableFactory.createUnaryCallable( + getRuntimeVersionTransportSettings, + settings.getRuntimeVersionSettings(), + clientContext); + this.getGuestAttributesCallable = + callableFactory.createUnaryCallable( + getGuestAttributesTransportSettings, + settings.getGuestAttributesSettings(), + 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 stopNodeCallable() { + return stopNodeCallable; + } + + @Override + public OperationCallable stopNodeOperationCallable() { + return stopNodeOperationCallable; + } + + @Override + public UnaryCallable startNodeCallable() { + return startNodeCallable; + } + + @Override + public OperationCallable startNodeOperationCallable() { + return startNodeOperationCallable; + } + + @Override + public UnaryCallable updateNodeCallable() { + return updateNodeCallable; + } + + @Override + public OperationCallable + updateNodeOperationCallable() { + return updateNodeOperationCallable; + } + + @Override + public UnaryCallable + generateServiceIdentityCallable() { + return generateServiceIdentityCallable; + } + + @Override + public UnaryCallable + listAcceleratorTypesCallable() { + return listAcceleratorTypesCallable; + } + + @Override + public UnaryCallable + listAcceleratorTypesPagedCallable() { + return listAcceleratorTypesPagedCallable; + } + + @Override + public UnaryCallable getAcceleratorTypeCallable() { + return getAcceleratorTypeCallable; + } + + @Override + public UnaryCallable + listRuntimeVersionsCallable() { + return listRuntimeVersionsCallable; + } + + @Override + public UnaryCallable + listRuntimeVersionsPagedCallable() { + return listRuntimeVersionsPagedCallable; + } + + @Override + public UnaryCallable getRuntimeVersionCallable() { + return getRuntimeVersionCallable; + } + + @Override + public UnaryCallable + getGuestAttributesCallable() { + return getGuestAttributesCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStub.java b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStub.java new file mode 100644 index 00000000..4d95863a --- /dev/null +++ b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStub.java @@ -0,0 +1,162 @@ +/* + * 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.v2alpha1.stub; + +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListRuntimeVersionsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.tpu.v2alpha1.AcceleratorType; +import com.google.cloud.tpu.v2alpha1.CreateNodeRequest; +import com.google.cloud.tpu.v2alpha1.DeleteNodeRequest; +import com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest; +import com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse; +import com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest; +import com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest; +import com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse; +import com.google.cloud.tpu.v2alpha1.GetNodeRequest; +import com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest; +import com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest; +import com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse; +import com.google.cloud.tpu.v2alpha1.ListNodesRequest; +import com.google.cloud.tpu.v2alpha1.ListNodesResponse; +import com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest; +import com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse; +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.OperationMetadata; +import com.google.cloud.tpu.v2alpha1.RuntimeVersion; +import com.google.cloud.tpu.v2alpha1.StartNodeRequest; +import com.google.cloud.tpu.v2alpha1.StopNodeRequest; +import com.google.cloud.tpu.v2alpha1.UpdateNodeRequest; +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. + */ +@BetaApi +@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 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 OperationCallable + updateNodeOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateNodeOperationCallable()"); + } + + public UnaryCallable updateNodeCallable() { + throw new UnsupportedOperationException("Not implemented: updateNodeCallable()"); + } + + public UnaryCallable + generateServiceIdentityCallable() { + throw new UnsupportedOperationException("Not implemented: generateServiceIdentityCallable()"); + } + + 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()"); + } + + public UnaryCallable + listRuntimeVersionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listRuntimeVersionsPagedCallable()"); + } + + public UnaryCallable + listRuntimeVersionsCallable() { + throw new UnsupportedOperationException("Not implemented: listRuntimeVersionsCallable()"); + } + + public UnaryCallable getRuntimeVersionCallable() { + throw new UnsupportedOperationException("Not implemented: getRuntimeVersionCallable()"); + } + + public UnaryCallable + getGuestAttributesCallable() { + throw new UnsupportedOperationException("Not implemented: getGuestAttributesCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStubSettings.java b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStubSettings.java new file mode 100644 index 00000000..6c43e788 --- /dev/null +++ b/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStubSettings.java @@ -0,0 +1,1017 @@ +/* + * 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.v2alpha1.stub; + +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListRuntimeVersionsPagedResponse; + +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.v2alpha1.AcceleratorType; +import com.google.cloud.tpu.v2alpha1.CreateNodeRequest; +import com.google.cloud.tpu.v2alpha1.DeleteNodeRequest; +import com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest; +import com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse; +import com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest; +import com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest; +import com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse; +import com.google.cloud.tpu.v2alpha1.GetNodeRequest; +import com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest; +import com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest; +import com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse; +import com.google.cloud.tpu.v2alpha1.ListNodesRequest; +import com.google.cloud.tpu.v2alpha1.ListNodesResponse; +import com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest; +import com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse; +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.OperationMetadata; +import com.google.cloud.tpu.v2alpha1.RuntimeVersion; +import com.google.cloud.tpu.v2alpha1.StartNodeRequest; +import com.google.cloud.tpu.v2alpha1.StopNodeRequest; +import com.google.cloud.tpu.v2alpha1.UpdateNodeRequest; +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();
+ * }
+ */ +@BetaApi +@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 stopNodeSettings; + private final OperationCallSettings + stopNodeOperationSettings; + private final UnaryCallSettings startNodeSettings; + private final OperationCallSettings + startNodeOperationSettings; + private final UnaryCallSettings updateNodeSettings; + private final OperationCallSettings + updateNodeOperationSettings; + private final UnaryCallSettings + generateServiceIdentitySettings; + private final PagedCallSettings< + ListAcceleratorTypesRequest, + ListAcceleratorTypesResponse, + ListAcceleratorTypesPagedResponse> + listAcceleratorTypesSettings; + private final UnaryCallSettings + getAcceleratorTypeSettings; + private final PagedCallSettings< + ListRuntimeVersionsRequest, ListRuntimeVersionsResponse, ListRuntimeVersionsPagedResponse> + listRuntimeVersionsSettings; + private final UnaryCallSettings + getRuntimeVersionSettings; + private final UnaryCallSettings + getGuestAttributesSettings; + + 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< + 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 PagedListDescriptor< + ListRuntimeVersionsRequest, ListRuntimeVersionsResponse, RuntimeVersion> + LIST_RUNTIME_VERSIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListRuntimeVersionsRequest, ListRuntimeVersionsResponse, RuntimeVersion>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListRuntimeVersionsRequest injectToken( + ListRuntimeVersionsRequest payload, String token) { + return ListRuntimeVersionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListRuntimeVersionsRequest injectPageSize( + ListRuntimeVersionsRequest payload, int pageSize) { + return ListRuntimeVersionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListRuntimeVersionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListRuntimeVersionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListRuntimeVersionsResponse payload) { + return payload.getRuntimeVersionsList() == null + ? ImmutableList.of() + : payload.getRuntimeVersionsList(); + } + }; + + 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< + 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); + } + }; + + private static final PagedListResponseFactory< + ListRuntimeVersionsRequest, ListRuntimeVersionsResponse, ListRuntimeVersionsPagedResponse> + LIST_RUNTIME_VERSIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListRuntimeVersionsRequest, + ListRuntimeVersionsResponse, + ListRuntimeVersionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListRuntimeVersionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_RUNTIME_VERSIONS_PAGE_STR_DESC, request, context); + return ListRuntimeVersionsPagedResponse.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 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 updateNode. */ + public UnaryCallSettings updateNodeSettings() { + return updateNodeSettings; + } + + /** Returns the object with the settings used for calls to updateNode. */ + public OperationCallSettings + updateNodeOperationSettings() { + return updateNodeOperationSettings; + } + + /** Returns the object with the settings used for calls to generateServiceIdentity. */ + public UnaryCallSettings + generateServiceIdentitySettings() { + return generateServiceIdentitySettings; + } + + /** 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; + } + + /** Returns the object with the settings used for calls to listRuntimeVersions. */ + public PagedCallSettings< + ListRuntimeVersionsRequest, ListRuntimeVersionsResponse, ListRuntimeVersionsPagedResponse> + listRuntimeVersionsSettings() { + return listRuntimeVersionsSettings; + } + + /** Returns the object with the settings used for calls to getRuntimeVersion. */ + public UnaryCallSettings getRuntimeVersionSettings() { + return getRuntimeVersionSettings; + } + + /** Returns the object with the settings used for calls to getGuestAttributes. */ + public UnaryCallSettings + getGuestAttributesSettings() { + return getGuestAttributesSettings; + } + + @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 mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "tpu.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(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(); + stopNodeSettings = settingsBuilder.stopNodeSettings().build(); + stopNodeOperationSettings = settingsBuilder.stopNodeOperationSettings().build(); + startNodeSettings = settingsBuilder.startNodeSettings().build(); + startNodeOperationSettings = settingsBuilder.startNodeOperationSettings().build(); + updateNodeSettings = settingsBuilder.updateNodeSettings().build(); + updateNodeOperationSettings = settingsBuilder.updateNodeOperationSettings().build(); + generateServiceIdentitySettings = settingsBuilder.generateServiceIdentitySettings().build(); + listAcceleratorTypesSettings = settingsBuilder.listAcceleratorTypesSettings().build(); + getAcceleratorTypeSettings = settingsBuilder.getAcceleratorTypeSettings().build(); + listRuntimeVersionsSettings = settingsBuilder.listRuntimeVersionsSettings().build(); + getRuntimeVersionSettings = settingsBuilder.getRuntimeVersionSettings().build(); + getGuestAttributesSettings = settingsBuilder.getGuestAttributesSettings().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 stopNodeSettings; + private final OperationCallSettings.Builder + stopNodeOperationSettings; + private final UnaryCallSettings.Builder startNodeSettings; + private final OperationCallSettings.Builder + startNodeOperationSettings; + private final UnaryCallSettings.Builder updateNodeSettings; + private final OperationCallSettings.Builder + updateNodeOperationSettings; + private final UnaryCallSettings.Builder< + GenerateServiceIdentityRequest, GenerateServiceIdentityResponse> + generateServiceIdentitySettings; + private final PagedCallSettings.Builder< + ListAcceleratorTypesRequest, + ListAcceleratorTypesResponse, + ListAcceleratorTypesPagedResponse> + listAcceleratorTypesSettings; + private final UnaryCallSettings.Builder + getAcceleratorTypeSettings; + private final PagedCallSettings.Builder< + ListRuntimeVersionsRequest, + ListRuntimeVersionsResponse, + ListRuntimeVersionsPagedResponse> + listRuntimeVersionsSettings; + private final UnaryCallSettings.Builder + getRuntimeVersionSettings; + private final UnaryCallSettings.Builder + getGuestAttributesSettings; + 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(); + stopNodeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + stopNodeOperationSettings = OperationCallSettings.newBuilder(); + startNodeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + startNodeOperationSettings = OperationCallSettings.newBuilder(); + updateNodeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateNodeOperationSettings = OperationCallSettings.newBuilder(); + generateServiceIdentitySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listAcceleratorTypesSettings = + PagedCallSettings.newBuilder(LIST_ACCELERATOR_TYPES_PAGE_STR_FACT); + getAcceleratorTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listRuntimeVersionsSettings = + PagedCallSettings.newBuilder(LIST_RUNTIME_VERSIONS_PAGE_STR_FACT); + getRuntimeVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getGuestAttributesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listNodesSettings, + getNodeSettings, + createNodeSettings, + deleteNodeSettings, + stopNodeSettings, + startNodeSettings, + updateNodeSettings, + generateServiceIdentitySettings, + listAcceleratorTypesSettings, + getAcceleratorTypeSettings, + listRuntimeVersionsSettings, + getRuntimeVersionSettings, + getGuestAttributesSettings); + 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(); + stopNodeSettings = settings.stopNodeSettings.toBuilder(); + stopNodeOperationSettings = settings.stopNodeOperationSettings.toBuilder(); + startNodeSettings = settings.startNodeSettings.toBuilder(); + startNodeOperationSettings = settings.startNodeOperationSettings.toBuilder(); + updateNodeSettings = settings.updateNodeSettings.toBuilder(); + updateNodeOperationSettings = settings.updateNodeOperationSettings.toBuilder(); + generateServiceIdentitySettings = settings.generateServiceIdentitySettings.toBuilder(); + listAcceleratorTypesSettings = settings.listAcceleratorTypesSettings.toBuilder(); + getAcceleratorTypeSettings = settings.getAcceleratorTypeSettings.toBuilder(); + listRuntimeVersionsSettings = settings.listRuntimeVersionsSettings.toBuilder(); + getRuntimeVersionSettings = settings.getRuntimeVersionSettings.toBuilder(); + getGuestAttributesSettings = settings.getGuestAttributesSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listNodesSettings, + getNodeSettings, + createNodeSettings, + deleteNodeSettings, + stopNodeSettings, + startNodeSettings, + updateNodeSettings, + generateServiceIdentitySettings, + listAcceleratorTypesSettings, + getAcceleratorTypeSettings, + listRuntimeVersionsSettings, + getRuntimeVersionSettings, + getGuestAttributesSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .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 + .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 + .updateNodeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .generateServiceIdentitySettings() + .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 + .listRuntimeVersionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getRuntimeVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getGuestAttributesSettings() + .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 + .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())); + + builder + .updateNodeOperationSettings() + .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; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to 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 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 updateNode. */ + public UnaryCallSettings.Builder updateNodeSettings() { + return updateNodeSettings; + } + + /** Returns the builder for the settings used for calls to updateNode. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateNodeOperationSettings() { + return updateNodeOperationSettings; + } + + /** Returns the builder for the settings used for calls to generateServiceIdentity. */ + public UnaryCallSettings.Builder< + GenerateServiceIdentityRequest, GenerateServiceIdentityResponse> + generateServiceIdentitySettings() { + return generateServiceIdentitySettings; + } + + /** 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; + } + + /** Returns the builder for the settings used for calls to listRuntimeVersions. */ + public PagedCallSettings.Builder< + ListRuntimeVersionsRequest, + ListRuntimeVersionsResponse, + ListRuntimeVersionsPagedResponse> + listRuntimeVersionsSettings() { + return listRuntimeVersionsSettings; + } + + /** Returns the builder for the settings used for calls to getRuntimeVersion. */ + public UnaryCallSettings.Builder + getRuntimeVersionSettings() { + return getRuntimeVersionSettings; + } + + /** Returns the builder for the settings used for calls to getGuestAttributes. */ + public UnaryCallSettings.Builder + getGuestAttributesSettings() { + return getGuestAttributesSettings; + } + + @Override + public TpuStubSettings build() throws IOException { + return new TpuStubSettings(this); + } + } +} diff --git a/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockTpu.java b/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockTpu.java new file mode 100644 index 00000000..e404d627 --- /dev/null +++ b/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/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.v2alpha1; + +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/v2alpha1/MockTpuImpl.java b/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockTpuImpl.java new file mode 100644 index 00000000..1d17ca0e --- /dev/null +++ b/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockTpuImpl.java @@ -0,0 +1,332 @@ +/* + * 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.v2alpha1; + +import com.google.api.core.BetaApi; +import com.google.cloud.tpu.v2alpha1.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 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 updateNode(UpdateNodeRequest 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 UpdateNode, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void generateServiceIdentity( + GenerateServiceIdentityRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof GenerateServiceIdentityResponse) { + requests.add(request); + responseObserver.onNext(((GenerateServiceIdentityResponse) 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 GenerateServiceIdentity, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + GenerateServiceIdentityResponse.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()))); + } + } + + @Override + public void listRuntimeVersions( + ListRuntimeVersionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListRuntimeVersionsResponse) { + requests.add(request); + responseObserver.onNext(((ListRuntimeVersionsResponse) 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 ListRuntimeVersions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListRuntimeVersionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getRuntimeVersion( + GetRuntimeVersionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RuntimeVersion) { + requests.add(request); + responseObserver.onNext(((RuntimeVersion) 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 GetRuntimeVersion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RuntimeVersion.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getGuestAttributes( + GetGuestAttributesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof GetGuestAttributesResponse) { + requests.add(request); + responseObserver.onNext(((GetGuestAttributesResponse) 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 GetGuestAttributes, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + GetGuestAttributesResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/TpuClientTest.java b/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/TpuClientTest.java new file mode 100644 index 00000000..5147cf3b --- /dev/null +++ b/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/TpuClientTest.java @@ -0,0 +1,1175 @@ +/* + * 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.v2alpha1; + +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListRuntimeVersionsPagedResponse; + +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.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class TpuClientTest { + private static MockServiceHelper mockServiceHelper; + private static MockTpu mockTpu; + private LocalChannelProvider channelProvider; + private TpuClient client; + + @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); + + NodeName parent = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); + + 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 { + NodeName parent = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); + 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") + .setHealthDescription("healthDescription1231837184") + .setRuntimeVersion("runtimeVersion602071520") + .setNetworkConfig(NetworkConfig.newBuilder().build()) + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount(ServiceAccount.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .putAllMetadata(new HashMap()) + .addAllTags(new ArrayList()) + .setId(3355) + .addAllDataDisks(new ArrayList()) + .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") + .setHealthDescription("healthDescription1231837184") + .setRuntimeVersion("runtimeVersion602071520") + .setNetworkConfig(NetworkConfig.newBuilder().build()) + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount(ServiceAccount.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .putAllMetadata(new HashMap()) + .addAllTags(new ArrayList()) + .setId(3355) + .addAllDataDisks(new ArrayList()) + .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") + .setHealthDescription("healthDescription1231837184") + .setRuntimeVersion("runtimeVersion602071520") + .setNetworkConfig(NetworkConfig.newBuilder().build()) + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount(ServiceAccount.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .putAllMetadata(new HashMap()) + .addAllTags(new ArrayList()) + .setId(3355) + .addAllDataDisks(new ArrayList()) + .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") + .setHealthDescription("healthDescription1231837184") + .setRuntimeVersion("runtimeVersion602071520") + .setNetworkConfig(NetworkConfig.newBuilder().build()) + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount(ServiceAccount.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .putAllMetadata(new HashMap()) + .addAllTags(new ArrayList()) + .setId(3355) + .addAllDataDisks(new ArrayList()) + .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") + .setHealthDescription("healthDescription1231837184") + .setRuntimeVersion("runtimeVersion602071520") + .setNetworkConfig(NetworkConfig.newBuilder().build()) + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount(ServiceAccount.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .putAllMetadata(new HashMap()) + .addAllTags(new ArrayList()) + .setId(3355) + .addAllDataDisks(new ArrayList()) + .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") + .setHealthDescription("healthDescription1231837184") + .setRuntimeVersion("runtimeVersion602071520") + .setNetworkConfig(NetworkConfig.newBuilder().build()) + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount(ServiceAccount.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .putAllMetadata(new HashMap()) + .addAllTags(new ArrayList()) + .setId(3355) + .addAllDataDisks(new ArrayList()) + .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 stopNodeTest() throws Exception { + Node expectedResponse = + Node.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setDescription("description-1724546052") + .setAcceleratorType("acceleratorType-82462651") + .setHealthDescription("healthDescription1231837184") + .setRuntimeVersion("runtimeVersion602071520") + .setNetworkConfig(NetworkConfig.newBuilder().build()) + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount(ServiceAccount.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .putAllMetadata(new HashMap()) + .addAllTags(new ArrayList()) + .setId(3355) + .addAllDataDisks(new ArrayList()) + .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") + .setHealthDescription("healthDescription1231837184") + .setRuntimeVersion("runtimeVersion602071520") + .setNetworkConfig(NetworkConfig.newBuilder().build()) + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount(ServiceAccount.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .putAllMetadata(new HashMap()) + .addAllTags(new ArrayList()) + .setId(3355) + .addAllDataDisks(new ArrayList()) + .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 updateNodeTest() throws Exception { + Node expectedResponse = + Node.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setDescription("description-1724546052") + .setAcceleratorType("acceleratorType-82462651") + .setHealthDescription("healthDescription1231837184") + .setRuntimeVersion("runtimeVersion602071520") + .setNetworkConfig(NetworkConfig.newBuilder().build()) + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount(ServiceAccount.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .putAllMetadata(new HashMap()) + .addAllTags(new ArrayList()) + .setId(3355) + .addAllDataDisks(new ArrayList()) + .addAllSymptoms(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateNodeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTpu.addResponse(resultOperation); + + Node node = Node.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Node actualResponse = client.updateNodeAsync(node, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateNodeRequest actualRequest = ((UpdateNodeRequest) actualRequests.get(0)); + + Assert.assertEquals(node, actualRequest.getNode()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateNodeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + Node node = Node.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateNodeAsync(node, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void generateServiceIdentityTest() throws Exception { + GenerateServiceIdentityResponse expectedResponse = + GenerateServiceIdentityResponse.newBuilder() + .setIdentity(ServiceIdentity.newBuilder().build()) + .build(); + mockTpu.addResponse(expectedResponse); + + GenerateServiceIdentityRequest request = + GenerateServiceIdentityRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + + GenerateServiceIdentityResponse actualResponse = client.generateServiceIdentity(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GenerateServiceIdentityRequest actualRequest = + ((GenerateServiceIdentityRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void generateServiceIdentityExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + GenerateServiceIdentityRequest request = + GenerateServiceIdentityRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + client.generateServiceIdentity(request); + 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. + } + } + + @Test + public void listRuntimeVersionsTest() throws Exception { + RuntimeVersion responsesElement = RuntimeVersion.newBuilder().build(); + ListRuntimeVersionsResponse expectedResponse = + ListRuntimeVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllRuntimeVersions(Arrays.asList(responsesElement)) + .build(); + mockTpu.addResponse(expectedResponse); + + RuntimeVersionName parent = + RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]"); + + ListRuntimeVersionsPagedResponse pagedListResponse = client.listRuntimeVersions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRuntimeVersionsList().get(0), resources.get(0)); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListRuntimeVersionsRequest actualRequest = ((ListRuntimeVersionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listRuntimeVersionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + RuntimeVersionName parent = + RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]"); + client.listRuntimeVersions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRuntimeVersionsTest2() throws Exception { + RuntimeVersion responsesElement = RuntimeVersion.newBuilder().build(); + ListRuntimeVersionsResponse expectedResponse = + ListRuntimeVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllRuntimeVersions(Arrays.asList(responsesElement)) + .build(); + mockTpu.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListRuntimeVersionsPagedResponse pagedListResponse = client.listRuntimeVersions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRuntimeVersionsList().get(0), resources.get(0)); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListRuntimeVersionsRequest actualRequest = ((ListRuntimeVersionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listRuntimeVersionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + String parent = "parent-995424086"; + client.listRuntimeVersions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRuntimeVersionTest() throws Exception { + RuntimeVersion expectedResponse = + RuntimeVersion.newBuilder() + .setName( + RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]").toString()) + .setVersion("version351608024") + .build(); + mockTpu.addResponse(expectedResponse); + + RuntimeVersionName name = RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]"); + + RuntimeVersion actualResponse = client.getRuntimeVersion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetRuntimeVersionRequest actualRequest = ((GetRuntimeVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getRuntimeVersionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + RuntimeVersionName name = + RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]"); + client.getRuntimeVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRuntimeVersionTest2() throws Exception { + RuntimeVersion expectedResponse = + RuntimeVersion.newBuilder() + .setName( + RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]").toString()) + .setVersion("version351608024") + .build(); + mockTpu.addResponse(expectedResponse); + + String name = "name3373707"; + + RuntimeVersion actualResponse = client.getRuntimeVersion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetRuntimeVersionRequest actualRequest = ((GetRuntimeVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getRuntimeVersionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + String name = "name3373707"; + client.getRuntimeVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getGuestAttributesTest() throws Exception { + GetGuestAttributesResponse expectedResponse = + GetGuestAttributesResponse.newBuilder() + .addAllGuestAttributes(new ArrayList()) + .build(); + mockTpu.addResponse(expectedResponse); + + GetGuestAttributesRequest request = + GetGuestAttributesRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setQueryPath("queryPath-1807004403") + .addAllWorkerIds(new ArrayList()) + .build(); + + GetGuestAttributesResponse actualResponse = client.getGuestAttributes(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetGuestAttributesRequest actualRequest = ((GetGuestAttributesRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getQueryPath(), actualRequest.getQueryPath()); + Assert.assertEquals(request.getWorkerIdsList(), actualRequest.getWorkerIdsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getGuestAttributesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + GetGuestAttributesRequest request = + GetGuestAttributesRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setQueryPath("queryPath-1807004403") + .addAllWorkerIds(new ArrayList()) + .build(); + client.getGuestAttributes(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/grpc-google-cloud-tpu-v2alpha1/pom.xml b/grpc-google-cloud-tpu-v2alpha1/pom.xml new file mode 100644 index 00000000..dbe53b51 --- /dev/null +++ b/grpc-google-cloud-tpu-v2alpha1/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-tpu-v2alpha1 + 2.1.4-SNAPSHOT + grpc-google-cloud-tpu-v2alpha1 + GRPC library for google-cloud-tpu + + com.google.cloud + google-cloud-tpu-parent + 2.1.4-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-v2alpha1 + + + 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-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/TpuGrpc.java b/grpc-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/TpuGrpc.java new file mode 100644 index 00000000..b6a35a6e --- /dev/null +++ b/grpc-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/TpuGrpc.java @@ -0,0 +1,1720 @@ +/* + * 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.v2alpha1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Manages TPU nodes and other resources
+ * TPU API v2alpha1
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/tpu/v2alpha1/cloud_tpu.proto") +public final class TpuGrpc { + + private TpuGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.tpu.v2alpha1.Tpu"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.ListNodesRequest, + com.google.cloud.tpu.v2alpha1.ListNodesResponse> + getListNodesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListNodes", + requestType = com.google.cloud.tpu.v2alpha1.ListNodesRequest.class, + responseType = com.google.cloud.tpu.v2alpha1.ListNodesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.ListNodesRequest, + com.google.cloud.tpu.v2alpha1.ListNodesResponse> + getListNodesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.ListNodesRequest, + com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListNodesRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2alpha1.ListNodesResponse.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("ListNodes")) + .build(); + } + } + } + return getListNodesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.GetNodeRequest, com.google.cloud.tpu.v2alpha1.Node> + getGetNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetNode", + requestType = com.google.cloud.tpu.v2alpha1.GetNodeRequest.class, + responseType = com.google.cloud.tpu.v2alpha1.Node.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.GetNodeRequest, com.google.cloud.tpu.v2alpha1.Node> + getGetNodeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.GetNodeRequest, com.google.cloud.tpu.v2alpha1.Node> + 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.v2alpha1.GetNodeRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2alpha1.Node.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("GetNode")) + .build(); + } + } + } + return getGetNodeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.CreateNodeRequest, com.google.longrunning.Operation> + getCreateNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateNode", + requestType = com.google.cloud.tpu.v2alpha1.CreateNodeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.CreateNodeRequest, com.google.longrunning.Operation> + getCreateNodeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.DeleteNodeRequest, com.google.longrunning.Operation> + getDeleteNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteNode", + requestType = com.google.cloud.tpu.v2alpha1.DeleteNodeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.DeleteNodeRequest, com.google.longrunning.Operation> + getDeleteNodeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.StopNodeRequest, com.google.longrunning.Operation> + getStopNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StopNode", + requestType = com.google.cloud.tpu.v2alpha1.StopNodeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.StopNodeRequest, com.google.longrunning.Operation> + getStopNodeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.StartNodeRequest, com.google.longrunning.Operation> + getStartNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StartNode", + requestType = com.google.cloud.tpu.v2alpha1.StartNodeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.StartNodeRequest, com.google.longrunning.Operation> + getStartNodeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.UpdateNodeRequest, com.google.longrunning.Operation> + getUpdateNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateNode", + requestType = com.google.cloud.tpu.v2alpha1.UpdateNodeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.UpdateNodeRequest, com.google.longrunning.Operation> + getUpdateNodeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.UpdateNodeRequest, com.google.longrunning.Operation> + getUpdateNodeMethod; + if ((getUpdateNodeMethod = TpuGrpc.getUpdateNodeMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getUpdateNodeMethod = TpuGrpc.getUpdateNodeMethod) == null) { + TpuGrpc.getUpdateNodeMethod = + getUpdateNodeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateNode")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2alpha1.UpdateNodeRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("UpdateNode")) + .build(); + } + } + } + return getUpdateNodeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest, + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse> + getGenerateServiceIdentityMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GenerateServiceIdentity", + requestType = com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest.class, + responseType = com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest, + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse> + getGenerateServiceIdentityMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest, + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse> + getGenerateServiceIdentityMethod; + if ((getGenerateServiceIdentityMethod = TpuGrpc.getGenerateServiceIdentityMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getGenerateServiceIdentityMethod = TpuGrpc.getGenerateServiceIdentityMethod) == null) { + TpuGrpc.getGenerateServiceIdentityMethod = + getGenerateServiceIdentityMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GenerateServiceIdentity")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new TpuMethodDescriptorSupplier("GenerateServiceIdentity")) + .build(); + } + } + } + return getGenerateServiceIdentityMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest, + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse> + getListAcceleratorTypesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListAcceleratorTypes", + requestType = com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest.class, + responseType = com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest, + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse> + getListAcceleratorTypesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest, + com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListAcceleratorTypesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse + .getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("ListAcceleratorTypes")) + .build(); + } + } + } + return getListAcceleratorTypesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest, + com.google.cloud.tpu.v2alpha1.AcceleratorType> + getGetAcceleratorTypeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAcceleratorType", + requestType = com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest.class, + responseType = com.google.cloud.tpu.v2alpha1.AcceleratorType.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest, + com.google.cloud.tpu.v2alpha1.AcceleratorType> + getGetAcceleratorTypeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest, + com.google.cloud.tpu.v2alpha1.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.v2alpha1.GetAcceleratorTypeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2alpha1.AcceleratorType.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("GetAcceleratorType")) + .build(); + } + } + } + return getGetAcceleratorTypeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest, + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse> + getListRuntimeVersionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListRuntimeVersions", + requestType = com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest.class, + responseType = com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest, + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse> + getListRuntimeVersionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest, + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse> + getListRuntimeVersionsMethod; + if ((getListRuntimeVersionsMethod = TpuGrpc.getListRuntimeVersionsMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getListRuntimeVersionsMethod = TpuGrpc.getListRuntimeVersionsMethod) == null) { + TpuGrpc.getListRuntimeVersionsMethod = + getListRuntimeVersionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListRuntimeVersions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("ListRuntimeVersions")) + .build(); + } + } + } + return getListRuntimeVersionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest, + com.google.cloud.tpu.v2alpha1.RuntimeVersion> + getGetRuntimeVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetRuntimeVersion", + requestType = com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest.class, + responseType = com.google.cloud.tpu.v2alpha1.RuntimeVersion.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest, + com.google.cloud.tpu.v2alpha1.RuntimeVersion> + getGetRuntimeVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest, + com.google.cloud.tpu.v2alpha1.RuntimeVersion> + getGetRuntimeVersionMethod; + if ((getGetRuntimeVersionMethod = TpuGrpc.getGetRuntimeVersionMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getGetRuntimeVersionMethod = TpuGrpc.getGetRuntimeVersionMethod) == null) { + TpuGrpc.getGetRuntimeVersionMethod = + getGetRuntimeVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetRuntimeVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2alpha1.RuntimeVersion.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("GetRuntimeVersion")) + .build(); + } + } + } + return getGetRuntimeVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest, + com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse> + getGetGuestAttributesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetGuestAttributes", + requestType = com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest.class, + responseType = com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest, + com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse> + getGetGuestAttributesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest, + com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse> + getGetGuestAttributesMethod; + if ((getGetGuestAttributesMethod = TpuGrpc.getGetGuestAttributesMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getGetGuestAttributesMethod = TpuGrpc.getGetGuestAttributesMethod) == null) { + TpuGrpc.getGetGuestAttributesMethod = + getGetGuestAttributesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetGuestAttributes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse + .getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("GetGuestAttributes")) + .build(); + } + } + } + return getGetGuestAttributesMethod; + } + + /** 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 v2alpha1
+   * 
+ */ + public abstract static class TpuImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists nodes.
+     * 
+ */ + public void listNodes( + com.google.cloud.tpu.v2alpha1.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.v2alpha1.GetNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetNodeMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a node.
+     * 
+ */ + public void createNode( + com.google.cloud.tpu.v2alpha1.CreateNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateNodeMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a node.
+     * 
+ */ + public void deleteNode( + com.google.cloud.tpu.v2alpha1.DeleteNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteNodeMethod(), responseObserver); + } + + /** + * + * + *
+     * Stops a node. This operation is only available with single TPU nodes.
+     * 
+ */ + public void stopNode( + com.google.cloud.tpu.v2alpha1.StopNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStopNodeMethod(), responseObserver); + } + + /** + * + * + *
+     * Starts a node.
+     * 
+ */ + public void startNode( + com.google.cloud.tpu.v2alpha1.StartNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStartNodeMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the configurations of a node.
+     * 
+ */ + public void updateNode( + com.google.cloud.tpu.v2alpha1.UpdateNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateNodeMethod(), responseObserver); + } + + /** + * + * + *
+     * Generates the Cloud TPU service identity for the project.
+     * 
+ */ + public void generateServiceIdentity( + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGenerateServiceIdentityMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists accelerator types supported by this API.
+     * 
+ */ + public void listAcceleratorTypes( + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListAcceleratorTypesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets AcceleratorType.
+     * 
+ */ + public void getAcceleratorType( + com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetAcceleratorTypeMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists runtime versions supported by this API.
+     * 
+ */ + public void listRuntimeVersions( + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListRuntimeVersionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a runtime version.
+     * 
+ */ + public void getRuntimeVersion( + com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetRuntimeVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves the guest attributes for the node.
+     * 
+ */ + public void getGuestAttributes( + com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetGuestAttributesMethod(), 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.v2alpha1.ListNodesRequest, + com.google.cloud.tpu.v2alpha1.ListNodesResponse>(this, METHODID_LIST_NODES))) + .addMethod( + getGetNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2alpha1.GetNodeRequest, + com.google.cloud.tpu.v2alpha1.Node>(this, METHODID_GET_NODE))) + .addMethod( + getCreateNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2alpha1.CreateNodeRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_NODE))) + .addMethod( + getDeleteNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2alpha1.DeleteNodeRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_NODE))) + .addMethod( + getStopNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2alpha1.StopNodeRequest, + com.google.longrunning.Operation>(this, METHODID_STOP_NODE))) + .addMethod( + getStartNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2alpha1.StartNodeRequest, + com.google.longrunning.Operation>(this, METHODID_START_NODE))) + .addMethod( + getUpdateNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2alpha1.UpdateNodeRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_NODE))) + .addMethod( + getGenerateServiceIdentityMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest, + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse>( + this, METHODID_GENERATE_SERVICE_IDENTITY))) + .addMethod( + getListAcceleratorTypesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest, + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse>( + this, METHODID_LIST_ACCELERATOR_TYPES))) + .addMethod( + getGetAcceleratorTypeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest, + com.google.cloud.tpu.v2alpha1.AcceleratorType>( + this, METHODID_GET_ACCELERATOR_TYPE))) + .addMethod( + getListRuntimeVersionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest, + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse>( + this, METHODID_LIST_RUNTIME_VERSIONS))) + .addMethod( + getGetRuntimeVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest, + com.google.cloud.tpu.v2alpha1.RuntimeVersion>( + this, METHODID_GET_RUNTIME_VERSION))) + .addMethod( + getGetGuestAttributesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest, + com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse>( + this, METHODID_GET_GUEST_ATTRIBUTES))) + .build(); + } + } + + /** + * + * + *
+   * Manages TPU nodes and other resources
+   * TPU API v2alpha1
+   * 
+ */ + 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.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.DeleteNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteNodeMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Stops a node. This operation is only available with single TPU nodes.
+     * 
+ */ + public void stopNode( + com.google.cloud.tpu.v2alpha1.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.v2alpha1.StartNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getStartNodeMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Updates the configurations of a node.
+     * 
+ */ + public void updateNode( + com.google.cloud.tpu.v2alpha1.UpdateNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateNodeMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Generates the Cloud TPU service identity for the project.
+     * 
+ */ + public void generateServiceIdentity( + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGenerateServiceIdentityMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists accelerator types supported by this API.
+     * 
+ */ + public void listAcceleratorTypes( + com.google.cloud.tpu.v2alpha1.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.v2alpha1.GetAcceleratorTypeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetAcceleratorTypeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists runtime versions supported by this API.
+     * 
+ */ + public void listRuntimeVersions( + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListRuntimeVersionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a runtime version.
+     * 
+ */ + public void getRuntimeVersion( + com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetRuntimeVersionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves the guest attributes for the node.
+     * 
+ */ + public void getGuestAttributes( + com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetGuestAttributesMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Manages TPU nodes and other resources
+   * TPU API v2alpha1
+   * 
+ */ + 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.v2alpha1.ListNodesResponse listNodes( + com.google.cloud.tpu.v2alpha1.ListNodesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListNodesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the details of a node.
+     * 
+ */ + public com.google.cloud.tpu.v2alpha1.Node getNode( + com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.DeleteNodeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteNodeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Stops a node. This operation is only available with single TPU nodes.
+     * 
+ */ + public com.google.longrunning.Operation stopNode( + com.google.cloud.tpu.v2alpha1.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.v2alpha1.StartNodeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getStartNodeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the configurations of a node.
+     * 
+ */ + public com.google.longrunning.Operation updateNode( + com.google.cloud.tpu.v2alpha1.UpdateNodeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateNodeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Generates the Cloud TPU service identity for the project.
+     * 
+ */ + public com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse generateServiceIdentity( + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGenerateServiceIdentityMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists accelerator types supported by this API.
+     * 
+ */ + public com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse listAcceleratorTypes( + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListAcceleratorTypesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets AcceleratorType.
+     * 
+ */ + public com.google.cloud.tpu.v2alpha1.AcceleratorType getAcceleratorType( + com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetAcceleratorTypeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists runtime versions supported by this API.
+     * 
+ */ + public com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse listRuntimeVersions( + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListRuntimeVersionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a runtime version.
+     * 
+ */ + public com.google.cloud.tpu.v2alpha1.RuntimeVersion getRuntimeVersion( + com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetRuntimeVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves the guest attributes for the node.
+     * 
+ */ + public com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse getGuestAttributes( + com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetGuestAttributesMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Manages TPU nodes and other resources
+   * TPU API v2alpha1
+   * 
+ */ + 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.v2alpha1.ListNodesResponse> + listNodes(com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.DeleteNodeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteNodeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Stops a node. This operation is only available with single TPU nodes.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + stopNode(com.google.cloud.tpu.v2alpha1.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.v2alpha1.StartNodeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getStartNodeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the configurations of a node.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateNode(com.google.cloud.tpu.v2alpha1.UpdateNodeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateNodeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Generates the Cloud TPU service identity for the project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse> + generateServiceIdentity( + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGenerateServiceIdentityMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists accelerator types supported by this API.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse> + listAcceleratorTypes(com.google.cloud.tpu.v2alpha1.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.v2alpha1.AcceleratorType> + getAcceleratorType(com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetAcceleratorTypeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists runtime versions supported by this API.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse> + listRuntimeVersions(com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListRuntimeVersionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a runtime version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.tpu.v2alpha1.RuntimeVersion> + getRuntimeVersion(com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetRuntimeVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves the guest attributes for the node.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse> + getGuestAttributes(com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetGuestAttributesMethod(), 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_STOP_NODE = 4; + private static final int METHODID_START_NODE = 5; + private static final int METHODID_UPDATE_NODE = 6; + private static final int METHODID_GENERATE_SERVICE_IDENTITY = 7; + private static final int METHODID_LIST_ACCELERATOR_TYPES = 8; + private static final int METHODID_GET_ACCELERATOR_TYPE = 9; + private static final int METHODID_LIST_RUNTIME_VERSIONS = 10; + private static final int METHODID_GET_RUNTIME_VERSION = 11; + private static final int METHODID_GET_GUEST_ATTRIBUTES = 12; + + 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.v2alpha1.ListNodesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_NODE: + serviceImpl.getNode( + (com.google.cloud.tpu.v2alpha1.GetNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_NODE: + serviceImpl.createNode( + (com.google.cloud.tpu.v2alpha1.CreateNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_NODE: + serviceImpl.deleteNode( + (com.google.cloud.tpu.v2alpha1.DeleteNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_STOP_NODE: + serviceImpl.stopNode( + (com.google.cloud.tpu.v2alpha1.StopNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_START_NODE: + serviceImpl.startNode( + (com.google.cloud.tpu.v2alpha1.StartNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_NODE: + serviceImpl.updateNode( + (com.google.cloud.tpu.v2alpha1.UpdateNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GENERATE_SERVICE_IDENTITY: + serviceImpl.generateServiceIdentity( + (com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse>) + responseObserver); + break; + case METHODID_LIST_ACCELERATOR_TYPES: + serviceImpl.listAcceleratorTypes( + (com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse>) + responseObserver); + break; + case METHODID_GET_ACCELERATOR_TYPE: + serviceImpl.getAcceleratorType( + (com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_RUNTIME_VERSIONS: + serviceImpl.listRuntimeVersions( + (com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse>) + responseObserver); + break; + case METHODID_GET_RUNTIME_VERSION: + serviceImpl.getRuntimeVersion( + (com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_GUEST_ATTRIBUTES: + serviceImpl.getGuestAttributes( + (com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse>) + 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.v2alpha1.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(getStopNodeMethod()) + .addMethod(getStartNodeMethod()) + .addMethod(getUpdateNodeMethod()) + .addMethod(getGenerateServiceIdentityMethod()) + .addMethod(getListAcceleratorTypesMethod()) + .addMethod(getGetAcceleratorTypeMethod()) + .addMethod(getListRuntimeVersionsMethod()) + .addMethod(getGetRuntimeVersionMethod()) + .addMethod(getGetGuestAttributesMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/pom.xml b/pom.xml index 0a6461af..a62c60f0 100644 --- a/pom.xml +++ b/pom.xml @@ -62,6 +62,16 @@ google-cloud-tpu 2.1.4-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-tpu-v2alpha1 + 2.1.4-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-tpu-v2alpha1 + 2.1.4-SNAPSHOT + com.google.api.grpc grpc-google-cloud-tpu-v1 @@ -103,7 +113,9 @@ google-cloud-tpu grpc-google-cloud-tpu-v1 + grpc-google-cloud-tpu-v2alpha1 proto-google-cloud-tpu-v1 + proto-google-cloud-tpu-v2alpha1 google-cloud-tpu-bom diff --git a/proto-google-cloud-tpu-v2alpha1/clirr-ignored-differences.xml b/proto-google-cloud-tpu-v2alpha1/clirr-ignored-differences.xml new file mode 100644 index 00000000..d92ab4b9 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/tpu/v2alpha1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/tpu/v2alpha1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/tpu/v2alpha1/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-tpu-v2alpha1/pom.xml b/proto-google-cloud-tpu-v2alpha1/pom.xml new file mode 100644 index 00000000..ce4ebac7 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/pom.xml @@ -0,0 +1,42 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-tpu-v2alpha1 + 2.1.4-SNAPSHOT + proto-google-cloud-tpu-v2alpha1 + Proto library for google-cloud-tpu + + com.google.cloud + google-cloud-tpu-parent + 2.1.4-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api + api-common + + + com.google.guava + guava + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorType.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorType.java new file mode 100644 index 00000000..ab671b1e --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorType.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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * A accelerator type that a Node can be configured with.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.AcceleratorType} + */ +public final class AcceleratorType extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_AcceleratorType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_AcceleratorType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.AcceleratorType.class, + com.google.cloud.tpu.v2alpha1.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + 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.v2alpha1.AcceleratorType)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.AcceleratorType other = + (com.google.cloud.tpu.v2alpha1.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.v2alpha1.AcceleratorType parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.AcceleratorType parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.AcceleratorType parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.AcceleratorType parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.AcceleratorType parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.AcceleratorType} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.AcceleratorType) + com.google.cloud.tpu.v2alpha1.AcceleratorTypeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_AcceleratorType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_AcceleratorType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.AcceleratorType.class, + com.google.cloud.tpu.v2alpha1.AcceleratorType.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_AcceleratorType_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.AcceleratorType getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.AcceleratorType.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.AcceleratorType build() { + com.google.cloud.tpu.v2alpha1.AcceleratorType result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.AcceleratorType buildPartial() { + com.google.cloud.tpu.v2alpha1.AcceleratorType result = + new com.google.cloud.tpu.v2alpha1.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.v2alpha1.AcceleratorType) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.AcceleratorType) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.AcceleratorType other) { + if (other == com.google.cloud.tpu.v2alpha1.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.v2alpha1.AcceleratorType parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v2alpha1.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.v2alpha1.AcceleratorType) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.AcceleratorType) + private static final com.google.cloud.tpu.v2alpha1.AcceleratorType DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.AcceleratorType(); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.AcceleratorType getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorTypeName.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorTypeName.java new file mode 100644 index 00000000..1f3d973b --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/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.v2alpha1; + +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) { + this.project = acceleratorTypeName.project; + this.location = acceleratorTypeName.location; + this.acceleratorType = acceleratorTypeName.acceleratorType; + } + + public AcceleratorTypeName build() { + return new AcceleratorTypeName(this); + } + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorTypeOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorTypeOrBuilder.java new file mode 100644 index 00000000..eec7e478 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface AcceleratorTypeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.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-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AccessConfig.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AccessConfig.java new file mode 100644 index 00000000..4edd559d --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AccessConfig.java @@ -0,0 +1,634 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * An access config attached to the TPU worker.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.AccessConfig} + */ +public final class AccessConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.AccessConfig) + AccessConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use AccessConfig.newBuilder() to construct. + private AccessConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AccessConfig() { + externalIp_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AccessConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AccessConfig( + 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(); + + externalIp_ = 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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_AccessConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_AccessConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.AccessConfig.class, + com.google.cloud.tpu.v2alpha1.AccessConfig.Builder.class); + } + + public static final int EXTERNAL_IP_FIELD_NUMBER = 1; + private volatile java.lang.Object externalIp_; + /** + * + * + *
+   * Output only. An external IP address associated with the TPU worker.
+   * 
+ * + * string external_ip = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The externalIp. + */ + @java.lang.Override + public java.lang.String getExternalIp() { + java.lang.Object ref = externalIp_; + 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(); + externalIp_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. An external IP address associated with the TPU worker.
+   * 
+ * + * string external_ip = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for externalIp. + */ + @java.lang.Override + public com.google.protobuf.ByteString getExternalIpBytes() { + java.lang.Object ref = externalIp_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + externalIp_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(externalIp_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, externalIp_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(externalIp_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, externalIp_); + } + 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.v2alpha1.AccessConfig)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.AccessConfig other = + (com.google.cloud.tpu.v2alpha1.AccessConfig) obj; + + if (!getExternalIp().equals(other.getExternalIp())) 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) + EXTERNAL_IP_FIELD_NUMBER; + hash = (53 * hash) + getExternalIp().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.AccessConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.AccessConfig 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.v2alpha1.AccessConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.AccessConfig 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.v2alpha1.AccessConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.AccessConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v2alpha1.AccessConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.AccessConfig 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.v2alpha1.AccessConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.AccessConfig 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.v2alpha1.AccessConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.AccessConfig 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.v2alpha1.AccessConfig 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; + } + /** + * + * + *
+   * An access config attached to the TPU worker.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.AccessConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.AccessConfig) + com.google.cloud.tpu.v2alpha1.AccessConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_AccessConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_AccessConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.AccessConfig.class, + com.google.cloud.tpu.v2alpha1.AccessConfig.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.AccessConfig.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(); + externalIp_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_AccessConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.AccessConfig getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.AccessConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.AccessConfig build() { + com.google.cloud.tpu.v2alpha1.AccessConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.AccessConfig buildPartial() { + com.google.cloud.tpu.v2alpha1.AccessConfig result = + new com.google.cloud.tpu.v2alpha1.AccessConfig(this); + result.externalIp_ = externalIp_; + 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.v2alpha1.AccessConfig) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.AccessConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.AccessConfig other) { + if (other == com.google.cloud.tpu.v2alpha1.AccessConfig.getDefaultInstance()) return this; + if (!other.getExternalIp().isEmpty()) { + externalIp_ = other.externalIp_; + 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.v2alpha1.AccessConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v2alpha1.AccessConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object externalIp_ = ""; + /** + * + * + *
+     * Output only. An external IP address associated with the TPU worker.
+     * 
+ * + * string external_ip = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The externalIp. + */ + public java.lang.String getExternalIp() { + java.lang.Object ref = externalIp_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + externalIp_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. An external IP address associated with the TPU worker.
+     * 
+ * + * string external_ip = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for externalIp. + */ + public com.google.protobuf.ByteString getExternalIpBytes() { + java.lang.Object ref = externalIp_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + externalIp_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. An external IP address associated with the TPU worker.
+     * 
+ * + * string external_ip = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The externalIp to set. + * @return This builder for chaining. + */ + public Builder setExternalIp(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + externalIp_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. An external IP address associated with the TPU worker.
+     * 
+ * + * string external_ip = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearExternalIp() { + + externalIp_ = getDefaultInstance().getExternalIp(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. An external IP address associated with the TPU worker.
+     * 
+ * + * string external_ip = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for externalIp to set. + * @return This builder for chaining. + */ + public Builder setExternalIpBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + externalIp_ = 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.v2alpha1.AccessConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.AccessConfig) + private static final com.google.cloud.tpu.v2alpha1.AccessConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.AccessConfig(); + } + + public static com.google.cloud.tpu.v2alpha1.AccessConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AccessConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AccessConfig(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.v2alpha1.AccessConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AccessConfigOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AccessConfigOrBuilder.java new file mode 100644 index 00000000..3ff4351e --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AccessConfigOrBuilder.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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface AccessConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.AccessConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. An external IP address associated with the TPU worker.
+   * 
+ * + * string external_ip = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The externalIp. + */ + java.lang.String getExternalIp(); + /** + * + * + *
+   * Output only. An external IP address associated with the TPU worker.
+   * 
+ * + * string external_ip = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for externalIp. + */ + com.google.protobuf.ByteString getExternalIpBytes(); +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AttachedDisk.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AttachedDisk.java new file mode 100644 index 00000000..88499625 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AttachedDisk.java @@ -0,0 +1,974 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * A node-attached disk resource.
+ * Next ID: 8;
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.AttachedDisk} + */ +public final class AttachedDisk extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.AttachedDisk) + AttachedDiskOrBuilder { + private static final long serialVersionUID = 0L; + // Use AttachedDisk.newBuilder() to construct. + private AttachedDisk(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AttachedDisk() { + sourceDisk_ = ""; + mode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AttachedDisk(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AttachedDisk( + 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 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + sourceDisk_ = s; + break; + } + case 32: + { + int rawValue = input.readEnum(); + + mode_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_AttachedDisk_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_AttachedDisk_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.AttachedDisk.class, + com.google.cloud.tpu.v2alpha1.AttachedDisk.Builder.class); + } + + /** + * + * + *
+   * The different mode of the attached disk.
+   * 
+ * + * Protobuf enum {@code google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode} + */ + public enum DiskMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The disk mode is not known/set.
+     * 
+ * + * DISK_MODE_UNSPECIFIED = 0; + */ + DISK_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Attaches the disk in read-write mode. Only one TPU node can attach a disk
+     * in read-write mode at a time.
+     * 
+ * + * READ_WRITE = 1; + */ + READ_WRITE(1), + /** + * + * + *
+     * Attaches the disk in read-only mode. Multiple TPU nodes can attach
+     * a disk in read-only mode at a time.
+     * 
+ * + * READ_ONLY = 2; + */ + READ_ONLY(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The disk mode is not known/set.
+     * 
+ * + * DISK_MODE_UNSPECIFIED = 0; + */ + public static final int DISK_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Attaches the disk in read-write mode. Only one TPU node can attach a disk
+     * in read-write mode at a time.
+     * 
+ * + * READ_WRITE = 1; + */ + public static final int READ_WRITE_VALUE = 1; + /** + * + * + *
+     * Attaches the disk in read-only mode. Multiple TPU nodes can attach
+     * a disk in read-only mode at a time.
+     * 
+ * + * READ_ONLY = 2; + */ + public static final int READ_ONLY_VALUE = 2; + + 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 DiskMode 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 DiskMode forNumber(int value) { + switch (value) { + case 0: + return DISK_MODE_UNSPECIFIED; + case 1: + return READ_WRITE; + case 2: + return READ_ONLY; + 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 DiskMode findValueByNumber(int number) { + return DiskMode.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.v2alpha1.AttachedDisk.getDescriptor().getEnumTypes().get(0); + } + + private static final DiskMode[] VALUES = values(); + + public static DiskMode 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 DiskMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode) + } + + public static final int SOURCE_DISK_FIELD_NUMBER = 3; + private volatile java.lang.Object sourceDisk_; + /** + * + * + *
+   * Specifies the full path to an existing disk.
+   * For example: "projects/my-project/zones/us-central1-c/disks/my-disk".
+   * 
+ * + * string source_disk = 3; + * + * @return The sourceDisk. + */ + @java.lang.Override + public java.lang.String getSourceDisk() { + java.lang.Object ref = sourceDisk_; + 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(); + sourceDisk_ = s; + return s; + } + } + /** + * + * + *
+   * Specifies the full path to an existing disk.
+   * For example: "projects/my-project/zones/us-central1-c/disks/my-disk".
+   * 
+ * + * string source_disk = 3; + * + * @return The bytes for sourceDisk. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceDiskBytes() { + java.lang.Object ref = sourceDisk_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceDisk_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODE_FIELD_NUMBER = 4; + private int mode_; + /** + * + * + *
+   * The mode in which to attach this disk.
+   * If not specified, the default is READ_WRITE mode.
+   * Only applicable to data_disks.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode mode = 4; + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+   * The mode in which to attach this disk.
+   * If not specified, the default is READ_WRITE mode.
+   * Only applicable to data_disks.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode mode = 4; + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode getMode() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode result = + com.google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode.valueOf(mode_); + return result == null + ? com.google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceDisk_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, sourceDisk_); + } + if (mode_ + != com.google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode.DISK_MODE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, mode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceDisk_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, sourceDisk_); + } + if (mode_ + != com.google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode.DISK_MODE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, mode_); + } + 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.v2alpha1.AttachedDisk)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.AttachedDisk other = + (com.google.cloud.tpu.v2alpha1.AttachedDisk) obj; + + if (!getSourceDisk().equals(other.getSourceDisk())) return false; + if (mode_ != other.mode_) 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) + SOURCE_DISK_FIELD_NUMBER; + hash = (53 * hash) + getSourceDisk().hashCode(); + hash = (37 * hash) + MODE_FIELD_NUMBER; + hash = (53 * hash) + mode_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.AttachedDisk parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.AttachedDisk 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.v2alpha1.AttachedDisk parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.AttachedDisk 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.v2alpha1.AttachedDisk parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.AttachedDisk parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v2alpha1.AttachedDisk parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.AttachedDisk 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.v2alpha1.AttachedDisk parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.AttachedDisk 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.v2alpha1.AttachedDisk parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.AttachedDisk 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.v2alpha1.AttachedDisk 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 node-attached disk resource.
+   * Next ID: 8;
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.AttachedDisk} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.AttachedDisk) + com.google.cloud.tpu.v2alpha1.AttachedDiskOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_AttachedDisk_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_AttachedDisk_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.AttachedDisk.class, + com.google.cloud.tpu.v2alpha1.AttachedDisk.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.AttachedDisk.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(); + sourceDisk_ = ""; + + mode_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_AttachedDisk_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.AttachedDisk getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.AttachedDisk.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.AttachedDisk build() { + com.google.cloud.tpu.v2alpha1.AttachedDisk result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.AttachedDisk buildPartial() { + com.google.cloud.tpu.v2alpha1.AttachedDisk result = + new com.google.cloud.tpu.v2alpha1.AttachedDisk(this); + result.sourceDisk_ = sourceDisk_; + result.mode_ = mode_; + 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.v2alpha1.AttachedDisk) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.AttachedDisk) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.AttachedDisk other) { + if (other == com.google.cloud.tpu.v2alpha1.AttachedDisk.getDefaultInstance()) return this; + if (!other.getSourceDisk().isEmpty()) { + sourceDisk_ = other.sourceDisk_; + onChanged(); + } + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); + } + 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.v2alpha1.AttachedDisk parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v2alpha1.AttachedDisk) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object sourceDisk_ = ""; + /** + * + * + *
+     * Specifies the full path to an existing disk.
+     * For example: "projects/my-project/zones/us-central1-c/disks/my-disk".
+     * 
+ * + * string source_disk = 3; + * + * @return The sourceDisk. + */ + public java.lang.String getSourceDisk() { + java.lang.Object ref = sourceDisk_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceDisk_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Specifies the full path to an existing disk.
+     * For example: "projects/my-project/zones/us-central1-c/disks/my-disk".
+     * 
+ * + * string source_disk = 3; + * + * @return The bytes for sourceDisk. + */ + public com.google.protobuf.ByteString getSourceDiskBytes() { + java.lang.Object ref = sourceDisk_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceDisk_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Specifies the full path to an existing disk.
+     * For example: "projects/my-project/zones/us-central1-c/disks/my-disk".
+     * 
+ * + * string source_disk = 3; + * + * @param value The sourceDisk to set. + * @return This builder for chaining. + */ + public Builder setSourceDisk(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sourceDisk_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the full path to an existing disk.
+     * For example: "projects/my-project/zones/us-central1-c/disks/my-disk".
+     * 
+ * + * string source_disk = 3; + * + * @return This builder for chaining. + */ + public Builder clearSourceDisk() { + + sourceDisk_ = getDefaultInstance().getSourceDisk(); + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the full path to an existing disk.
+     * For example: "projects/my-project/zones/us-central1-c/disks/my-disk".
+     * 
+ * + * string source_disk = 3; + * + * @param value The bytes for sourceDisk to set. + * @return This builder for chaining. + */ + public Builder setSourceDiskBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sourceDisk_ = value; + onChanged(); + return this; + } + + private int mode_ = 0; + /** + * + * + *
+     * The mode in which to attach this disk.
+     * If not specified, the default is READ_WRITE mode.
+     * Only applicable to data_disks.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode mode = 4; + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+     * The mode in which to attach this disk.
+     * If not specified, the default is READ_WRITE mode.
+     * Only applicable to data_disks.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode mode = 4; + * + * @param value The enum numeric value on the wire for mode to set. + * @return This builder for chaining. + */ + public Builder setModeValue(int value) { + + mode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The mode in which to attach this disk.
+     * If not specified, the default is READ_WRITE mode.
+     * Only applicable to data_disks.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode mode = 4; + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode getMode() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode result = + com.google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode.valueOf(mode_); + return result == null + ? com.google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The mode in which to attach this disk.
+     * If not specified, the default is READ_WRITE mode.
+     * Only applicable to data_disks.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode mode = 4; + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode(com.google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode value) { + if (value == null) { + throw new NullPointerException(); + } + + mode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The mode in which to attach this disk.
+     * If not specified, the default is READ_WRITE mode.
+     * Only applicable to data_disks.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode mode = 4; + * + * @return This builder for chaining. + */ + public Builder clearMode() { + + mode_ = 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.v2alpha1.AttachedDisk) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.AttachedDisk) + private static final com.google.cloud.tpu.v2alpha1.AttachedDisk DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.AttachedDisk(); + } + + public static com.google.cloud.tpu.v2alpha1.AttachedDisk getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AttachedDisk parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AttachedDisk(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.v2alpha1.AttachedDisk getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AttachedDiskOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AttachedDiskOrBuilder.java new file mode 100644 index 00000000..b7aebddd --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AttachedDiskOrBuilder.java @@ -0,0 +1,81 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface AttachedDiskOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.AttachedDisk) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Specifies the full path to an existing disk.
+   * For example: "projects/my-project/zones/us-central1-c/disks/my-disk".
+   * 
+ * + * string source_disk = 3; + * + * @return The sourceDisk. + */ + java.lang.String getSourceDisk(); + /** + * + * + *
+   * Specifies the full path to an existing disk.
+   * For example: "projects/my-project/zones/us-central1-c/disks/my-disk".
+   * 
+ * + * string source_disk = 3; + * + * @return The bytes for sourceDisk. + */ + com.google.protobuf.ByteString getSourceDiskBytes(); + + /** + * + * + *
+   * The mode in which to attach this disk.
+   * If not specified, the default is READ_WRITE mode.
+   * Only applicable to data_disks.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode mode = 4; + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + /** + * + * + *
+   * The mode in which to attach this disk.
+   * If not specified, the default is READ_WRITE mode.
+   * Only applicable to data_disks.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode mode = 4; + * + * @return The mode. + */ + com.google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode getMode(); +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CloudTpuProto.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CloudTpuProto.java new file mode 100644 index 00000000..5a61eb6e --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CloudTpuProto.java @@ -0,0 +1,724 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +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_v2alpha1_GuestAttributes_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_GuestAttributes_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_GuestAttributesValue_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_GuestAttributesValue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_GuestAttributesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_GuestAttributesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_AttachedDisk_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_AttachedDisk_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_SchedulingConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_SchedulingConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_NetworkEndpoint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_NetworkEndpoint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_AccessConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_AccessConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_NetworkConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_NetworkConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_ServiceAccount_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_ServiceAccount_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_Node_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_Node_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_Node_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_Node_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_Node_MetadataEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_Node_MetadataEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_ListNodesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_ListNodesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_ListNodesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_ListNodesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_GetNodeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_GetNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_CreateNodeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_CreateNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_DeleteNodeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_DeleteNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_StopNodeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_StopNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_StartNodeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_StartNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_UpdateNodeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_UpdateNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_ServiceIdentity_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_ServiceIdentity_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_GenerateServiceIdentityRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_GenerateServiceIdentityRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_GenerateServiceIdentityResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_GenerateServiceIdentityResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_AcceleratorType_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_AcceleratorType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_GetAcceleratorTypeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_GetAcceleratorTypeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_ListAcceleratorTypesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_ListAcceleratorTypesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_ListAcceleratorTypesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_ListAcceleratorTypesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_OperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_RuntimeVersion_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_RuntimeVersion_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_GetRuntimeVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_GetRuntimeVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_ListRuntimeVersionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_ListRuntimeVersionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_ListRuntimeVersionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_ListRuntimeVersionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_Symptom_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_Symptom_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_GetGuestAttributesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_GetGuestAttributesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_GetGuestAttributesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_GetGuestAttributesResponse_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/v2alpha1/cloud_tpu.pr" + + "oto\022\031google.cloud.tpu.v2alpha1\032\034google/a" + + "pi/annotations.proto\032\027google/api/client." + + "proto\032\037google/api/field_behavior.proto\032\031" + + "google/api/resource.proto\032#google/longru" + + "nning/operations.proto\032 google/protobuf/" + + "field_mask.proto\032\037google/protobuf/timest" + + "amp.proto\"k\n\017GuestAttributes\022\022\n\nquery_pa" + + "th\030\001 \001(\t\022D\n\013query_value\030\002 \001(\0132/.google.c" + + "loud.tpu.v2alpha1.GuestAttributesValue\"V" + + "\n\024GuestAttributesValue\022>\n\005items\030\001 \003(\0132/." + + "google.cloud.tpu.v2alpha1.GuestAttribute" + + "sEntry\"E\n\024GuestAttributesEntry\022\021\n\tnamesp" + + "ace\030\001 \001(\t\022\013\n\003key\030\002 \001(\t\022\r\n\005value\030\003 \001(\t\"\251\001" + + "\n\014AttachedDisk\022\023\n\013source_disk\030\003 \001(\t\022>\n\004m" + + "ode\030\004 \001(\01620.google.cloud.tpu.v2alpha1.At" + + "tachedDisk.DiskMode\"D\n\010DiskMode\022\031\n\025DISK_" + + "MODE_UNSPECIFIED\020\000\022\016\n\nREAD_WRITE\020\001\022\r\n\tRE" + + "AD_ONLY\020\002\"9\n\020SchedulingConfig\022\023\n\013preempt" + + "ible\030\001 \001(\010\022\020\n\010reserved\030\002 \001(\010\"s\n\017NetworkE" + + "ndpoint\022\022\n\nip_address\030\001 \001(\t\022\014\n\004port\030\002 \001(" + + "\005\022>\n\raccess_config\030\005 \001(\0132\'.google.cloud." + + "tpu.v2alpha1.AccessConfig\"(\n\014AccessConfi" + + "g\022\030\n\013external_ip\030\001 \001(\tB\003\340A\003\"Q\n\rNetworkCo" + + "nfig\022\017\n\007network\030\001 \001(\t\022\022\n\nsubnetwork\030\002 \001(" + + "\t\022\033\n\023enable_external_ips\030\003 \001(\010\".\n\016Servic" + + "eAccount\022\r\n\005email\030\001 \001(\t\022\r\n\005scope\030\002 \003(\t\"\233" + + "\014\n\004Node\022\024\n\004name\030\001 \001(\tB\006\340A\003\340A\005\022\023\n\013descrip" + + "tion\030\003 \001(\t\022\035\n\020accelerator_type\030\005 \001(\tB\003\340A" + + "\002\0229\n\005state\030\t \001(\0162%.google.cloud.tpu.v2al" + + "pha1.Node.StateB\003\340A\003\022\037\n\022health_descripti" + + "on\030\n \001(\tB\003\340A\003\022\034\n\017runtime_version\030\013 \001(\tB\003" + + "\340A\002\022@\n\016network_config\030$ \001(\0132(.google.clo" + + "ud.tpu.v2alpha1.NetworkConfig\022\022\n\ncidr_bl" + + "ock\030\r \001(\t\022B\n\017service_account\030% \001(\0132).goo" + + "gle.cloud.tpu.v2alpha1.ServiceAccount\0224\n" + + "\013create_time\030\020 \001(\0132\032.google.protobuf.Tim" + + "estampB\003\340A\003\022F\n\021scheduling_config\030\021 \001(\0132+" + + ".google.cloud.tpu.v2alpha1.SchedulingCon" + + "fig\022J\n\021network_endpoints\030\025 \003(\0132*.google." + + "cloud.tpu.v2alpha1.NetworkEndpointB\003\340A\003\022" + + "6\n\006health\030\026 \001(\0162&.google.cloud.tpu.v2alp" + + "ha1.Node.Health\022;\n\006labels\030\030 \003(\0132+.google" + + ".cloud.tpu.v2alpha1.Node.LabelsEntry\022?\n\010" + + "metadata\030\" \003(\0132-.google.cloud.tpu.v2alph" + + "a1.Node.MetadataEntry\022\014\n\004tags\030( \003(\t\022\017\n\002i" + + "d\030! \001(\003B\003\340A\003\022;\n\ndata_disks\030) \003(\0132\'.googl" + + "e.cloud.tpu.v2alpha1.AttachedDisk\022D\n\013api" + + "_version\030& \001(\0162*.google.cloud.tpu.v2alph" + + "a1.Node.ApiVersionB\003\340A\003\0229\n\010symptoms\030\' \003(" + + "\0132\".google.cloud.tpu.v2alpha1.SymptomB\003\340" + + "A\003\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030" + + "\002 \001(\t:\0028\001\032/\n\rMetadataEntry\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_UN" + + "SPECIFIED\020\000\022\014\n\010CREATING\020\001\022\t\n\005READY\020\002\022\016\n\n" + + "RESTARTING\020\003\022\r\n\tREIMAGING\020\004\022\014\n\010DELETING\020" + + "\005\022\r\n\tREPAIRING\020\006\022\013\n\007STOPPED\020\010\022\014\n\010STOPPIN" + + "G\020\t\022\014\n\010STARTING\020\n\022\r\n\tPREEMPTED\020\013\022\016\n\nTERM" + + "INATED\020\014\022\n\n\006HIDING\020\r\022\n\n\006HIDDEN\020\016\022\014\n\010UNHI" + + "DING\020\017\"o\n\006Health\022\026\n\022HEALTH_UNSPECIFIED\020\000" + + "\022\013\n\007HEALTHY\020\001\022\013\n\007TIMEOUT\020\003\022\030\n\024UNHEALTHY_" + + "TENSORFLOW\020\004\022\031\n\025UNHEALTHY_MAINTENANCE\020\005\"" + + "O\n\nApiVersion\022\033\n\027API_VERSION_UNSPECIFIED" + + "\020\000\022\r\n\tV1_ALPHA1\020\001\022\006\n\002V1\020\002\022\r\n\tV2_ALPHA1\020\003" + + ":R\352AO\n\027tpu.googleapis.com/Node\0224projects" + + "/{project}/locations/{location}/nodes/{n" + + "ode}\"j\n\020ListNodesRequest\022/\n\006parent\030\001 \001(\t" + + "B\037\340A\002\372A\031\n\027tpu.googleapis.com/Node\022\021\n\tpag" + + "e_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"q\n\021List" + + "NodesResponse\022.\n\005nodes\030\001 \003(\0132\037.google.cl" + + "oud.tpu.v2alpha1.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\"\223\001\n\021CreateNodeRequest\0229\n\006pa" + + "rent\030\001 \001(\tB)\340A\002\372A#\n!locations.googleapis" + + ".com/Location\022\017\n\007node_id\030\002 \001(\t\0222\n\004node\030\003" + + " \001(\0132\037.google.cloud.tpu.v2alpha1.NodeB\003\340" + + "A\002\"B\n\021DeleteNodeRequest\022-\n\004name\030\001 \001(\tB\037\340" + + "A\002\372A\031\n\027tpu.googleapis.com/Node\"\037\n\017StopNo" + + "deRequest\022\014\n\004name\030\001 \001(\t\" \n\020StartNodeRequ" + + "est\022\014\n\004name\030\001 \001(\t\"}\n\021UpdateNodeRequest\0224" + + "\n\013update_mask\030\001 \001(\0132\032.google.protobuf.Fi" + + "eldMaskB\003\340A\002\0222\n\004node\030\002 \001(\0132\037.google.clou" + + "d.tpu.v2alpha1.NodeB\003\340A\002\" \n\017ServiceIdent" + + "ity\022\r\n\005email\030\001 \001(\t\"[\n\036GenerateServiceIde" + + "ntityRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!lo" + + "cations.googleapis.com/Location\"_\n\037Gener" + + "ateServiceIdentityResponse\022<\n\010identity\030\001" + + " \001(\0132*.google.cloud.tpu.v2alpha1.Service" + + "Identity\"\243\001\n\017AcceleratorType\022\014\n\004name\030\001 \001" + + "(\t\022\014\n\004type\030\002 \001(\t:t\352Aq\n\"tpu.googleapis.co" + + "m/AcceleratorType\022Kprojects/{project}/lo" + + "cations/{location}/acceleratorTypes/{acc" + + "elerator_type}\"U\n\031GetAcceleratorTypeRequ" + + "est\0228\n\004name\030\001 \001(\tB*\340A\002\372A$\n\"tpu.googleapi" + + "s.com/AcceleratorType\"\242\001\n\033ListAccelerato" + + "rTypesRequest\022:\n\006parent\030\001 \001(\tB*\340A\002\372A$\n\"t" + + "pu.googleapis.com/AcceleratorType\022\021\n\tpag" + + "e_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n\006filt" + + "er\030\005 \001(\t\022\020\n\010order_by\030\006 \001(\t\"\223\001\n\034ListAccel" + + "eratorTypesResponse\022E\n\021accelerator_types" + + "\030\001 \003(\0132*.google.cloud.tpu.v2alpha1.Accel" + + "eratorType\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013u" + + "nreachable\030\003 \003(\t\"\326\001\n\021OperationMetadata\022/" + + "\n\013create_time\030\001 \001(\0132\032.google.protobuf.Ti" + + "mestamp\022,\n\010end_time\030\002 \001(\0132\032.google.proto" + + "buf.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_req" + + "uested\030\006 \001(\010\022\023\n\013api_version\030\007 \001(\t\"\242\001\n\016Ru" + + "ntimeVersion\022\014\n\004name\030\001 \001(\t\022\017\n\007version\030\002 " + + "\001(\t:q\352An\n!tpu.googleapis.com/RuntimeVers" + + "ion\022Iprojects/{project}/locations/{locat" + + "ion}/runtimeVersions/{runtime_version}\"S" + + "\n\030GetRuntimeVersionRequest\0227\n\004name\030\001 \001(\t" + + "B)\340A\002\372A#\n!tpu.googleapis.com/RuntimeVers" + + "ion\"\240\001\n\032ListRuntimeVersionsRequest\0229\n\006pa" + + "rent\030\001 \001(\tB)\340A\002\372A#\n!tpu.googleapis.com/R" + + "untimeVersion\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\"\220\001\n\033ListRuntimeVersionsResponse\022C" + + "\n\020runtime_versions\030\001 \003(\0132).google.cloud." + + "tpu.v2alpha1.RuntimeVersion\022\027\n\017next_page" + + "_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"\313\002\n\007Sy" + + "mptom\022/\n\013create_time\030\001 \001(\0132\032.google.prot" + + "obuf.Timestamp\022D\n\014symptom_type\030\002 \001(\0162..g" + + "oogle.cloud.tpu.v2alpha1.Symptom.Symptom" + + "Type\022\017\n\007details\030\003 \001(\t\022\021\n\tworker_id\030\004 \001(\t" + + "\"\244\001\n\013SymptomType\022\034\n\030SYMPTOM_TYPE_UNSPECI" + + "FIED\020\000\022\016\n\nLOW_MEMORY\020\001\022\021\n\rOUT_OF_MEMORY\020" + + "\002\022\025\n\021EXECUTE_TIMED_OUT\020\003\022\023\n\017MESH_BUILD_F" + + "AIL\020\004\022\025\n\021HBM_OUT_OF_MEMORY\020\005\022\021\n\rPROJECT_" + + "ABUSE\020\006\"r\n\031GetGuestAttributesRequest\022-\n\004" + + "name\030\001 \001(\tB\037\340A\002\372A\031\n\027tpu.googleapis.com/N" + + "ode\022\022\n\nquery_path\030\002 \001(\t\022\022\n\nworker_ids\030\003 " + + "\003(\t\"b\n\032GetGuestAttributesResponse\022D\n\020gue" + + "st_attributes\030\001 \003(\0132*.google.cloud.tpu.v" + + "2alpha1.GuestAttributes2\263\024\n\003Tpu\022\250\001\n\tList" + + "Nodes\022+.google.cloud.tpu.v2alpha1.ListNo" + + "desRequest\032,.google.cloud.tpu.v2alpha1.L" + + "istNodesResponse\"@\202\323\344\223\0021\022//v2alpha1/{par" + + "ent=projects/*/locations/*}/nodes\332A\006pare" + + "nt\022\225\001\n\007GetNode\022).google.cloud.tpu.v2alph" + + "a1.GetNodeRequest\032\037.google.cloud.tpu.v2a" + + "lpha1.Node\">\202\323\344\223\0021\022//v2alpha1/{name=proj" + + "ects/*/locations/*/nodes/*}\332A\004name\022\312\001\n\nC" + + "reateNode\022,.google.cloud.tpu.v2alpha1.Cr" + + "eateNodeRequest\032\035.google.longrunning.Ope" + + "ration\"o\202\323\344\223\0027\"//v2alpha1/{parent=projec" + + "ts/*/locations/*}/nodes:\004node\332A\023parent,n" + + "ode,node_id\312A\031\n\004Node\022\021OperationMetadata\022" + + "\265\001\n\nDeleteNode\022,.google.cloud.tpu.v2alph" + + "a1.DeleteNodeRequest\032\035.google.longrunnin" + + "g.Operation\"Z\202\323\344\223\0021*//v2alpha1/{name=pro" + + "jects/*/locations/*/nodes/*}\332A\004name\312A\031\n\004" + + "Node\022\021OperationMetadata\022\262\001\n\010StopNode\022*.g" + + "oogle.cloud.tpu.v2alpha1.StopNodeRequest" + + "\032\035.google.longrunning.Operation\"[\202\323\344\223\0029\"" + + "4/v2alpha1/{name=projects/*/locations/*/" + + "nodes/*}:stop:\001*\312A\031\n\004Node\022\021OperationMeta" + + "data\022\265\001\n\tStartNode\022+.google.cloud.tpu.v2" + + "alpha1.StartNodeRequest\032\035.google.longrun" + + "ning.Operation\"\\\202\323\344\223\002:\"5/v2alpha1/{name=" + + "projects/*/locations/*/nodes/*}:start:\001*" + + "\312A\031\n\004Node\022\021OperationMetadata\022\314\001\n\nUpdateN" + + "ode\022,.google.cloud.tpu.v2alpha1.UpdateNo" + + "deRequest\032\035.google.longrunning.Operation" + + "\"q\202\323\344\223\002<24/v2alpha1/{node.name=projects/" + + "*/locations/*/nodes/*}:\004node\332A\020node,upda" + + "te_mask\312A\031\n\004Node\022\021OperationMetadata\022\336\001\n\027" + + "GenerateServiceIdentity\0229.google.cloud.t" + + "pu.v2alpha1.GenerateServiceIdentityReque" + + "st\032:.google.cloud.tpu.v2alpha1.GenerateS" + + "erviceIdentityResponse\"L\202\323\344\223\002F\"A/v2alpha" + + "1/{parent=projects/*/locations/*}:genera" + + "teServiceIdentity:\001*\022\324\001\n\024ListAccelerator" + + "Types\0226.google.cloud.tpu.v2alpha1.ListAc" + + "celeratorTypesRequest\0327.google.cloud.tpu" + + ".v2alpha1.ListAcceleratorTypesResponse\"K" + + "\202\323\344\223\002<\022:/v2alpha1/{parent=projects/*/loc" + + "ations/*}/acceleratorTypes\332A\006parent\022\301\001\n\022" + + "GetAcceleratorType\0224.google.cloud.tpu.v2" + + "alpha1.GetAcceleratorTypeRequest\032*.googl" + + "e.cloud.tpu.v2alpha1.AcceleratorType\"I\202\323" + + "\344\223\002<\022:/v2alpha1/{name=projects/*/locatio" + + "ns/*/acceleratorTypes/*}\332A\004name\022\320\001\n\023List" + + "RuntimeVersions\0225.google.cloud.tpu.v2alp" + + "ha1.ListRuntimeVersionsRequest\0326.google." + + "cloud.tpu.v2alpha1.ListRuntimeVersionsRe" + + "sponse\"J\202\323\344\223\002;\0229/v2alpha1/{parent=projec" + + "ts/*/locations/*}/runtimeVersions\332A\006pare" + + "nt\022\275\001\n\021GetRuntimeVersion\0223.google.cloud." + + "tpu.v2alpha1.GetRuntimeVersionRequest\032)." + + "google.cloud.tpu.v2alpha1.RuntimeVersion" + + "\"H\202\323\344\223\002;\0229/v2alpha1/{name=projects/*/loc" + + "ations/*/runtimeVersions/*}\332A\004name\022\320\001\n\022G" + + "etGuestAttributes\0224.google.cloud.tpu.v2a" + + "lpha1.GetGuestAttributesRequest\0325.google" + + ".cloud.tpu.v2alpha1.GetGuestAttributesRe" + + "sponse\"M\202\323\344\223\002G\"B/v2alpha1/{name=projects" + + "/*/locations/*/nodes/*}:getGuestAttribut" + + "es:\001*\032F\312A\022tpu.googleapis.com\322A.https://w" + + "ww.googleapis.com/auth/cloud-platformBn\n" + + "\035com.google.cloud.tpu.v2alpha1B\rCloudTpu" + + "ProtoP\001Z + * Request for [CreateNode][google.cloud.tpu.v2alpha1.Tpu.CreateNode]. + * + * + * Protobuf type {@code google.cloud.tpu.v2alpha1.CreateNodeRequest} + */ +public final class CreateNodeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.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.v2alpha1.Node.Builder subBuilder = null; + if (node_ != null) { + subBuilder = node_.toBuilder(); + } + node_ = + input.readMessage(com.google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_CreateNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_CreateNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.CreateNodeRequest.class, + com.google.cloud.tpu.v2alpha1.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.v2alpha1.Node node_; + /** + * + * + *
+   * Required. The node.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.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.v2alpha1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The node. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.Node getNode() { + return node_ == null ? com.google.cloud.tpu.v2alpha1.Node.getDefaultInstance() : node_; + } + /** + * + * + *
+   * Required. The node.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nodeId_)) { + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nodeId_)) { + 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.v2alpha1.CreateNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.CreateNodeRequest other = + (com.google.cloud.tpu.v2alpha1.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.v2alpha1.CreateNodeRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.CreateNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.CreateNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.CreateNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.CreateNodeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.Tpu.CreateNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.CreateNodeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.CreateNodeRequest) + com.google.cloud.tpu.v2alpha1.CreateNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_CreateNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_CreateNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.CreateNodeRequest.class, + com.google.cloud.tpu.v2alpha1.CreateNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_CreateNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.CreateNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.CreateNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.CreateNodeRequest build() { + com.google.cloud.tpu.v2alpha1.CreateNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.CreateNodeRequest buildPartial() { + com.google.cloud.tpu.v2alpha1.CreateNodeRequest result = + new com.google.cloud.tpu.v2alpha1.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.v2alpha1.CreateNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.CreateNodeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.CreateNodeRequest other) { + if (other == com.google.cloud.tpu.v2alpha1.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.v2alpha1.CreateNodeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v2alpha1.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.v2alpha1.Node node_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.Node, + com.google.cloud.tpu.v2alpha1.Node.Builder, + com.google.cloud.tpu.v2alpha1.NodeOrBuilder> + nodeBuilder_; + /** + * + * + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.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.v2alpha1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The node. + */ + public com.google.cloud.tpu.v2alpha1.Node getNode() { + if (nodeBuilder_ == null) { + return node_ == null ? com.google.cloud.tpu.v2alpha1.Node.getDefaultInstance() : node_; + } else { + return nodeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNode(com.google.cloud.tpu.v2alpha1.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.v2alpha1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNode(com.google.cloud.tpu.v2alpha1.Node.Builder builderForValue) { + if (nodeBuilder_ == null) { + node_ = builderForValue.build(); + onChanged(); + } else { + nodeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeNode(com.google.cloud.tpu.v2alpha1.Node value) { + if (nodeBuilder_ == null) { + if (node_ != null) { + node_ = + com.google.cloud.tpu.v2alpha1.Node.newBuilder(node_).mergeFrom(value).buildPartial(); + } else { + node_ = value; + } + onChanged(); + } else { + nodeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.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.v2alpha1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.tpu.v2alpha1.Node.Builder getNodeBuilder() { + + onChanged(); + return getNodeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.tpu.v2alpha1.NodeOrBuilder getNodeOrBuilder() { + if (nodeBuilder_ != null) { + return nodeBuilder_.getMessageOrBuilder(); + } else { + return node_ == null ? com.google.cloud.tpu.v2alpha1.Node.getDefaultInstance() : node_; + } + } + /** + * + * + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.Node, + com.google.cloud.tpu.v2alpha1.Node.Builder, + com.google.cloud.tpu.v2alpha1.NodeOrBuilder> + getNodeFieldBuilder() { + if (nodeBuilder_ == null) { + nodeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.Node, + com.google.cloud.tpu.v2alpha1.Node.Builder, + com.google.cloud.tpu.v2alpha1.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.v2alpha1.CreateNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.CreateNodeRequest) + private static final com.google.cloud.tpu.v2alpha1.CreateNodeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.CreateNodeRequest(); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.CreateNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CreateNodeRequestOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CreateNodeRequestOrBuilder.java new file mode 100644 index 00000000..bdca5a4d --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CreateNodeRequestOrBuilder.java @@ -0,0 +1,117 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface CreateNodeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.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.v2alpha1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the node field is set. + */ + boolean hasNode(); + /** + * + * + *
+   * Required. The node.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The node. + */ + com.google.cloud.tpu.v2alpha1.Node getNode(); + /** + * + * + *
+   * Required. The node.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.tpu.v2alpha1.NodeOrBuilder getNodeOrBuilder(); +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteNodeRequest.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteNodeRequest.java new file mode 100644 index 00000000..89bd3105 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteNodeRequest.java @@ -0,0 +1,649 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Request for [DeleteNode][google.cloud.tpu.v2alpha1.Tpu.DeleteNode].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.DeleteNodeRequest} + */ +public final class DeleteNodeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_DeleteNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_DeleteNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.DeleteNodeRequest.class, + com.google.cloud.tpu.v2alpha1.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.tpu.v2alpha1.DeleteNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.DeleteNodeRequest other = + (com.google.cloud.tpu.v2alpha1.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.v2alpha1.DeleteNodeRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.DeleteNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.DeleteNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.DeleteNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.DeleteNodeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.Tpu.DeleteNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.DeleteNodeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.DeleteNodeRequest) + com.google.cloud.tpu.v2alpha1.DeleteNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_DeleteNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_DeleteNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.DeleteNodeRequest.class, + com.google.cloud.tpu.v2alpha1.DeleteNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_DeleteNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.DeleteNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.DeleteNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.DeleteNodeRequest build() { + com.google.cloud.tpu.v2alpha1.DeleteNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.DeleteNodeRequest buildPartial() { + com.google.cloud.tpu.v2alpha1.DeleteNodeRequest result = + new com.google.cloud.tpu.v2alpha1.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.v2alpha1.DeleteNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.DeleteNodeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.DeleteNodeRequest other) { + if (other == com.google.cloud.tpu.v2alpha1.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.v2alpha1.DeleteNodeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v2alpha1.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.v2alpha1.DeleteNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.DeleteNodeRequest) + private static final com.google.cloud.tpu.v2alpha1.DeleteNodeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.DeleteNodeRequest(); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.DeleteNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteNodeRequestOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteNodeRequestOrBuilder.java new file mode 100644 index 00000000..b725b223 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface DeleteNodeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.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-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityRequest.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityRequest.java new file mode 100644 index 00000000..24a426b3 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityRequest.java @@ -0,0 +1,657 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Request for
+ * [GenerateServiceIdentity][google.cloud.tpu.v2alpha1.Tpu.GenerateServiceIdentity].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest} + */ +public final class GenerateServiceIdentityRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest) + GenerateServiceIdentityRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateServiceIdentityRequest.newBuilder() to construct. + private GenerateServiceIdentityRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateServiceIdentityRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateServiceIdentityRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GenerateServiceIdentityRequest( + 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; + } + 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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GenerateServiceIdentityRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GenerateServiceIdentityRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest.class, + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest.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; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + 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.v2alpha1.GenerateServiceIdentityRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest other = + (com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest) obj; + + if (!getParent().equals(other.getParent())) 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest 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.v2alpha1.GenerateServiceIdentityRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest 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.v2alpha1.GenerateServiceIdentityRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest 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.v2alpha1.GenerateServiceIdentityRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest 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.v2alpha1.GenerateServiceIdentityRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest 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.v2alpha1.GenerateServiceIdentityRequest 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
+   * [GenerateServiceIdentity][google.cloud.tpu.v2alpha1.Tpu.GenerateServiceIdentity].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest) + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GenerateServiceIdentityRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GenerateServiceIdentityRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest.class, + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest.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_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GenerateServiceIdentityRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest + getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest build() { + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest buildPartial() { + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest result = + new com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest(this); + result.parent_ = parent_; + 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.v2alpha1.GenerateServiceIdentityRequest) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest other) { + if (other + == com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + 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.v2alpha1.GenerateServiceIdentityRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest) 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; + } + + @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.v2alpha1.GenerateServiceIdentityRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest) + private static final com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest(); + } + + public static com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateServiceIdentityRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GenerateServiceIdentityRequest(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.v2alpha1.GenerateServiceIdentityRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityRequestOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityRequestOrBuilder.java new file mode 100644 index 00000000..04247706 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityRequestOrBuilder.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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface GenerateServiceIdentityRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest) + 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(); +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityResponse.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityResponse.java new file mode 100644 index 00000000..3d7f2248 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityResponse.java @@ -0,0 +1,742 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Response for
+ * [GenerateServiceIdentity][google.cloud.tpu.v2alpha1.Tpu.GenerateServiceIdentity].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse} + */ +public final class GenerateServiceIdentityResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse) + GenerateServiceIdentityResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateServiceIdentityResponse.newBuilder() to construct. + private GenerateServiceIdentityResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateServiceIdentityResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateServiceIdentityResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GenerateServiceIdentityResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.tpu.v2alpha1.ServiceIdentity.Builder subBuilder = null; + if (identity_ != null) { + subBuilder = identity_.toBuilder(); + } + identity_ = + input.readMessage( + com.google.cloud.tpu.v2alpha1.ServiceIdentity.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(identity_); + identity_ = 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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GenerateServiceIdentityResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GenerateServiceIdentityResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse.class, + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse.Builder.class); + } + + public static final int IDENTITY_FIELD_NUMBER = 1; + private com.google.cloud.tpu.v2alpha1.ServiceIdentity identity_; + /** + * + * + *
+   * ServiceIdentity that was created or retrieved.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceIdentity identity = 1; + * + * @return Whether the identity field is set. + */ + @java.lang.Override + public boolean hasIdentity() { + return identity_ != null; + } + /** + * + * + *
+   * ServiceIdentity that was created or retrieved.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceIdentity identity = 1; + * + * @return The identity. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ServiceIdentity getIdentity() { + return identity_ == null + ? com.google.cloud.tpu.v2alpha1.ServiceIdentity.getDefaultInstance() + : identity_; + } + /** + * + * + *
+   * ServiceIdentity that was created or retrieved.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceIdentity identity = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ServiceIdentityOrBuilder getIdentityOrBuilder() { + return getIdentity(); + } + + 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 (identity_ != null) { + output.writeMessage(1, getIdentity()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (identity_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getIdentity()); + } + 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.v2alpha1.GenerateServiceIdentityResponse)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse other = + (com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse) obj; + + if (hasIdentity() != other.hasIdentity()) return false; + if (hasIdentity()) { + if (!getIdentity().equals(other.getIdentity())) 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 (hasIdentity()) { + hash = (37 * hash) + IDENTITY_FIELD_NUMBER; + hash = (53 * hash) + getIdentity().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse 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.v2alpha1.GenerateServiceIdentityResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse 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.v2alpha1.GenerateServiceIdentityResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse 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.v2alpha1.GenerateServiceIdentityResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse 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.v2alpha1.GenerateServiceIdentityResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse 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.v2alpha1.GenerateServiceIdentityResponse 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
+   * [GenerateServiceIdentity][google.cloud.tpu.v2alpha1.Tpu.GenerateServiceIdentity].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse) + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GenerateServiceIdentityResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GenerateServiceIdentityResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse.class, + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse.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 (identityBuilder_ == null) { + identity_ = null; + } else { + identity_ = null; + identityBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GenerateServiceIdentityResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse + getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse build() { + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse buildPartial() { + com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse result = + new com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse(this); + if (identityBuilder_ == null) { + result.identity_ = identity_; + } else { + result.identity_ = identityBuilder_.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.v2alpha1.GenerateServiceIdentityResponse) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse other) { + if (other + == com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse.getDefaultInstance()) + return this; + if (other.hasIdentity()) { + mergeIdentity(other.getIdentity()); + } + 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.v2alpha1.GenerateServiceIdentityResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.tpu.v2alpha1.ServiceIdentity identity_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.ServiceIdentity, + com.google.cloud.tpu.v2alpha1.ServiceIdentity.Builder, + com.google.cloud.tpu.v2alpha1.ServiceIdentityOrBuilder> + identityBuilder_; + /** + * + * + *
+     * ServiceIdentity that was created or retrieved.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceIdentity identity = 1; + * + * @return Whether the identity field is set. + */ + public boolean hasIdentity() { + return identityBuilder_ != null || identity_ != null; + } + /** + * + * + *
+     * ServiceIdentity that was created or retrieved.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceIdentity identity = 1; + * + * @return The identity. + */ + public com.google.cloud.tpu.v2alpha1.ServiceIdentity getIdentity() { + if (identityBuilder_ == null) { + return identity_ == null + ? com.google.cloud.tpu.v2alpha1.ServiceIdentity.getDefaultInstance() + : identity_; + } else { + return identityBuilder_.getMessage(); + } + } + /** + * + * + *
+     * ServiceIdentity that was created or retrieved.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceIdentity identity = 1; + */ + public Builder setIdentity(com.google.cloud.tpu.v2alpha1.ServiceIdentity value) { + if (identityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + identity_ = value; + onChanged(); + } else { + identityBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * ServiceIdentity that was created or retrieved.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceIdentity identity = 1; + */ + public Builder setIdentity( + com.google.cloud.tpu.v2alpha1.ServiceIdentity.Builder builderForValue) { + if (identityBuilder_ == null) { + identity_ = builderForValue.build(); + onChanged(); + } else { + identityBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * ServiceIdentity that was created or retrieved.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceIdentity identity = 1; + */ + public Builder mergeIdentity(com.google.cloud.tpu.v2alpha1.ServiceIdentity value) { + if (identityBuilder_ == null) { + if (identity_ != null) { + identity_ = + com.google.cloud.tpu.v2alpha1.ServiceIdentity.newBuilder(identity_) + .mergeFrom(value) + .buildPartial(); + } else { + identity_ = value; + } + onChanged(); + } else { + identityBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * ServiceIdentity that was created or retrieved.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceIdentity identity = 1; + */ + public Builder clearIdentity() { + if (identityBuilder_ == null) { + identity_ = null; + onChanged(); + } else { + identity_ = null; + identityBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * ServiceIdentity that was created or retrieved.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceIdentity identity = 1; + */ + public com.google.cloud.tpu.v2alpha1.ServiceIdentity.Builder getIdentityBuilder() { + + onChanged(); + return getIdentityFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * ServiceIdentity that was created or retrieved.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceIdentity identity = 1; + */ + public com.google.cloud.tpu.v2alpha1.ServiceIdentityOrBuilder getIdentityOrBuilder() { + if (identityBuilder_ != null) { + return identityBuilder_.getMessageOrBuilder(); + } else { + return identity_ == null + ? com.google.cloud.tpu.v2alpha1.ServiceIdentity.getDefaultInstance() + : identity_; + } + } + /** + * + * + *
+     * ServiceIdentity that was created or retrieved.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceIdentity identity = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.ServiceIdentity, + com.google.cloud.tpu.v2alpha1.ServiceIdentity.Builder, + com.google.cloud.tpu.v2alpha1.ServiceIdentityOrBuilder> + getIdentityFieldBuilder() { + if (identityBuilder_ == null) { + identityBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.ServiceIdentity, + com.google.cloud.tpu.v2alpha1.ServiceIdentity.Builder, + com.google.cloud.tpu.v2alpha1.ServiceIdentityOrBuilder>( + getIdentity(), getParentForChildren(), isClean()); + identity_ = null; + } + return identityBuilder_; + } + + @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.v2alpha1.GenerateServiceIdentityResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse) + private static final com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse(); + } + + public static com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateServiceIdentityResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GenerateServiceIdentityResponse(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.v2alpha1.GenerateServiceIdentityResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityResponseOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityResponseOrBuilder.java new file mode 100644 index 00000000..f6187e11 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityResponseOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface GenerateServiceIdentityResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * ServiceIdentity that was created or retrieved.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceIdentity identity = 1; + * + * @return Whether the identity field is set. + */ + boolean hasIdentity(); + /** + * + * + *
+   * ServiceIdentity that was created or retrieved.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceIdentity identity = 1; + * + * @return The identity. + */ + com.google.cloud.tpu.v2alpha1.ServiceIdentity getIdentity(); + /** + * + * + *
+   * ServiceIdentity that was created or retrieved.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceIdentity identity = 1; + */ + com.google.cloud.tpu.v2alpha1.ServiceIdentityOrBuilder getIdentityOrBuilder(); +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetAcceleratorTypeRequest.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetAcceleratorTypeRequest.java new file mode 100644 index 00000000..a91443d0 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetAcceleratorTypeRequest.java @@ -0,0 +1,653 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Request for
+ * [GetAcceleratorType][google.cloud.tpu.v2alpha1.Tpu.GetAcceleratorType].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest} + */ +public final class GetAcceleratorTypeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetAcceleratorTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetAcceleratorTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest.class, + com.google.cloud.tpu.v2alpha1.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest other = + (com.google.cloud.tpu.v2alpha1.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.v2alpha1.GetAcceleratorTypeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.GetAcceleratorTypeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.GetAcceleratorTypeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.GetAcceleratorTypeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.GetAcceleratorTypeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.Tpu.GetAcceleratorType].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest) + com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetAcceleratorTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetAcceleratorTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest.class, + com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetAcceleratorTypeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest build() { + com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest buildPartial() { + com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest result = + new com.google.cloud.tpu.v2alpha1.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.v2alpha1.GetAcceleratorTypeRequest) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest other) { + if (other == com.google.cloud.tpu.v2alpha1.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.v2alpha1.GetAcceleratorTypeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.tpu.v2alpha1.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.v2alpha1.GetAcceleratorTypeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest) + private static final com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest(); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.GetAcceleratorTypeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetAcceleratorTypeRequestOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetAcceleratorTypeRequestOrBuilder.java new file mode 100644 index 00000000..67b07376 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface GetAcceleratorTypeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.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-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesRequest.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesRequest.java new file mode 100644 index 00000000..026c862f --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesRequest.java @@ -0,0 +1,1125 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Request for
+ * [GetGuestAttributes][google.cloud.tpu.v2alpha1.Tpu.GetGuestAttributes].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.GetGuestAttributesRequest} + */ +public final class GetGuestAttributesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.GetGuestAttributesRequest) + GetGuestAttributesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetGuestAttributesRequest.newBuilder() to construct. + private GetGuestAttributesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetGuestAttributesRequest() { + name_ = ""; + queryPath_ = ""; + workerIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetGuestAttributesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetGuestAttributesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + queryPath_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + workerIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + workerIds_.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)) { + workerIds_ = workerIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetGuestAttributesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetGuestAttributesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest.class, + com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest.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; + } + } + + public static final int QUERY_PATH_FIELD_NUMBER = 2; + private volatile java.lang.Object queryPath_; + /** + * + * + *
+   * The guest attributes path to be queried.
+   * 
+ * + * string query_path = 2; + * + * @return The queryPath. + */ + @java.lang.Override + public java.lang.String getQueryPath() { + java.lang.Object ref = queryPath_; + 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(); + queryPath_ = s; + return s; + } + } + /** + * + * + *
+   * The guest attributes path to be queried.
+   * 
+ * + * string query_path = 2; + * + * @return The bytes for queryPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryPathBytes() { + java.lang.Object ref = queryPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + queryPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WORKER_IDS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList workerIds_; + /** + * + * + *
+   * The 0-based worker ID. If it is empty, all workers' GuestAttributes will be
+   * returned.
+   * 
+ * + * repeated string worker_ids = 3; + * + * @return A list containing the workerIds. + */ + public com.google.protobuf.ProtocolStringList getWorkerIdsList() { + return workerIds_; + } + /** + * + * + *
+   * The 0-based worker ID. If it is empty, all workers' GuestAttributes will be
+   * returned.
+   * 
+ * + * repeated string worker_ids = 3; + * + * @return The count of workerIds. + */ + public int getWorkerIdsCount() { + return workerIds_.size(); + } + /** + * + * + *
+   * The 0-based worker ID. If it is empty, all workers' GuestAttributes will be
+   * returned.
+   * 
+ * + * repeated string worker_ids = 3; + * + * @param index The index of the element to return. + * @return The workerIds at the given index. + */ + public java.lang.String getWorkerIds(int index) { + return workerIds_.get(index); + } + /** + * + * + *
+   * The 0-based worker ID. If it is empty, all workers' GuestAttributes will be
+   * returned.
+   * 
+ * + * repeated string worker_ids = 3; + * + * @param index The index of the value to return. + * @return The bytes of the workerIds at the given index. + */ + public com.google.protobuf.ByteString getWorkerIdsBytes(int index) { + return workerIds_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(queryPath_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, queryPath_); + } + for (int i = 0; i < workerIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, workerIds_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(queryPath_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, queryPath_); + } + { + int dataSize = 0; + for (int i = 0; i < workerIds_.size(); i++) { + dataSize += computeStringSizeNoTag(workerIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getWorkerIdsList().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.v2alpha1.GetGuestAttributesRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest other = + (com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getQueryPath().equals(other.getQueryPath())) return false; + if (!getWorkerIdsList().equals(other.getWorkerIdsList())) 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) + QUERY_PATH_FIELD_NUMBER; + hash = (53 * hash) + getQueryPath().hashCode(); + if (getWorkerIdsCount() > 0) { + hash = (37 * hash) + WORKER_IDS_FIELD_NUMBER; + hash = (53 * hash) + getWorkerIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest 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.v2alpha1.GetGuestAttributesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest 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.v2alpha1.GetGuestAttributesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest 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.v2alpha1.GetGuestAttributesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest 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.v2alpha1.GetGuestAttributesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest 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.v2alpha1.GetGuestAttributesRequest 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
+   * [GetGuestAttributes][google.cloud.tpu.v2alpha1.Tpu.GetGuestAttributes].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.GetGuestAttributesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.GetGuestAttributesRequest) + com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetGuestAttributesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetGuestAttributesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest.class, + com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest.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_ = ""; + + queryPath_ = ""; + + workerIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetGuestAttributesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest build() { + com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest buildPartial() { + com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest result = + new com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.queryPath_ = queryPath_; + if (((bitField0_ & 0x00000001) != 0)) { + workerIds_ = workerIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.workerIds_ = workerIds_; + 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.v2alpha1.GetGuestAttributesRequest) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest other) { + if (other == com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getQueryPath().isEmpty()) { + queryPath_ = other.queryPath_; + onChanged(); + } + if (!other.workerIds_.isEmpty()) { + if (workerIds_.isEmpty()) { + workerIds_ = other.workerIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWorkerIdsIsMutable(); + workerIds_.addAll(other.workerIds_); + } + 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.v2alpha1.GetGuestAttributesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + 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; + } + + private java.lang.Object queryPath_ = ""; + /** + * + * + *
+     * The guest attributes path to be queried.
+     * 
+ * + * string query_path = 2; + * + * @return The queryPath. + */ + public java.lang.String getQueryPath() { + java.lang.Object ref = queryPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + queryPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The guest attributes path to be queried.
+     * 
+ * + * string query_path = 2; + * + * @return The bytes for queryPath. + */ + public com.google.protobuf.ByteString getQueryPathBytes() { + java.lang.Object ref = queryPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + queryPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The guest attributes path to be queried.
+     * 
+ * + * string query_path = 2; + * + * @param value The queryPath to set. + * @return This builder for chaining. + */ + public Builder setQueryPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + queryPath_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The guest attributes path to be queried.
+     * 
+ * + * string query_path = 2; + * + * @return This builder for chaining. + */ + public Builder clearQueryPath() { + + queryPath_ = getDefaultInstance().getQueryPath(); + onChanged(); + return this; + } + /** + * + * + *
+     * The guest attributes path to be queried.
+     * 
+ * + * string query_path = 2; + * + * @param value The bytes for queryPath to set. + * @return This builder for chaining. + */ + public Builder setQueryPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + queryPath_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList workerIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureWorkerIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + workerIds_ = new com.google.protobuf.LazyStringArrayList(workerIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The 0-based worker ID. If it is empty, all workers' GuestAttributes will be
+     * returned.
+     * 
+ * + * repeated string worker_ids = 3; + * + * @return A list containing the workerIds. + */ + public com.google.protobuf.ProtocolStringList getWorkerIdsList() { + return workerIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * The 0-based worker ID. If it is empty, all workers' GuestAttributes will be
+     * returned.
+     * 
+ * + * repeated string worker_ids = 3; + * + * @return The count of workerIds. + */ + public int getWorkerIdsCount() { + return workerIds_.size(); + } + /** + * + * + *
+     * The 0-based worker ID. If it is empty, all workers' GuestAttributes will be
+     * returned.
+     * 
+ * + * repeated string worker_ids = 3; + * + * @param index The index of the element to return. + * @return The workerIds at the given index. + */ + public java.lang.String getWorkerIds(int index) { + return workerIds_.get(index); + } + /** + * + * + *
+     * The 0-based worker ID. If it is empty, all workers' GuestAttributes will be
+     * returned.
+     * 
+ * + * repeated string worker_ids = 3; + * + * @param index The index of the value to return. + * @return The bytes of the workerIds at the given index. + */ + public com.google.protobuf.ByteString getWorkerIdsBytes(int index) { + return workerIds_.getByteString(index); + } + /** + * + * + *
+     * The 0-based worker ID. If it is empty, all workers' GuestAttributes will be
+     * returned.
+     * 
+ * + * repeated string worker_ids = 3; + * + * @param index The index to set the value at. + * @param value The workerIds to set. + * @return This builder for chaining. + */ + public Builder setWorkerIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkerIdsIsMutable(); + workerIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The 0-based worker ID. If it is empty, all workers' GuestAttributes will be
+     * returned.
+     * 
+ * + * repeated string worker_ids = 3; + * + * @param value The workerIds to add. + * @return This builder for chaining. + */ + public Builder addWorkerIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkerIdsIsMutable(); + workerIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The 0-based worker ID. If it is empty, all workers' GuestAttributes will be
+     * returned.
+     * 
+ * + * repeated string worker_ids = 3; + * + * @param values The workerIds to add. + * @return This builder for chaining. + */ + public Builder addAllWorkerIds(java.lang.Iterable values) { + ensureWorkerIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, workerIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * The 0-based worker ID. If it is empty, all workers' GuestAttributes will be
+     * returned.
+     * 
+ * + * repeated string worker_ids = 3; + * + * @return This builder for chaining. + */ + public Builder clearWorkerIds() { + workerIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The 0-based worker ID. If it is empty, all workers' GuestAttributes will be
+     * returned.
+     * 
+ * + * repeated string worker_ids = 3; + * + * @param value The bytes of the workerIds to add. + * @return This builder for chaining. + */ + public Builder addWorkerIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureWorkerIdsIsMutable(); + workerIds_.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.v2alpha1.GetGuestAttributesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.GetGuestAttributesRequest) + private static final com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest(); + } + + public static com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetGuestAttributesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetGuestAttributesRequest(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.v2alpha1.GetGuestAttributesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesRequestOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesRequestOrBuilder.java new file mode 100644 index 00000000..27f8fc2a --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesRequestOrBuilder.java @@ -0,0 +1,134 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface GetGuestAttributesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.GetGuestAttributesRequest) + 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(); + + /** + * + * + *
+   * The guest attributes path to be queried.
+   * 
+ * + * string query_path = 2; + * + * @return The queryPath. + */ + java.lang.String getQueryPath(); + /** + * + * + *
+   * The guest attributes path to be queried.
+   * 
+ * + * string query_path = 2; + * + * @return The bytes for queryPath. + */ + com.google.protobuf.ByteString getQueryPathBytes(); + + /** + * + * + *
+   * The 0-based worker ID. If it is empty, all workers' GuestAttributes will be
+   * returned.
+   * 
+ * + * repeated string worker_ids = 3; + * + * @return A list containing the workerIds. + */ + java.util.List getWorkerIdsList(); + /** + * + * + *
+   * The 0-based worker ID. If it is empty, all workers' GuestAttributes will be
+   * returned.
+   * 
+ * + * repeated string worker_ids = 3; + * + * @return The count of workerIds. + */ + int getWorkerIdsCount(); + /** + * + * + *
+   * The 0-based worker ID. If it is empty, all workers' GuestAttributes will be
+   * returned.
+   * 
+ * + * repeated string worker_ids = 3; + * + * @param index The index of the element to return. + * @return The workerIds at the given index. + */ + java.lang.String getWorkerIds(int index); + /** + * + * + *
+   * The 0-based worker ID. If it is empty, all workers' GuestAttributes will be
+   * returned.
+   * 
+ * + * repeated string worker_ids = 3; + * + * @param index The index of the value to return. + * @return The bytes of the workerIds at the given index. + */ + com.google.protobuf.ByteString getWorkerIdsBytes(int index); +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesResponse.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesResponse.java new file mode 100644 index 00000000..5c6bff53 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesResponse.java @@ -0,0 +1,965 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Response for
+ * [GetGuestAttributes][google.cloud.tpu.v2alpha1.Tpu.GetGuestAttributes].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.GetGuestAttributesResponse} + */ +public final class GetGuestAttributesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.GetGuestAttributesResponse) + GetGuestAttributesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetGuestAttributesResponse.newBuilder() to construct. + private GetGuestAttributesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetGuestAttributesResponse() { + guestAttributes_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetGuestAttributesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetGuestAttributesResponse( + 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)) { + guestAttributes_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + guestAttributes_.add( + input.readMessage( + com.google.cloud.tpu.v2alpha1.GuestAttributes.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)) { + guestAttributes_ = java.util.Collections.unmodifiableList(guestAttributes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetGuestAttributesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetGuestAttributesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse.class, + com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse.Builder.class); + } + + public static final int GUEST_ATTRIBUTES_FIELD_NUMBER = 1; + private java.util.List guestAttributes_; + /** + * + * + *
+   * The guest attributes for the TPU workers.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + @java.lang.Override + public java.util.List getGuestAttributesList() { + return guestAttributes_; + } + /** + * + * + *
+   * The guest attributes for the TPU workers.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + @java.lang.Override + public java.util.List + getGuestAttributesOrBuilderList() { + return guestAttributes_; + } + /** + * + * + *
+   * The guest attributes for the TPU workers.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + @java.lang.Override + public int getGuestAttributesCount() { + return guestAttributes_.size(); + } + /** + * + * + *
+   * The guest attributes for the TPU workers.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GuestAttributes getGuestAttributes(int index) { + return guestAttributes_.get(index); + } + /** + * + * + *
+   * The guest attributes for the TPU workers.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GuestAttributesOrBuilder getGuestAttributesOrBuilder( + int index) { + return guestAttributes_.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 { + for (int i = 0; i < guestAttributes_.size(); i++) { + output.writeMessage(1, guestAttributes_.get(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 < guestAttributes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, guestAttributes_.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.v2alpha1.GetGuestAttributesResponse)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse other = + (com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse) obj; + + if (!getGuestAttributesList().equals(other.getGuestAttributesList())) 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 (getGuestAttributesCount() > 0) { + hash = (37 * hash) + GUEST_ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + getGuestAttributesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse 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.v2alpha1.GetGuestAttributesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse 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.v2alpha1.GetGuestAttributesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse 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.v2alpha1.GetGuestAttributesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse 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.v2alpha1.GetGuestAttributesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse 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.v2alpha1.GetGuestAttributesResponse 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
+   * [GetGuestAttributes][google.cloud.tpu.v2alpha1.Tpu.GetGuestAttributes].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.GetGuestAttributesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.GetGuestAttributesResponse) + com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetGuestAttributesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetGuestAttributesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse.class, + com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getGuestAttributesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (guestAttributesBuilder_ == null) { + guestAttributes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + guestAttributesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetGuestAttributesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse build() { + com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse buildPartial() { + com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse result = + new com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse(this); + int from_bitField0_ = bitField0_; + if (guestAttributesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + guestAttributes_ = java.util.Collections.unmodifiableList(guestAttributes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.guestAttributes_ = guestAttributes_; + } else { + result.guestAttributes_ = guestAttributesBuilder_.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.v2alpha1.GetGuestAttributesResponse) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse other) { + if (other == com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse.getDefaultInstance()) + return this; + if (guestAttributesBuilder_ == null) { + if (!other.guestAttributes_.isEmpty()) { + if (guestAttributes_.isEmpty()) { + guestAttributes_ = other.guestAttributes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureGuestAttributesIsMutable(); + guestAttributes_.addAll(other.guestAttributes_); + } + onChanged(); + } + } else { + if (!other.guestAttributes_.isEmpty()) { + if (guestAttributesBuilder_.isEmpty()) { + guestAttributesBuilder_.dispose(); + guestAttributesBuilder_ = null; + guestAttributes_ = other.guestAttributes_; + bitField0_ = (bitField0_ & ~0x00000001); + guestAttributesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getGuestAttributesFieldBuilder() + : null; + } else { + guestAttributesBuilder_.addAllMessages(other.guestAttributes_); + } + } + } + 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.v2alpha1.GetGuestAttributesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List guestAttributes_ = + java.util.Collections.emptyList(); + + private void ensureGuestAttributesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + guestAttributes_ = + new java.util.ArrayList( + guestAttributes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.GuestAttributes, + com.google.cloud.tpu.v2alpha1.GuestAttributes.Builder, + com.google.cloud.tpu.v2alpha1.GuestAttributesOrBuilder> + guestAttributesBuilder_; + + /** + * + * + *
+     * The guest attributes for the TPU workers.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + public java.util.List getGuestAttributesList() { + if (guestAttributesBuilder_ == null) { + return java.util.Collections.unmodifiableList(guestAttributes_); + } else { + return guestAttributesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The guest attributes for the TPU workers.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + public int getGuestAttributesCount() { + if (guestAttributesBuilder_ == null) { + return guestAttributes_.size(); + } else { + return guestAttributesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The guest attributes for the TPU workers.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + public com.google.cloud.tpu.v2alpha1.GuestAttributes getGuestAttributes(int index) { + if (guestAttributesBuilder_ == null) { + return guestAttributes_.get(index); + } else { + return guestAttributesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The guest attributes for the TPU workers.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + public Builder setGuestAttributes( + int index, com.google.cloud.tpu.v2alpha1.GuestAttributes value) { + if (guestAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGuestAttributesIsMutable(); + guestAttributes_.set(index, value); + onChanged(); + } else { + guestAttributesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The guest attributes for the TPU workers.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + public Builder setGuestAttributes( + int index, com.google.cloud.tpu.v2alpha1.GuestAttributes.Builder builderForValue) { + if (guestAttributesBuilder_ == null) { + ensureGuestAttributesIsMutable(); + guestAttributes_.set(index, builderForValue.build()); + onChanged(); + } else { + guestAttributesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The guest attributes for the TPU workers.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + public Builder addGuestAttributes(com.google.cloud.tpu.v2alpha1.GuestAttributes value) { + if (guestAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGuestAttributesIsMutable(); + guestAttributes_.add(value); + onChanged(); + } else { + guestAttributesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The guest attributes for the TPU workers.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + public Builder addGuestAttributes( + int index, com.google.cloud.tpu.v2alpha1.GuestAttributes value) { + if (guestAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGuestAttributesIsMutable(); + guestAttributes_.add(index, value); + onChanged(); + } else { + guestAttributesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The guest attributes for the TPU workers.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + public Builder addGuestAttributes( + com.google.cloud.tpu.v2alpha1.GuestAttributes.Builder builderForValue) { + if (guestAttributesBuilder_ == null) { + ensureGuestAttributesIsMutable(); + guestAttributes_.add(builderForValue.build()); + onChanged(); + } else { + guestAttributesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The guest attributes for the TPU workers.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + public Builder addGuestAttributes( + int index, com.google.cloud.tpu.v2alpha1.GuestAttributes.Builder builderForValue) { + if (guestAttributesBuilder_ == null) { + ensureGuestAttributesIsMutable(); + guestAttributes_.add(index, builderForValue.build()); + onChanged(); + } else { + guestAttributesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The guest attributes for the TPU workers.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + public Builder addAllGuestAttributes( + java.lang.Iterable values) { + if (guestAttributesBuilder_ == null) { + ensureGuestAttributesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, guestAttributes_); + onChanged(); + } else { + guestAttributesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The guest attributes for the TPU workers.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + public Builder clearGuestAttributes() { + if (guestAttributesBuilder_ == null) { + guestAttributes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + guestAttributesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The guest attributes for the TPU workers.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + public Builder removeGuestAttributes(int index) { + if (guestAttributesBuilder_ == null) { + ensureGuestAttributesIsMutable(); + guestAttributes_.remove(index); + onChanged(); + } else { + guestAttributesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The guest attributes for the TPU workers.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + public com.google.cloud.tpu.v2alpha1.GuestAttributes.Builder getGuestAttributesBuilder( + int index) { + return getGuestAttributesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The guest attributes for the TPU workers.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + public com.google.cloud.tpu.v2alpha1.GuestAttributesOrBuilder getGuestAttributesOrBuilder( + int index) { + if (guestAttributesBuilder_ == null) { + return guestAttributes_.get(index); + } else { + return guestAttributesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The guest attributes for the TPU workers.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + public java.util.List + getGuestAttributesOrBuilderList() { + if (guestAttributesBuilder_ != null) { + return guestAttributesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(guestAttributes_); + } + } + /** + * + * + *
+     * The guest attributes for the TPU workers.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + public com.google.cloud.tpu.v2alpha1.GuestAttributes.Builder addGuestAttributesBuilder() { + return getGuestAttributesFieldBuilder() + .addBuilder(com.google.cloud.tpu.v2alpha1.GuestAttributes.getDefaultInstance()); + } + /** + * + * + *
+     * The guest attributes for the TPU workers.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + public com.google.cloud.tpu.v2alpha1.GuestAttributes.Builder addGuestAttributesBuilder( + int index) { + return getGuestAttributesFieldBuilder() + .addBuilder(index, com.google.cloud.tpu.v2alpha1.GuestAttributes.getDefaultInstance()); + } + /** + * + * + *
+     * The guest attributes for the TPU workers.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + public java.util.List + getGuestAttributesBuilderList() { + return getGuestAttributesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.GuestAttributes, + com.google.cloud.tpu.v2alpha1.GuestAttributes.Builder, + com.google.cloud.tpu.v2alpha1.GuestAttributesOrBuilder> + getGuestAttributesFieldBuilder() { + if (guestAttributesBuilder_ == null) { + guestAttributesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.GuestAttributes, + com.google.cloud.tpu.v2alpha1.GuestAttributes.Builder, + com.google.cloud.tpu.v2alpha1.GuestAttributesOrBuilder>( + guestAttributes_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + guestAttributes_ = null; + } + return guestAttributesBuilder_; + } + + @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.v2alpha1.GetGuestAttributesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.GetGuestAttributesResponse) + private static final com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse(); + } + + public static com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetGuestAttributesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetGuestAttributesResponse(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.v2alpha1.GetGuestAttributesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesResponseOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesResponseOrBuilder.java new file mode 100644 index 00000000..cdfa7425 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesResponseOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface GetGuestAttributesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.GetGuestAttributesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The guest attributes for the TPU workers.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + java.util.List getGuestAttributesList(); + /** + * + * + *
+   * The guest attributes for the TPU workers.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + com.google.cloud.tpu.v2alpha1.GuestAttributes getGuestAttributes(int index); + /** + * + * + *
+   * The guest attributes for the TPU workers.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + int getGuestAttributesCount(); + /** + * + * + *
+   * The guest attributes for the TPU workers.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + java.util.List + getGuestAttributesOrBuilderList(); + /** + * + * + *
+   * The guest attributes for the TPU workers.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributes guest_attributes = 1; + */ + com.google.cloud.tpu.v2alpha1.GuestAttributesOrBuilder getGuestAttributesOrBuilder(int index); +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetNodeRequest.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetNodeRequest.java new file mode 100644 index 00000000..5b70bbb4 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetNodeRequest.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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Request for [GetNode][google.cloud.tpu.v2alpha1.Tpu.GetNode].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.GetNodeRequest} + */ +public final class GetNodeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.GetNodeRequest.class, + com.google.cloud.tpu.v2alpha1.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.tpu.v2alpha1.GetNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.GetNodeRequest other = + (com.google.cloud.tpu.v2alpha1.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.v2alpha1.GetNodeRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.GetNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.GetNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.GetNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.GetNodeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.Tpu.GetNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.GetNodeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.GetNodeRequest) + com.google.cloud.tpu.v2alpha1.GetNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.GetNodeRequest.class, + com.google.cloud.tpu.v2alpha1.GetNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GetNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.GetNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GetNodeRequest build() { + com.google.cloud.tpu.v2alpha1.GetNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GetNodeRequest buildPartial() { + com.google.cloud.tpu.v2alpha1.GetNodeRequest result = + new com.google.cloud.tpu.v2alpha1.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.v2alpha1.GetNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.GetNodeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.GetNodeRequest other) { + if (other == com.google.cloud.tpu.v2alpha1.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.v2alpha1.GetNodeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v2alpha1.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.v2alpha1.GetNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.GetNodeRequest) + private static final com.google.cloud.tpu.v2alpha1.GetNodeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.GetNodeRequest(); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.GetNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetNodeRequestOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetNodeRequestOrBuilder.java new file mode 100644 index 00000000..736eca1d --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface GetNodeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.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-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetRuntimeVersionRequest.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetRuntimeVersionRequest.java new file mode 100644 index 00000000..9776987a --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetRuntimeVersionRequest.java @@ -0,0 +1,653 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Request for
+ * [GetRuntimeVersion][google.cloud.tpu.v2alpha1.Tpu.GetRuntimeVersion].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest} + */ +public final class GetRuntimeVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest) + GetRuntimeVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetRuntimeVersionRequest.newBuilder() to construct. + private GetRuntimeVersionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetRuntimeVersionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetRuntimeVersionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetRuntimeVersionRequest( + 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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetRuntimeVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetRuntimeVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest.class, + com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest other = + (com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest) 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.v2alpha1.GetRuntimeVersionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest 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.v2alpha1.GetRuntimeVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest 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.v2alpha1.GetRuntimeVersionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest 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.v2alpha1.GetRuntimeVersionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest 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.v2alpha1.GetRuntimeVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest 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.v2alpha1.GetRuntimeVersionRequest 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
+   * [GetRuntimeVersion][google.cloud.tpu.v2alpha1.Tpu.GetRuntimeVersion].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest) + com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetRuntimeVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetRuntimeVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest.class, + com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetRuntimeVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest build() { + com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest buildPartial() { + com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest result = + new com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest(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.v2alpha1.GetRuntimeVersionRequest) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest other) { + if (other == com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest.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.v2alpha1.GetRuntimeVersionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest) 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.v2alpha1.GetRuntimeVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest) + private static final com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest(); + } + + public static com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetRuntimeVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetRuntimeVersionRequest(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.v2alpha1.GetRuntimeVersionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetRuntimeVersionRequestOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetRuntimeVersionRequestOrBuilder.java new file mode 100644 index 00000000..4a05c691 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetRuntimeVersionRequestOrBuilder.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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface GetRuntimeVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest) + 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-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributes.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributes.java new file mode 100644 index 00000000..a693aeae --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributes.java @@ -0,0 +1,927 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * A guest attributes.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.GuestAttributes} + */ +public final class GuestAttributes extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.GuestAttributes) + GuestAttributesOrBuilder { + private static final long serialVersionUID = 0L; + // Use GuestAttributes.newBuilder() to construct. + private GuestAttributes(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GuestAttributes() { + queryPath_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GuestAttributes(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GuestAttributes( + 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(); + + queryPath_ = s; + break; + } + case 18: + { + com.google.cloud.tpu.v2alpha1.GuestAttributesValue.Builder subBuilder = null; + if (queryValue_ != null) { + subBuilder = queryValue_.toBuilder(); + } + queryValue_ = + input.readMessage( + com.google.cloud.tpu.v2alpha1.GuestAttributesValue.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(queryValue_); + queryValue_ = 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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GuestAttributes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GuestAttributes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.GuestAttributes.class, + com.google.cloud.tpu.v2alpha1.GuestAttributes.Builder.class); + } + + public static final int QUERY_PATH_FIELD_NUMBER = 1; + private volatile java.lang.Object queryPath_; + /** + * + * + *
+   * The path to be queried. This can be the default namespace ('/') or a
+   * nested namespace ('/\<namespace\>/') or a specified key
+   * ('/\<namespace\>/\<key\>')
+   * 
+ * + * string query_path = 1; + * + * @return The queryPath. + */ + @java.lang.Override + public java.lang.String getQueryPath() { + java.lang.Object ref = queryPath_; + 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(); + queryPath_ = s; + return s; + } + } + /** + * + * + *
+   * The path to be queried. This can be the default namespace ('/') or a
+   * nested namespace ('/\<namespace\>/') or a specified key
+   * ('/\<namespace\>/\<key\>')
+   * 
+ * + * string query_path = 1; + * + * @return The bytes for queryPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryPathBytes() { + java.lang.Object ref = queryPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + queryPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_VALUE_FIELD_NUMBER = 2; + private com.google.cloud.tpu.v2alpha1.GuestAttributesValue queryValue_; + /** + * + * + *
+   * The value of the requested queried path.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.GuestAttributesValue query_value = 2; + * + * @return Whether the queryValue field is set. + */ + @java.lang.Override + public boolean hasQueryValue() { + return queryValue_ != null; + } + /** + * + * + *
+   * The value of the requested queried path.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.GuestAttributesValue query_value = 2; + * + * @return The queryValue. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GuestAttributesValue getQueryValue() { + return queryValue_ == null + ? com.google.cloud.tpu.v2alpha1.GuestAttributesValue.getDefaultInstance() + : queryValue_; + } + /** + * + * + *
+   * The value of the requested queried path.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.GuestAttributesValue query_value = 2; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GuestAttributesValueOrBuilder getQueryValueOrBuilder() { + return getQueryValue(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(queryPath_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, queryPath_); + } + if (queryValue_ != null) { + output.writeMessage(2, getQueryValue()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(queryPath_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, queryPath_); + } + if (queryValue_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getQueryValue()); + } + 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.v2alpha1.GuestAttributes)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.GuestAttributes other = + (com.google.cloud.tpu.v2alpha1.GuestAttributes) obj; + + if (!getQueryPath().equals(other.getQueryPath())) return false; + if (hasQueryValue() != other.hasQueryValue()) return false; + if (hasQueryValue()) { + if (!getQueryValue().equals(other.getQueryValue())) 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) + QUERY_PATH_FIELD_NUMBER; + hash = (53 * hash) + getQueryPath().hashCode(); + if (hasQueryValue()) { + hash = (37 * hash) + QUERY_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getQueryValue().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributes parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributes 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.v2alpha1.GuestAttributes parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributes 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.v2alpha1.GuestAttributes parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributes parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributes parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributes 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.v2alpha1.GuestAttributes parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributes 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.v2alpha1.GuestAttributes parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributes 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.v2alpha1.GuestAttributes 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 guest attributes.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.GuestAttributes} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.GuestAttributes) + com.google.cloud.tpu.v2alpha1.GuestAttributesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GuestAttributes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GuestAttributes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.GuestAttributes.class, + com.google.cloud.tpu.v2alpha1.GuestAttributes.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.GuestAttributes.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(); + queryPath_ = ""; + + if (queryValueBuilder_ == null) { + queryValue_ = null; + } else { + queryValue_ = null; + queryValueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GuestAttributes_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GuestAttributes getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.GuestAttributes.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GuestAttributes build() { + com.google.cloud.tpu.v2alpha1.GuestAttributes result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GuestAttributes buildPartial() { + com.google.cloud.tpu.v2alpha1.GuestAttributes result = + new com.google.cloud.tpu.v2alpha1.GuestAttributes(this); + result.queryPath_ = queryPath_; + if (queryValueBuilder_ == null) { + result.queryValue_ = queryValue_; + } else { + result.queryValue_ = queryValueBuilder_.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.v2alpha1.GuestAttributes) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.GuestAttributes) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.GuestAttributes other) { + if (other == com.google.cloud.tpu.v2alpha1.GuestAttributes.getDefaultInstance()) return this; + if (!other.getQueryPath().isEmpty()) { + queryPath_ = other.queryPath_; + onChanged(); + } + if (other.hasQueryValue()) { + mergeQueryValue(other.getQueryValue()); + } + 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.v2alpha1.GuestAttributes parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v2alpha1.GuestAttributes) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object queryPath_ = ""; + /** + * + * + *
+     * The path to be queried. This can be the default namespace ('/') or a
+     * nested namespace ('/\<namespace\>/') or a specified key
+     * ('/\<namespace\>/\<key\>')
+     * 
+ * + * string query_path = 1; + * + * @return The queryPath. + */ + public java.lang.String getQueryPath() { + java.lang.Object ref = queryPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + queryPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The path to be queried. This can be the default namespace ('/') or a
+     * nested namespace ('/\<namespace\>/') or a specified key
+     * ('/\<namespace\>/\<key\>')
+     * 
+ * + * string query_path = 1; + * + * @return The bytes for queryPath. + */ + public com.google.protobuf.ByteString getQueryPathBytes() { + java.lang.Object ref = queryPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + queryPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The path to be queried. This can be the default namespace ('/') or a
+     * nested namespace ('/\<namespace\>/') or a specified key
+     * ('/\<namespace\>/\<key\>')
+     * 
+ * + * string query_path = 1; + * + * @param value The queryPath to set. + * @return This builder for chaining. + */ + public Builder setQueryPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + queryPath_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The path to be queried. This can be the default namespace ('/') or a
+     * nested namespace ('/\<namespace\>/') or a specified key
+     * ('/\<namespace\>/\<key\>')
+     * 
+ * + * string query_path = 1; + * + * @return This builder for chaining. + */ + public Builder clearQueryPath() { + + queryPath_ = getDefaultInstance().getQueryPath(); + onChanged(); + return this; + } + /** + * + * + *
+     * The path to be queried. This can be the default namespace ('/') or a
+     * nested namespace ('/\<namespace\>/') or a specified key
+     * ('/\<namespace\>/\<key\>')
+     * 
+ * + * string query_path = 1; + * + * @param value The bytes for queryPath to set. + * @return This builder for chaining. + */ + public Builder setQueryPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + queryPath_ = value; + onChanged(); + return this; + } + + private com.google.cloud.tpu.v2alpha1.GuestAttributesValue queryValue_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.GuestAttributesValue, + com.google.cloud.tpu.v2alpha1.GuestAttributesValue.Builder, + com.google.cloud.tpu.v2alpha1.GuestAttributesValueOrBuilder> + queryValueBuilder_; + /** + * + * + *
+     * The value of the requested queried path.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.GuestAttributesValue query_value = 2; + * + * @return Whether the queryValue field is set. + */ + public boolean hasQueryValue() { + return queryValueBuilder_ != null || queryValue_ != null; + } + /** + * + * + *
+     * The value of the requested queried path.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.GuestAttributesValue query_value = 2; + * + * @return The queryValue. + */ + public com.google.cloud.tpu.v2alpha1.GuestAttributesValue getQueryValue() { + if (queryValueBuilder_ == null) { + return queryValue_ == null + ? com.google.cloud.tpu.v2alpha1.GuestAttributesValue.getDefaultInstance() + : queryValue_; + } else { + return queryValueBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The value of the requested queried path.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.GuestAttributesValue query_value = 2; + */ + public Builder setQueryValue(com.google.cloud.tpu.v2alpha1.GuestAttributesValue value) { + if (queryValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryValue_ = value; + onChanged(); + } else { + queryValueBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The value of the requested queried path.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.GuestAttributesValue query_value = 2; + */ + public Builder setQueryValue( + com.google.cloud.tpu.v2alpha1.GuestAttributesValue.Builder builderForValue) { + if (queryValueBuilder_ == null) { + queryValue_ = builderForValue.build(); + onChanged(); + } else { + queryValueBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The value of the requested queried path.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.GuestAttributesValue query_value = 2; + */ + public Builder mergeQueryValue(com.google.cloud.tpu.v2alpha1.GuestAttributesValue value) { + if (queryValueBuilder_ == null) { + if (queryValue_ != null) { + queryValue_ = + com.google.cloud.tpu.v2alpha1.GuestAttributesValue.newBuilder(queryValue_) + .mergeFrom(value) + .buildPartial(); + } else { + queryValue_ = value; + } + onChanged(); + } else { + queryValueBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The value of the requested queried path.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.GuestAttributesValue query_value = 2; + */ + public Builder clearQueryValue() { + if (queryValueBuilder_ == null) { + queryValue_ = null; + onChanged(); + } else { + queryValue_ = null; + queryValueBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The value of the requested queried path.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.GuestAttributesValue query_value = 2; + */ + public com.google.cloud.tpu.v2alpha1.GuestAttributesValue.Builder getQueryValueBuilder() { + + onChanged(); + return getQueryValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The value of the requested queried path.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.GuestAttributesValue query_value = 2; + */ + public com.google.cloud.tpu.v2alpha1.GuestAttributesValueOrBuilder getQueryValueOrBuilder() { + if (queryValueBuilder_ != null) { + return queryValueBuilder_.getMessageOrBuilder(); + } else { + return queryValue_ == null + ? com.google.cloud.tpu.v2alpha1.GuestAttributesValue.getDefaultInstance() + : queryValue_; + } + } + /** + * + * + *
+     * The value of the requested queried path.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.GuestAttributesValue query_value = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.GuestAttributesValue, + com.google.cloud.tpu.v2alpha1.GuestAttributesValue.Builder, + com.google.cloud.tpu.v2alpha1.GuestAttributesValueOrBuilder> + getQueryValueFieldBuilder() { + if (queryValueBuilder_ == null) { + queryValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.GuestAttributesValue, + com.google.cloud.tpu.v2alpha1.GuestAttributesValue.Builder, + com.google.cloud.tpu.v2alpha1.GuestAttributesValueOrBuilder>( + getQueryValue(), getParentForChildren(), isClean()); + queryValue_ = null; + } + return queryValueBuilder_; + } + + @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.v2alpha1.GuestAttributes) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.GuestAttributes) + private static final com.google.cloud.tpu.v2alpha1.GuestAttributes DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.GuestAttributes(); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributes getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GuestAttributes parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GuestAttributes(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.v2alpha1.GuestAttributes getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesEntry.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesEntry.java new file mode 100644 index 00000000..05b0a6c0 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesEntry.java @@ -0,0 +1,994 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * A guest attributes namespace/key/value entry.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.GuestAttributesEntry} + */ +public final class GuestAttributesEntry extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.GuestAttributesEntry) + GuestAttributesEntryOrBuilder { + private static final long serialVersionUID = 0L; + // Use GuestAttributesEntry.newBuilder() to construct. + private GuestAttributesEntry(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GuestAttributesEntry() { + namespace_ = ""; + key_ = ""; + value_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GuestAttributesEntry(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GuestAttributesEntry( + 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(); + + namespace_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + value_ = 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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GuestAttributesEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GuestAttributesEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.GuestAttributesEntry.class, + com.google.cloud.tpu.v2alpha1.GuestAttributesEntry.Builder.class); + } + + public static final int NAMESPACE_FIELD_NUMBER = 1; + private volatile java.lang.Object namespace_; + /** + * + * + *
+   * Namespace for the guest attribute entry.
+   * 
+ * + * string namespace = 1; + * + * @return The namespace. + */ + @java.lang.Override + public java.lang.String getNamespace() { + java.lang.Object ref = namespace_; + 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(); + namespace_ = s; + return s; + } + } + /** + * + * + *
+   * Namespace for the guest attribute entry.
+   * 
+ * + * string namespace = 1; + * + * @return The bytes for namespace. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNamespaceBytes() { + java.lang.Object ref = namespace_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + namespace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KEY_FIELD_NUMBER = 2; + private volatile java.lang.Object key_; + /** + * + * + *
+   * Key for the guest attribute entry.
+   * 
+ * + * string key = 2; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * + * + *
+   * Key for the guest attribute entry.
+   * 
+ * + * string key = 2; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 3; + private volatile java.lang.Object value_; + /** + * + * + *
+   * Value for the guest attribute entry.
+   * 
+ * + * string value = 3; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + 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(); + value_ = s; + return s; + } + } + /** + * + * + *
+   * Value for the guest attribute entry.
+   * 
+ * + * string value = 3; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(namespace_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, namespace_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, key_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, value_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(namespace_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, namespace_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, key_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, value_); + } + 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.v2alpha1.GuestAttributesEntry)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.GuestAttributesEntry other = + (com.google.cloud.tpu.v2alpha1.GuestAttributesEntry) obj; + + if (!getNamespace().equals(other.getNamespace())) return false; + if (!getKey().equals(other.getKey())) return false; + if (!getValue().equals(other.getValue())) 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) + NAMESPACE_FIELD_NUMBER; + hash = (53 * hash) + getNamespace().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributesEntry parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributesEntry 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.v2alpha1.GuestAttributesEntry parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributesEntry 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.v2alpha1.GuestAttributesEntry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributesEntry parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributesEntry parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributesEntry 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.v2alpha1.GuestAttributesEntry parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributesEntry 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.v2alpha1.GuestAttributesEntry parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributesEntry 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.v2alpha1.GuestAttributesEntry 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 guest attributes namespace/key/value entry.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.GuestAttributesEntry} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.GuestAttributesEntry) + com.google.cloud.tpu.v2alpha1.GuestAttributesEntryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GuestAttributesEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GuestAttributesEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.GuestAttributesEntry.class, + com.google.cloud.tpu.v2alpha1.GuestAttributesEntry.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.GuestAttributesEntry.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(); + namespace_ = ""; + + key_ = ""; + + value_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GuestAttributesEntry_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GuestAttributesEntry getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.GuestAttributesEntry.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GuestAttributesEntry build() { + com.google.cloud.tpu.v2alpha1.GuestAttributesEntry result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GuestAttributesEntry buildPartial() { + com.google.cloud.tpu.v2alpha1.GuestAttributesEntry result = + new com.google.cloud.tpu.v2alpha1.GuestAttributesEntry(this); + result.namespace_ = namespace_; + result.key_ = key_; + result.value_ = value_; + 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.v2alpha1.GuestAttributesEntry) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.GuestAttributesEntry) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.GuestAttributesEntry other) { + if (other == com.google.cloud.tpu.v2alpha1.GuestAttributesEntry.getDefaultInstance()) + return this; + if (!other.getNamespace().isEmpty()) { + namespace_ = other.namespace_; + onChanged(); + } + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (!other.getValue().isEmpty()) { + value_ = other.value_; + 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.v2alpha1.GuestAttributesEntry parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.tpu.v2alpha1.GuestAttributesEntry) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object namespace_ = ""; + /** + * + * + *
+     * Namespace for the guest attribute entry.
+     * 
+ * + * string namespace = 1; + * + * @return The namespace. + */ + public java.lang.String getNamespace() { + java.lang.Object ref = namespace_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + namespace_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Namespace for the guest attribute entry.
+     * 
+ * + * string namespace = 1; + * + * @return The bytes for namespace. + */ + public com.google.protobuf.ByteString getNamespaceBytes() { + java.lang.Object ref = namespace_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + namespace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Namespace for the guest attribute entry.
+     * 
+ * + * string namespace = 1; + * + * @param value The namespace to set. + * @return This builder for chaining. + */ + public Builder setNamespace(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + namespace_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Namespace for the guest attribute entry.
+     * 
+ * + * string namespace = 1; + * + * @return This builder for chaining. + */ + public Builder clearNamespace() { + + namespace_ = getDefaultInstance().getNamespace(); + onChanged(); + return this; + } + /** + * + * + *
+     * Namespace for the guest attribute entry.
+     * 
+ * + * string namespace = 1; + * + * @param value The bytes for namespace to set. + * @return This builder for chaining. + */ + public Builder setNamespaceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + namespace_ = value; + onChanged(); + return this; + } + + private java.lang.Object key_ = ""; + /** + * + * + *
+     * Key for the guest attribute entry.
+     * 
+ * + * string key = 2; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Key for the guest attribute entry.
+     * 
+ * + * string key = 2; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Key for the guest attribute entry.
+     * 
+ * + * string key = 2; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Key for the guest attribute entry.
+     * 
+ * + * string key = 2; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * + * + *
+     * Key for the guest attribute entry.
+     * 
+ * + * string key = 2; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private java.lang.Object value_ = ""; + /** + * + * + *
+     * Value for the guest attribute entry.
+     * 
+ * + * string value = 3; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Value for the guest attribute entry.
+     * 
+ * + * string value = 3; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Value for the guest attribute entry.
+     * 
+ * + * string value = 3; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + value_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Value for the guest attribute entry.
+     * 
+ * + * string value = 3; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + /** + * + * + *
+     * Value for the guest attribute entry.
+     * 
+ * + * string value = 3; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + value_ = 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.v2alpha1.GuestAttributesEntry) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.GuestAttributesEntry) + private static final com.google.cloud.tpu.v2alpha1.GuestAttributesEntry DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.GuestAttributesEntry(); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributesEntry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GuestAttributesEntry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GuestAttributesEntry(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.v2alpha1.GuestAttributesEntry getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesEntryOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesEntryOrBuilder.java new file mode 100644 index 00000000..8860e130 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesEntryOrBuilder.java @@ -0,0 +1,100 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface GuestAttributesEntryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.GuestAttributesEntry) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Namespace for the guest attribute entry.
+   * 
+ * + * string namespace = 1; + * + * @return The namespace. + */ + java.lang.String getNamespace(); + /** + * + * + *
+   * Namespace for the guest attribute entry.
+   * 
+ * + * string namespace = 1; + * + * @return The bytes for namespace. + */ + com.google.protobuf.ByteString getNamespaceBytes(); + + /** + * + * + *
+   * Key for the guest attribute entry.
+   * 
+ * + * string key = 2; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+   * Key for the guest attribute entry.
+   * 
+ * + * string key = 2; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * + * + *
+   * Value for the guest attribute entry.
+   * 
+ * + * string value = 3; + * + * @return The value. + */ + java.lang.String getValue(); + /** + * + * + *
+   * Value for the guest attribute entry.
+   * 
+ * + * string value = 3; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesOrBuilder.java new file mode 100644 index 00000000..62180b51 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesOrBuilder.java @@ -0,0 +1,89 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface GuestAttributesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.GuestAttributes) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The path to be queried. This can be the default namespace ('/') or a
+   * nested namespace ('/\<namespace\>/') or a specified key
+   * ('/\<namespace\>/\<key\>')
+   * 
+ * + * string query_path = 1; + * + * @return The queryPath. + */ + java.lang.String getQueryPath(); + /** + * + * + *
+   * The path to be queried. This can be the default namespace ('/') or a
+   * nested namespace ('/\<namespace\>/') or a specified key
+   * ('/\<namespace\>/\<key\>')
+   * 
+ * + * string query_path = 1; + * + * @return The bytes for queryPath. + */ + com.google.protobuf.ByteString getQueryPathBytes(); + + /** + * + * + *
+   * The value of the requested queried path.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.GuestAttributesValue query_value = 2; + * + * @return Whether the queryValue field is set. + */ + boolean hasQueryValue(); + /** + * + * + *
+   * The value of the requested queried path.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.GuestAttributesValue query_value = 2; + * + * @return The queryValue. + */ + com.google.cloud.tpu.v2alpha1.GuestAttributesValue getQueryValue(); + /** + * + * + *
+   * The value of the requested queried path.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.GuestAttributesValue query_value = 2; + */ + com.google.cloud.tpu.v2alpha1.GuestAttributesValueOrBuilder getQueryValueOrBuilder(); +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesValue.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesValue.java new file mode 100644 index 00000000..25d75957 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesValue.java @@ -0,0 +1,955 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Array of guest attribute namespace/key/value tuples.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.GuestAttributesValue} + */ +public final class GuestAttributesValue extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.GuestAttributesValue) + GuestAttributesValueOrBuilder { + private static final long serialVersionUID = 0L; + // Use GuestAttributesValue.newBuilder() to construct. + private GuestAttributesValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GuestAttributesValue() { + items_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GuestAttributesValue(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GuestAttributesValue( + 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)) { + items_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + items_.add( + input.readMessage( + com.google.cloud.tpu.v2alpha1.GuestAttributesEntry.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)) { + items_ = java.util.Collections.unmodifiableList(items_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GuestAttributesValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GuestAttributesValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.GuestAttributesValue.class, + com.google.cloud.tpu.v2alpha1.GuestAttributesValue.Builder.class); + } + + public static final int ITEMS_FIELD_NUMBER = 1; + private java.util.List items_; + /** + * + * + *
+   * The list of guest attributes entries.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + /** + * + * + *
+   * The list of guest attributes entries.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + @java.lang.Override + public java.util.List + getItemsOrBuilderList() { + return items_; + } + /** + * + * + *
+   * The list of guest attributes entries.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + /** + * + * + *
+   * The list of guest attributes entries.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GuestAttributesEntry getItems(int index) { + return items_.get(index); + } + /** + * + * + *
+   * The list of guest attributes entries.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GuestAttributesEntryOrBuilder getItemsOrBuilder(int index) { + return items_.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 { + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(1, items_.get(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 < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, items_.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.v2alpha1.GuestAttributesValue)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.GuestAttributesValue other = + (com.google.cloud.tpu.v2alpha1.GuestAttributesValue) obj; + + if (!getItemsList().equals(other.getItemsList())) 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 (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributesValue parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributesValue 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.v2alpha1.GuestAttributesValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributesValue 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.v2alpha1.GuestAttributesValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributesValue parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributesValue parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributesValue 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.v2alpha1.GuestAttributesValue parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributesValue 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.v2alpha1.GuestAttributesValue parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributesValue 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.v2alpha1.GuestAttributesValue 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; + } + /** + * + * + *
+   * Array of guest attribute namespace/key/value tuples.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.GuestAttributesValue} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.GuestAttributesValue) + com.google.cloud.tpu.v2alpha1.GuestAttributesValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GuestAttributesValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GuestAttributesValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.GuestAttributesValue.class, + com.google.cloud.tpu.v2alpha1.GuestAttributesValue.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.GuestAttributesValue.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getItemsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + itemsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GuestAttributesValue_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GuestAttributesValue getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.GuestAttributesValue.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GuestAttributesValue build() { + com.google.cloud.tpu.v2alpha1.GuestAttributesValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GuestAttributesValue buildPartial() { + com.google.cloud.tpu.v2alpha1.GuestAttributesValue result = + new com.google.cloud.tpu.v2alpha1.GuestAttributesValue(this); + int from_bitField0_ = bitField0_; + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.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.v2alpha1.GuestAttributesValue) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.GuestAttributesValue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.GuestAttributesValue other) { + if (other == com.google.cloud.tpu.v2alpha1.GuestAttributesValue.getDefaultInstance()) + return this; + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000001); + itemsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getItemsFieldBuilder() + : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + 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.v2alpha1.GuestAttributesValue parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.tpu.v2alpha1.GuestAttributesValue) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List items_ = + java.util.Collections.emptyList(); + + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + items_ = + new java.util.ArrayList(items_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.GuestAttributesEntry, + com.google.cloud.tpu.v2alpha1.GuestAttributesEntry.Builder, + com.google.cloud.tpu.v2alpha1.GuestAttributesEntryOrBuilder> + itemsBuilder_; + + /** + * + * + *
+     * The list of guest attributes entries.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of guest attributes entries.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of guest attributes entries.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + public com.google.cloud.tpu.v2alpha1.GuestAttributesEntry getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of guest attributes entries.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + public Builder setItems(int index, com.google.cloud.tpu.v2alpha1.GuestAttributesEntry value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of guest attributes entries.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + public Builder setItems( + int index, com.google.cloud.tpu.v2alpha1.GuestAttributesEntry.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of guest attributes entries.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + public Builder addItems(com.google.cloud.tpu.v2alpha1.GuestAttributesEntry value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of guest attributes entries.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + public Builder addItems(int index, com.google.cloud.tpu.v2alpha1.GuestAttributesEntry value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of guest attributes entries.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + public Builder addItems( + com.google.cloud.tpu.v2alpha1.GuestAttributesEntry.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of guest attributes entries.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + public Builder addItems( + int index, com.google.cloud.tpu.v2alpha1.GuestAttributesEntry.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of guest attributes entries.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + public Builder addAllItems( + java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of guest attributes entries.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of guest attributes entries.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of guest attributes entries.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + public com.google.cloud.tpu.v2alpha1.GuestAttributesEntry.Builder getItemsBuilder(int index) { + return getItemsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of guest attributes entries.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + public com.google.cloud.tpu.v2alpha1.GuestAttributesEntryOrBuilder getItemsOrBuilder( + int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of guest attributes entries.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + public java.util.List + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + /** + * + * + *
+     * The list of guest attributes entries.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + public com.google.cloud.tpu.v2alpha1.GuestAttributesEntry.Builder addItemsBuilder() { + return getItemsFieldBuilder() + .addBuilder(com.google.cloud.tpu.v2alpha1.GuestAttributesEntry.getDefaultInstance()); + } + /** + * + * + *
+     * The list of guest attributes entries.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + public com.google.cloud.tpu.v2alpha1.GuestAttributesEntry.Builder addItemsBuilder(int index) { + return getItemsFieldBuilder() + .addBuilder( + index, com.google.cloud.tpu.v2alpha1.GuestAttributesEntry.getDefaultInstance()); + } + /** + * + * + *
+     * The list of guest attributes entries.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + public java.util.List + getItemsBuilderList() { + return getItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.GuestAttributesEntry, + com.google.cloud.tpu.v2alpha1.GuestAttributesEntry.Builder, + com.google.cloud.tpu.v2alpha1.GuestAttributesEntryOrBuilder> + getItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.GuestAttributesEntry, + com.google.cloud.tpu.v2alpha1.GuestAttributesEntry.Builder, + com.google.cloud.tpu.v2alpha1.GuestAttributesEntryOrBuilder>( + items_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + items_ = null; + } + return itemsBuilder_; + } + + @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.v2alpha1.GuestAttributesValue) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.GuestAttributesValue) + private static final com.google.cloud.tpu.v2alpha1.GuestAttributesValue DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.GuestAttributesValue(); + } + + public static com.google.cloud.tpu.v2alpha1.GuestAttributesValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GuestAttributesValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GuestAttributesValue(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.v2alpha1.GuestAttributesValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesValueOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesValueOrBuilder.java new file mode 100644 index 00000000..4a732623 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesValueOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface GuestAttributesValueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.GuestAttributesValue) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of guest attributes entries.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + java.util.List getItemsList(); + /** + * + * + *
+   * The list of guest attributes entries.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + com.google.cloud.tpu.v2alpha1.GuestAttributesEntry getItems(int index); + /** + * + * + *
+   * The list of guest attributes entries.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + int getItemsCount(); + /** + * + * + *
+   * The list of guest attributes entries.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + java.util.List + getItemsOrBuilderList(); + /** + * + * + *
+   * The list of guest attributes entries.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.GuestAttributesEntry items = 1; + */ + com.google.cloud.tpu.v2alpha1.GuestAttributesEntryOrBuilder getItemsOrBuilder(int index); +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesRequest.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesRequest.java new file mode 100644 index 00000000..732d8823 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesRequest.java @@ -0,0 +1,1280 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Request for
+ * [ListAcceleratorTypes][google.cloud.tpu.v2alpha1.Tpu.ListAcceleratorTypes].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest} + */ +public final class ListAcceleratorTypesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListAcceleratorTypesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListAcceleratorTypesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest.class, + com.google.cloud.tpu.v2alpha1.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + 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.v2alpha1.ListAcceleratorTypesRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest other = + (com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListAcceleratorTypesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListAcceleratorTypesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListAcceleratorTypesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListAcceleratorTypesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListAcceleratorTypesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.Tpu.ListAcceleratorTypes].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest) + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListAcceleratorTypesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListAcceleratorTypesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest.class, + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListAcceleratorTypesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest build() { + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest buildPartial() { + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest result = + new com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListAcceleratorTypesRequest) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest other) { + if (other == com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListAcceleratorTypesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListAcceleratorTypesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest) + private static final com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest(); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListAcceleratorTypesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesRequestOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesRequestOrBuilder.java new file mode 100644 index 00000000..491c1198 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface ListAcceleratorTypesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.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-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesResponse.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesResponse.java new file mode 100644 index 00000000..711d9d5f --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesResponse.java @@ -0,0 +1,1420 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Response for
+ * [ListAcceleratorTypes][google.cloud.tpu.v2alpha1.Tpu.ListAcceleratorTypes].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse} + */ +public final class ListAcceleratorTypesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListAcceleratorTypesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListAcceleratorTypesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse.class, + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse.Builder.class); + } + + public static final int ACCELERATOR_TYPES_FIELD_NUMBER = 1; + private java.util.List acceleratorTypes_; + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AcceleratorType accelerator_types = 1; + */ + @java.lang.Override + public java.util.List getAcceleratorTypesList() { + return acceleratorTypes_; + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AcceleratorType accelerator_types = 1; + */ + @java.lang.Override + public java.util.List + getAcceleratorTypesOrBuilderList() { + return acceleratorTypes_; + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AcceleratorType accelerator_types = 1; + */ + @java.lang.Override + public int getAcceleratorTypesCount() { + return acceleratorTypes_.size(); + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AcceleratorType accelerator_types = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.AcceleratorType getAcceleratorTypes(int index) { + return acceleratorTypes_.get(index); + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AcceleratorType accelerator_types = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < acceleratorTypes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, acceleratorTypes_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse other = + (com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListAcceleratorTypesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListAcceleratorTypesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListAcceleratorTypesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListAcceleratorTypesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListAcceleratorTypesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.Tpu.ListAcceleratorTypes].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse) + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListAcceleratorTypesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListAcceleratorTypesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse.class, + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListAcceleratorTypesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse build() { + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse buildPartial() { + com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse result = + new com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListAcceleratorTypesResponse) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse other) { + if (other == com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListAcceleratorTypesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.tpu.v2alpha1.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.v2alpha1.AcceleratorType, + com.google.cloud.tpu.v2alpha1.AcceleratorType.Builder, + com.google.cloud.tpu.v2alpha1.AcceleratorTypeOrBuilder> + acceleratorTypesBuilder_; + + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.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.v2alpha1.AcceleratorType accelerator_types = 1; + */ + public int getAcceleratorTypesCount() { + if (acceleratorTypesBuilder_ == null) { + return acceleratorTypes_.size(); + } else { + return acceleratorTypesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AcceleratorType accelerator_types = 1; + */ + public com.google.cloud.tpu.v2alpha1.AcceleratorType getAcceleratorTypes(int index) { + if (acceleratorTypesBuilder_ == null) { + return acceleratorTypes_.get(index); + } else { + return acceleratorTypesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AcceleratorType accelerator_types = 1; + */ + public Builder setAcceleratorTypes( + int index, com.google.cloud.tpu.v2alpha1.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.v2alpha1.AcceleratorType accelerator_types = 1; + */ + public Builder setAcceleratorTypes( + int index, com.google.cloud.tpu.v2alpha1.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.v2alpha1.AcceleratorType accelerator_types = 1; + */ + public Builder addAcceleratorTypes(com.google.cloud.tpu.v2alpha1.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.v2alpha1.AcceleratorType accelerator_types = 1; + */ + public Builder addAcceleratorTypes( + int index, com.google.cloud.tpu.v2alpha1.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.v2alpha1.AcceleratorType accelerator_types = 1; + */ + public Builder addAcceleratorTypes( + com.google.cloud.tpu.v2alpha1.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.v2alpha1.AcceleratorType accelerator_types = 1; + */ + public Builder addAcceleratorTypes( + int index, com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.AcceleratorType accelerator_types = 1; + */ + public com.google.cloud.tpu.v2alpha1.AcceleratorType.Builder getAcceleratorTypesBuilder( + int index) { + return getAcceleratorTypesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AcceleratorType accelerator_types = 1; + */ + public com.google.cloud.tpu.v2alpha1.AcceleratorTypeOrBuilder getAcceleratorTypesOrBuilder( + int index) { + if (acceleratorTypesBuilder_ == null) { + return acceleratorTypes_.get(index); + } else { + return acceleratorTypesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.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.v2alpha1.AcceleratorType accelerator_types = 1; + */ + public com.google.cloud.tpu.v2alpha1.AcceleratorType.Builder addAcceleratorTypesBuilder() { + return getAcceleratorTypesFieldBuilder() + .addBuilder(com.google.cloud.tpu.v2alpha1.AcceleratorType.getDefaultInstance()); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AcceleratorType accelerator_types = 1; + */ + public com.google.cloud.tpu.v2alpha1.AcceleratorType.Builder addAcceleratorTypesBuilder( + int index) { + return getAcceleratorTypesFieldBuilder() + .addBuilder(index, com.google.cloud.tpu.v2alpha1.AcceleratorType.getDefaultInstance()); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AcceleratorType accelerator_types = 1; + */ + public java.util.List + getAcceleratorTypesBuilderList() { + return getAcceleratorTypesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.AcceleratorType, + com.google.cloud.tpu.v2alpha1.AcceleratorType.Builder, + com.google.cloud.tpu.v2alpha1.AcceleratorTypeOrBuilder> + getAcceleratorTypesFieldBuilder() { + if (acceleratorTypesBuilder_ == null) { + acceleratorTypesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.AcceleratorType, + com.google.cloud.tpu.v2alpha1.AcceleratorType.Builder, + com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListAcceleratorTypesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse) + private static final com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse(); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListAcceleratorTypesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesResponseOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesResponseOrBuilder.java new file mode 100644 index 00000000..7865d157 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface ListAcceleratorTypesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AcceleratorType accelerator_types = 1; + */ + java.util.List getAcceleratorTypesList(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AcceleratorType accelerator_types = 1; + */ + com.google.cloud.tpu.v2alpha1.AcceleratorType getAcceleratorTypes(int index); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AcceleratorType accelerator_types = 1; + */ + int getAcceleratorTypesCount(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AcceleratorType accelerator_types = 1; + */ + java.util.List + getAcceleratorTypesOrBuilderList(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AcceleratorType accelerator_types = 1; + */ + com.google.cloud.tpu.v2alpha1.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-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesRequest.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesRequest.java new file mode 100644 index 00000000..2156fb54 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesRequest.java @@ -0,0 +1,917 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Request for [ListNodes][google.cloud.tpu.v2alpha1.Tpu.ListNodes].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.ListNodesRequest} + */ +public final class ListNodesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListNodesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListNodesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.ListNodesRequest.class, + com.google.cloud.tpu.v2alpha1.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + 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.v2alpha1.ListNodesRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.ListNodesRequest other = + (com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListNodesRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListNodesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListNodesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListNodesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListNodesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.Tpu.ListNodes].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.ListNodesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.ListNodesRequest) + com.google.cloud.tpu.v2alpha1.ListNodesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListNodesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListNodesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.ListNodesRequest.class, + com.google.cloud.tpu.v2alpha1.ListNodesRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListNodesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListNodesRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.ListNodesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListNodesRequest build() { + com.google.cloud.tpu.v2alpha1.ListNodesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListNodesRequest buildPartial() { + com.google.cloud.tpu.v2alpha1.ListNodesRequest result = + new com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListNodesRequest) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.ListNodesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.ListNodesRequest other) { + if (other == com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListNodesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListNodesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.ListNodesRequest) + private static final com.google.cloud.tpu.v2alpha1.ListNodesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.ListNodesRequest(); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListNodesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesRequestOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesRequestOrBuilder.java new file mode 100644 index 00000000..66910ddb --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface ListNodesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.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-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesResponse.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesResponse.java new file mode 100644 index 00000000..fff1e7b2 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesResponse.java @@ -0,0 +1,1400 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Response for [ListNodes][google.cloud.tpu.v2alpha1.Tpu.ListNodes].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.ListNodesResponse} + */ +public final class ListNodesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListNodesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListNodesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.ListNodesResponse.class, + com.google.cloud.tpu.v2alpha1.ListNodesResponse.Builder.class); + } + + public static final int NODES_FIELD_NUMBER = 1; + private java.util.List nodes_; + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.Node nodes = 1; + */ + @java.lang.Override + public java.util.List getNodesList() { + return nodes_; + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.Node nodes = 1; + */ + @java.lang.Override + public java.util.List + getNodesOrBuilderList() { + return nodes_; + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.Node nodes = 1; + */ + @java.lang.Override + public int getNodesCount() { + return nodes_.size(); + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.Node nodes = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.Node getNodes(int index) { + return nodes_.get(index); + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.Node nodes = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < nodes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, nodes_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.tpu.v2alpha1.ListNodesResponse)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.ListNodesResponse other = + (com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListNodesResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListNodesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListNodesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListNodesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListNodesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.Tpu.ListNodes].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.ListNodesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.ListNodesResponse) + com.google.cloud.tpu.v2alpha1.ListNodesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListNodesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListNodesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.ListNodesResponse.class, + com.google.cloud.tpu.v2alpha1.ListNodesResponse.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListNodesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListNodesResponse getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.ListNodesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListNodesResponse build() { + com.google.cloud.tpu.v2alpha1.ListNodesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListNodesResponse buildPartial() { + com.google.cloud.tpu.v2alpha1.ListNodesResponse result = + new com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListNodesResponse) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.ListNodesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.ListNodesResponse other) { + if (other == com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListNodesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v2alpha1.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.v2alpha1.Node, + com.google.cloud.tpu.v2alpha1.Node.Builder, + com.google.cloud.tpu.v2alpha1.NodeOrBuilder> + nodesBuilder_; + + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.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.v2alpha1.Node nodes = 1; + */ + public int getNodesCount() { + if (nodesBuilder_ == null) { + return nodes_.size(); + } else { + return nodesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.Node nodes = 1; + */ + public com.google.cloud.tpu.v2alpha1.Node getNodes(int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.Node nodes = 1; + */ + public Builder setNodes(int index, com.google.cloud.tpu.v2alpha1.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.v2alpha1.Node nodes = 1; + */ + public Builder setNodes(int index, com.google.cloud.tpu.v2alpha1.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.v2alpha1.Node nodes = 1; + */ + public Builder addNodes(com.google.cloud.tpu.v2alpha1.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.v2alpha1.Node nodes = 1; + */ + public Builder addNodes(int index, com.google.cloud.tpu.v2alpha1.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.v2alpha1.Node nodes = 1; + */ + public Builder addNodes(com.google.cloud.tpu.v2alpha1.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.v2alpha1.Node nodes = 1; + */ + public Builder addNodes(int index, com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.Node nodes = 1; + */ + public com.google.cloud.tpu.v2alpha1.Node.Builder getNodesBuilder(int index) { + return getNodesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.Node nodes = 1; + */ + public com.google.cloud.tpu.v2alpha1.NodeOrBuilder getNodesOrBuilder(int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.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.v2alpha1.Node nodes = 1; + */ + public com.google.cloud.tpu.v2alpha1.Node.Builder addNodesBuilder() { + return getNodesFieldBuilder() + .addBuilder(com.google.cloud.tpu.v2alpha1.Node.getDefaultInstance()); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.Node nodes = 1; + */ + public com.google.cloud.tpu.v2alpha1.Node.Builder addNodesBuilder(int index) { + return getNodesFieldBuilder() + .addBuilder(index, com.google.cloud.tpu.v2alpha1.Node.getDefaultInstance()); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.Node nodes = 1; + */ + public java.util.List getNodesBuilderList() { + return getNodesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.Node, + com.google.cloud.tpu.v2alpha1.Node.Builder, + com.google.cloud.tpu.v2alpha1.NodeOrBuilder> + getNodesFieldBuilder() { + if (nodesBuilder_ == null) { + nodesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.Node, + com.google.cloud.tpu.v2alpha1.Node.Builder, + com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListNodesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.ListNodesResponse) + private static final com.google.cloud.tpu.v2alpha1.ListNodesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.ListNodesResponse(); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.ListNodesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesResponseOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesResponseOrBuilder.java new file mode 100644 index 00000000..7922b1ee --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface ListNodesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.ListNodesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.Node nodes = 1; + */ + java.util.List getNodesList(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.Node nodes = 1; + */ + com.google.cloud.tpu.v2alpha1.Node getNodes(int index); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.Node nodes = 1; + */ + int getNodesCount(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.Node nodes = 1; + */ + java.util.List getNodesOrBuilderList(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.Node nodes = 1; + */ + com.google.cloud.tpu.v2alpha1.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-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsRequest.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsRequest.java new file mode 100644 index 00000000..0e998a29 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsRequest.java @@ -0,0 +1,1280 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Request for
+ * [ListRuntimeVersions][google.cloud.tpu.v2alpha1.Tpu.ListRuntimeVersions].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest} + */ +public final class ListRuntimeVersionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest) + ListRuntimeVersionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListRuntimeVersionsRequest.newBuilder() to construct. + private ListRuntimeVersionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListRuntimeVersionsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListRuntimeVersionsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListRuntimeVersionsRequest( + 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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListRuntimeVersionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListRuntimeVersionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest.class, + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + 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.v2alpha1.ListRuntimeVersionsRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest other = + (com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest) 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.v2alpha1.ListRuntimeVersionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest 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.v2alpha1.ListRuntimeVersionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest 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.v2alpha1.ListRuntimeVersionsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest 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.v2alpha1.ListRuntimeVersionsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest 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.v2alpha1.ListRuntimeVersionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest 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.v2alpha1.ListRuntimeVersionsRequest 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
+   * [ListRuntimeVersions][google.cloud.tpu.v2alpha1.Tpu.ListRuntimeVersions].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest) + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListRuntimeVersionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListRuntimeVersionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest.class, + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListRuntimeVersionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest build() { + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest buildPartial() { + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest result = + new com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest(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.v2alpha1.ListRuntimeVersionsRequest) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest other) { + if (other == com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest.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.v2alpha1.ListRuntimeVersionsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest) 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.v2alpha1.ListRuntimeVersionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest) + private static final com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest(); + } + + public static com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRuntimeVersionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListRuntimeVersionsRequest(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.v2alpha1.ListRuntimeVersionsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsRequestOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsRequestOrBuilder.java new file mode 100644 index 00000000..115c5374 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsRequestOrBuilder.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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface ListRuntimeVersionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest) + 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-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsResponse.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsResponse.java new file mode 100644 index 00000000..90ae751b --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsResponse.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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Response for
+ * [ListRuntimeVersions][google.cloud.tpu.v2alpha1.Tpu.ListRuntimeVersions].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse} + */ +public final class ListRuntimeVersionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse) + ListRuntimeVersionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListRuntimeVersionsResponse.newBuilder() to construct. + private ListRuntimeVersionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListRuntimeVersionsResponse() { + runtimeVersions_ = 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 ListRuntimeVersionsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListRuntimeVersionsResponse( + 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)) { + runtimeVersions_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + runtimeVersions_.add( + input.readMessage( + com.google.cloud.tpu.v2alpha1.RuntimeVersion.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)) { + runtimeVersions_ = java.util.Collections.unmodifiableList(runtimeVersions_); + } + 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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListRuntimeVersionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListRuntimeVersionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse.class, + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse.Builder.class); + } + + public static final int RUNTIME_VERSIONS_FIELD_NUMBER = 1; + private java.util.List runtimeVersions_; + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + @java.lang.Override + public java.util.List getRuntimeVersionsList() { + return runtimeVersions_; + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + @java.lang.Override + public java.util.List + getRuntimeVersionsOrBuilderList() { + return runtimeVersions_; + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + @java.lang.Override + public int getRuntimeVersionsCount() { + return runtimeVersions_.size(); + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.RuntimeVersion getRuntimeVersions(int index) { + return runtimeVersions_.get(index); + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.RuntimeVersionOrBuilder getRuntimeVersionsOrBuilder( + int index) { + return runtimeVersions_.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 < runtimeVersions_.size(); i++) { + output.writeMessage(1, runtimeVersions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < runtimeVersions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, runtimeVersions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse other = + (com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse) obj; + + if (!getRuntimeVersionsList().equals(other.getRuntimeVersionsList())) 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 (getRuntimeVersionsCount() > 0) { + hash = (37 * hash) + RUNTIME_VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getRuntimeVersionsList().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.v2alpha1.ListRuntimeVersionsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse 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.v2alpha1.ListRuntimeVersionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse 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.v2alpha1.ListRuntimeVersionsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse 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.v2alpha1.ListRuntimeVersionsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse 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.v2alpha1.ListRuntimeVersionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse 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.v2alpha1.ListRuntimeVersionsResponse 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
+   * [ListRuntimeVersions][google.cloud.tpu.v2alpha1.Tpu.ListRuntimeVersions].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse) + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListRuntimeVersionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListRuntimeVersionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse.class, + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRuntimeVersionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (runtimeVersionsBuilder_ == null) { + runtimeVersions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + runtimeVersionsBuilder_.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListRuntimeVersionsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse build() { + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse buildPartial() { + com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse result = + new com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse(this); + int from_bitField0_ = bitField0_; + if (runtimeVersionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + runtimeVersions_ = java.util.Collections.unmodifiableList(runtimeVersions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.runtimeVersions_ = runtimeVersions_; + } else { + result.runtimeVersions_ = runtimeVersionsBuilder_.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.v2alpha1.ListRuntimeVersionsResponse) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse other) { + if (other == com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse.getDefaultInstance()) + return this; + if (runtimeVersionsBuilder_ == null) { + if (!other.runtimeVersions_.isEmpty()) { + if (runtimeVersions_.isEmpty()) { + runtimeVersions_ = other.runtimeVersions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRuntimeVersionsIsMutable(); + runtimeVersions_.addAll(other.runtimeVersions_); + } + onChanged(); + } + } else { + if (!other.runtimeVersions_.isEmpty()) { + if (runtimeVersionsBuilder_.isEmpty()) { + runtimeVersionsBuilder_.dispose(); + runtimeVersionsBuilder_ = null; + runtimeVersions_ = other.runtimeVersions_; + bitField0_ = (bitField0_ & ~0x00000001); + runtimeVersionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRuntimeVersionsFieldBuilder() + : null; + } else { + runtimeVersionsBuilder_.addAllMessages(other.runtimeVersions_); + } + } + } + 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.v2alpha1.ListRuntimeVersionsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List runtimeVersions_ = + java.util.Collections.emptyList(); + + private void ensureRuntimeVersionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + runtimeVersions_ = + new java.util.ArrayList(runtimeVersions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.RuntimeVersion, + com.google.cloud.tpu.v2alpha1.RuntimeVersion.Builder, + com.google.cloud.tpu.v2alpha1.RuntimeVersionOrBuilder> + runtimeVersionsBuilder_; + + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + public java.util.List getRuntimeVersionsList() { + if (runtimeVersionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(runtimeVersions_); + } else { + return runtimeVersionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + public int getRuntimeVersionsCount() { + if (runtimeVersionsBuilder_ == null) { + return runtimeVersions_.size(); + } else { + return runtimeVersionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + public com.google.cloud.tpu.v2alpha1.RuntimeVersion getRuntimeVersions(int index) { + if (runtimeVersionsBuilder_ == null) { + return runtimeVersions_.get(index); + } else { + return runtimeVersionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + public Builder setRuntimeVersions( + int index, com.google.cloud.tpu.v2alpha1.RuntimeVersion value) { + if (runtimeVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRuntimeVersionsIsMutable(); + runtimeVersions_.set(index, value); + onChanged(); + } else { + runtimeVersionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + public Builder setRuntimeVersions( + int index, com.google.cloud.tpu.v2alpha1.RuntimeVersion.Builder builderForValue) { + if (runtimeVersionsBuilder_ == null) { + ensureRuntimeVersionsIsMutable(); + runtimeVersions_.set(index, builderForValue.build()); + onChanged(); + } else { + runtimeVersionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + public Builder addRuntimeVersions(com.google.cloud.tpu.v2alpha1.RuntimeVersion value) { + if (runtimeVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRuntimeVersionsIsMutable(); + runtimeVersions_.add(value); + onChanged(); + } else { + runtimeVersionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + public Builder addRuntimeVersions( + int index, com.google.cloud.tpu.v2alpha1.RuntimeVersion value) { + if (runtimeVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRuntimeVersionsIsMutable(); + runtimeVersions_.add(index, value); + onChanged(); + } else { + runtimeVersionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + public Builder addRuntimeVersions( + com.google.cloud.tpu.v2alpha1.RuntimeVersion.Builder builderForValue) { + if (runtimeVersionsBuilder_ == null) { + ensureRuntimeVersionsIsMutable(); + runtimeVersions_.add(builderForValue.build()); + onChanged(); + } else { + runtimeVersionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + public Builder addRuntimeVersions( + int index, com.google.cloud.tpu.v2alpha1.RuntimeVersion.Builder builderForValue) { + if (runtimeVersionsBuilder_ == null) { + ensureRuntimeVersionsIsMutable(); + runtimeVersions_.add(index, builderForValue.build()); + onChanged(); + } else { + runtimeVersionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + public Builder addAllRuntimeVersions( + java.lang.Iterable values) { + if (runtimeVersionsBuilder_ == null) { + ensureRuntimeVersionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, runtimeVersions_); + onChanged(); + } else { + runtimeVersionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + public Builder clearRuntimeVersions() { + if (runtimeVersionsBuilder_ == null) { + runtimeVersions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + runtimeVersionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + public Builder removeRuntimeVersions(int index) { + if (runtimeVersionsBuilder_ == null) { + ensureRuntimeVersionsIsMutable(); + runtimeVersions_.remove(index); + onChanged(); + } else { + runtimeVersionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + public com.google.cloud.tpu.v2alpha1.RuntimeVersion.Builder getRuntimeVersionsBuilder( + int index) { + return getRuntimeVersionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + public com.google.cloud.tpu.v2alpha1.RuntimeVersionOrBuilder getRuntimeVersionsOrBuilder( + int index) { + if (runtimeVersionsBuilder_ == null) { + return runtimeVersions_.get(index); + } else { + return runtimeVersionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + public java.util.List + getRuntimeVersionsOrBuilderList() { + if (runtimeVersionsBuilder_ != null) { + return runtimeVersionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(runtimeVersions_); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + public com.google.cloud.tpu.v2alpha1.RuntimeVersion.Builder addRuntimeVersionsBuilder() { + return getRuntimeVersionsFieldBuilder() + .addBuilder(com.google.cloud.tpu.v2alpha1.RuntimeVersion.getDefaultInstance()); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + public com.google.cloud.tpu.v2alpha1.RuntimeVersion.Builder addRuntimeVersionsBuilder( + int index) { + return getRuntimeVersionsFieldBuilder() + .addBuilder(index, com.google.cloud.tpu.v2alpha1.RuntimeVersion.getDefaultInstance()); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + public java.util.List + getRuntimeVersionsBuilderList() { + return getRuntimeVersionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.RuntimeVersion, + com.google.cloud.tpu.v2alpha1.RuntimeVersion.Builder, + com.google.cloud.tpu.v2alpha1.RuntimeVersionOrBuilder> + getRuntimeVersionsFieldBuilder() { + if (runtimeVersionsBuilder_ == null) { + runtimeVersionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.RuntimeVersion, + com.google.cloud.tpu.v2alpha1.RuntimeVersion.Builder, + com.google.cloud.tpu.v2alpha1.RuntimeVersionOrBuilder>( + runtimeVersions_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + runtimeVersions_ = null; + } + return runtimeVersionsBuilder_; + } + + 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.v2alpha1.ListRuntimeVersionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse) + private static final com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse(); + } + + public static com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRuntimeVersionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListRuntimeVersionsResponse(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.v2alpha1.ListRuntimeVersionsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsResponseOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsResponseOrBuilder.java new file mode 100644 index 00000000..86f9ef99 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsResponseOrBuilder.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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface ListRuntimeVersionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + java.util.List getRuntimeVersionsList(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + com.google.cloud.tpu.v2alpha1.RuntimeVersion getRuntimeVersions(int index); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + int getRuntimeVersionsCount(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + java.util.List + getRuntimeVersionsOrBuilderList(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.RuntimeVersion runtime_versions = 1; + */ + com.google.cloud.tpu.v2alpha1.RuntimeVersionOrBuilder getRuntimeVersionsOrBuilder(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-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/LocationName.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/LocationName.java new file mode 100644 index 00000000..4518cec2 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/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.v2alpha1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfig.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfig.java new file mode 100644 index 00000000..5095474a --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfig.java @@ -0,0 +1,932 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Network related configurations.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.NetworkConfig} + */ +public final class NetworkConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.NetworkConfig) + NetworkConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use NetworkConfig.newBuilder() to construct. + private NetworkConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NetworkConfig() { + network_ = ""; + subnetwork_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NetworkConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private NetworkConfig( + 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(); + + network_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + subnetwork_ = s; + break; + } + case 24: + { + enableExternalIps_ = 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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_NetworkConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_NetworkConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.NetworkConfig.class, + com.google.cloud.tpu.v2alpha1.NetworkConfig.Builder.class); + } + + public static final int NETWORK_FIELD_NUMBER = 1; + private volatile java.lang.Object network_; + /** + * + * + *
+   * The name of the network for the TPU node. It must be a preexisting Google
+   * Compute Engine network. If none is provided, "default" will be used.
+   * 
+ * + * string network = 1; + * + * @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 the network for the TPU node. It must be a preexisting Google
+   * Compute Engine network. If none is provided, "default" will be used.
+   * 
+ * + * string network = 1; + * + * @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 SUBNETWORK_FIELD_NUMBER = 2; + private volatile java.lang.Object subnetwork_; + /** + * + * + *
+   * The name of the subnetwork for the TPU node. It must be a preexisting
+   * Google Compute Engine subnetwork. If none is provided, "default" will be
+   * used.
+   * 
+ * + * string subnetwork = 2; + * + * @return The subnetwork. + */ + @java.lang.Override + public java.lang.String getSubnetwork() { + java.lang.Object ref = subnetwork_; + 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(); + subnetwork_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the subnetwork for the TPU node. It must be a preexisting
+   * Google Compute Engine subnetwork. If none is provided, "default" will be
+   * used.
+   * 
+ * + * string subnetwork = 2; + * + * @return The bytes for subnetwork. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSubnetworkBytes() { + java.lang.Object ref = subnetwork_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + subnetwork_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENABLE_EXTERNAL_IPS_FIELD_NUMBER = 3; + private boolean enableExternalIps_; + /** + * + * + *
+   * Indicates that external IP addresses would be associated with the TPU
+   * workers. If set to false, the specified subnetwork or network should have
+   * Private Google Access enabled.
+   * 
+ * + * bool enable_external_ips = 3; + * + * @return The enableExternalIps. + */ + @java.lang.Override + public boolean getEnableExternalIps() { + return enableExternalIps_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, network_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subnetwork_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, subnetwork_); + } + if (enableExternalIps_ != false) { + output.writeBool(3, enableExternalIps_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, network_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subnetwork_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, subnetwork_); + } + if (enableExternalIps_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, enableExternalIps_); + } + 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.v2alpha1.NetworkConfig)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.NetworkConfig other = + (com.google.cloud.tpu.v2alpha1.NetworkConfig) obj; + + if (!getNetwork().equals(other.getNetwork())) return false; + if (!getSubnetwork().equals(other.getSubnetwork())) return false; + if (getEnableExternalIps() != other.getEnableExternalIps()) 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) + NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getNetwork().hashCode(); + hash = (37 * hash) + SUBNETWORK_FIELD_NUMBER; + hash = (53 * hash) + getSubnetwork().hashCode(); + hash = (37 * hash) + ENABLE_EXTERNAL_IPS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableExternalIps()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.NetworkConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.NetworkConfig 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.v2alpha1.NetworkConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.NetworkConfig 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.v2alpha1.NetworkConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.NetworkConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v2alpha1.NetworkConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.NetworkConfig 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.v2alpha1.NetworkConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.NetworkConfig 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.v2alpha1.NetworkConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.NetworkConfig 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.v2alpha1.NetworkConfig 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; + } + /** + * + * + *
+   * Network related configurations.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.NetworkConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.NetworkConfig) + com.google.cloud.tpu.v2alpha1.NetworkConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_NetworkConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_NetworkConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.NetworkConfig.class, + com.google.cloud.tpu.v2alpha1.NetworkConfig.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.NetworkConfig.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(); + network_ = ""; + + subnetwork_ = ""; + + enableExternalIps_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_NetworkConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.NetworkConfig getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.NetworkConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.NetworkConfig build() { + com.google.cloud.tpu.v2alpha1.NetworkConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.NetworkConfig buildPartial() { + com.google.cloud.tpu.v2alpha1.NetworkConfig result = + new com.google.cloud.tpu.v2alpha1.NetworkConfig(this); + result.network_ = network_; + result.subnetwork_ = subnetwork_; + result.enableExternalIps_ = enableExternalIps_; + 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.v2alpha1.NetworkConfig) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.NetworkConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.NetworkConfig other) { + if (other == com.google.cloud.tpu.v2alpha1.NetworkConfig.getDefaultInstance()) return this; + if (!other.getNetwork().isEmpty()) { + network_ = other.network_; + onChanged(); + } + if (!other.getSubnetwork().isEmpty()) { + subnetwork_ = other.subnetwork_; + onChanged(); + } + if (other.getEnableExternalIps() != false) { + setEnableExternalIps(other.getEnableExternalIps()); + } + 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.v2alpha1.NetworkConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v2alpha1.NetworkConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object network_ = ""; + /** + * + * + *
+     * The name of the network for the TPU node. It must be a preexisting Google
+     * Compute Engine network. If none is provided, "default" will be used.
+     * 
+ * + * string network = 1; + * + * @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 the network for the TPU node. It must be a preexisting Google
+     * Compute Engine network. If none is provided, "default" will be used.
+     * 
+ * + * string network = 1; + * + * @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 the network for the TPU node. It must be a preexisting Google
+     * Compute Engine network. If none is provided, "default" will be used.
+     * 
+ * + * string network = 1; + * + * @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 the network for the TPU node. It must be a preexisting Google
+     * Compute Engine network. If none is provided, "default" will be used.
+     * 
+ * + * string network = 1; + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + + network_ = getDefaultInstance().getNetwork(); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the network for the TPU node. It must be a preexisting Google
+     * Compute Engine network. If none is provided, "default" will be used.
+     * 
+ * + * string network = 1; + * + * @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 subnetwork_ = ""; + /** + * + * + *
+     * The name of the subnetwork for the TPU node. It must be a preexisting
+     * Google Compute Engine subnetwork. If none is provided, "default" will be
+     * used.
+     * 
+ * + * string subnetwork = 2; + * + * @return The subnetwork. + */ + public java.lang.String getSubnetwork() { + java.lang.Object ref = subnetwork_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subnetwork_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the subnetwork for the TPU node. It must be a preexisting
+     * Google Compute Engine subnetwork. If none is provided, "default" will be
+     * used.
+     * 
+ * + * string subnetwork = 2; + * + * @return The bytes for subnetwork. + */ + public com.google.protobuf.ByteString getSubnetworkBytes() { + java.lang.Object ref = subnetwork_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + subnetwork_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the subnetwork for the TPU node. It must be a preexisting
+     * Google Compute Engine subnetwork. If none is provided, "default" will be
+     * used.
+     * 
+ * + * string subnetwork = 2; + * + * @param value The subnetwork to set. + * @return This builder for chaining. + */ + public Builder setSubnetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + subnetwork_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the subnetwork for the TPU node. It must be a preexisting
+     * Google Compute Engine subnetwork. If none is provided, "default" will be
+     * used.
+     * 
+ * + * string subnetwork = 2; + * + * @return This builder for chaining. + */ + public Builder clearSubnetwork() { + + subnetwork_ = getDefaultInstance().getSubnetwork(); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the subnetwork for the TPU node. It must be a preexisting
+     * Google Compute Engine subnetwork. If none is provided, "default" will be
+     * used.
+     * 
+ * + * string subnetwork = 2; + * + * @param value The bytes for subnetwork to set. + * @return This builder for chaining. + */ + public Builder setSubnetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + subnetwork_ = value; + onChanged(); + return this; + } + + private boolean enableExternalIps_; + /** + * + * + *
+     * Indicates that external IP addresses would be associated with the TPU
+     * workers. If set to false, the specified subnetwork or network should have
+     * Private Google Access enabled.
+     * 
+ * + * bool enable_external_ips = 3; + * + * @return The enableExternalIps. + */ + @java.lang.Override + public boolean getEnableExternalIps() { + return enableExternalIps_; + } + /** + * + * + *
+     * Indicates that external IP addresses would be associated with the TPU
+     * workers. If set to false, the specified subnetwork or network should have
+     * Private Google Access enabled.
+     * 
+ * + * bool enable_external_ips = 3; + * + * @param value The enableExternalIps to set. + * @return This builder for chaining. + */ + public Builder setEnableExternalIps(boolean value) { + + enableExternalIps_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates that external IP addresses would be associated with the TPU
+     * workers. If set to false, the specified subnetwork or network should have
+     * Private Google Access enabled.
+     * 
+ * + * bool enable_external_ips = 3; + * + * @return This builder for chaining. + */ + public Builder clearEnableExternalIps() { + + enableExternalIps_ = 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.v2alpha1.NetworkConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.NetworkConfig) + private static final com.google.cloud.tpu.v2alpha1.NetworkConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.NetworkConfig(); + } + + public static com.google.cloud.tpu.v2alpha1.NetworkConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NetworkConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new NetworkConfig(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.v2alpha1.NetworkConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfigOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfigOrBuilder.java new file mode 100644 index 00000000..75b07d7a --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfigOrBuilder.java @@ -0,0 +1,96 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface NetworkConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.NetworkConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the network for the TPU node. It must be a preexisting Google
+   * Compute Engine network. If none is provided, "default" will be used.
+   * 
+ * + * string network = 1; + * + * @return The network. + */ + java.lang.String getNetwork(); + /** + * + * + *
+   * The name of the network for the TPU node. It must be a preexisting Google
+   * Compute Engine network. If none is provided, "default" will be used.
+   * 
+ * + * string network = 1; + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); + + /** + * + * + *
+   * The name of the subnetwork for the TPU node. It must be a preexisting
+   * Google Compute Engine subnetwork. If none is provided, "default" will be
+   * used.
+   * 
+ * + * string subnetwork = 2; + * + * @return The subnetwork. + */ + java.lang.String getSubnetwork(); + /** + * + * + *
+   * The name of the subnetwork for the TPU node. It must be a preexisting
+   * Google Compute Engine subnetwork. If none is provided, "default" will be
+   * used.
+   * 
+ * + * string subnetwork = 2; + * + * @return The bytes for subnetwork. + */ + com.google.protobuf.ByteString getSubnetworkBytes(); + + /** + * + * + *
+   * Indicates that external IP addresses would be associated with the TPU
+   * workers. If set to false, the specified subnetwork or network should have
+   * Private Google Access enabled.
+   * 
+ * + * bool enable_external_ips = 3; + * + * @return The enableExternalIps. + */ + boolean getEnableExternalIps(); +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkEndpoint.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkEndpoint.java new file mode 100644 index 00000000..c3b4add0 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkEndpoint.java @@ -0,0 +1,1002 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * A network endpoint over which a TPU worker can be reached.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.NetworkEndpoint} + */ +public final class NetworkEndpoint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.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; + } + case 42: + { + com.google.cloud.tpu.v2alpha1.AccessConfig.Builder subBuilder = null; + if (accessConfig_ != null) { + subBuilder = accessConfig_.toBuilder(); + } + accessConfig_ = + input.readMessage( + com.google.cloud.tpu.v2alpha1.AccessConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(accessConfig_); + accessConfig_ = 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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_NetworkEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_NetworkEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.NetworkEndpoint.class, + com.google.cloud.tpu.v2alpha1.NetworkEndpoint.Builder.class); + } + + public static final int IP_ADDRESS_FIELD_NUMBER = 1; + private volatile java.lang.Object ipAddress_; + /** + * + * + *
+   * The internal 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 internal 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_; + } + + public static final int ACCESS_CONFIG_FIELD_NUMBER = 5; + private com.google.cloud.tpu.v2alpha1.AccessConfig accessConfig_; + /** + * + * + *
+   * The access config for the TPU worker.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.AccessConfig access_config = 5; + * + * @return Whether the accessConfig field is set. + */ + @java.lang.Override + public boolean hasAccessConfig() { + return accessConfig_ != null; + } + /** + * + * + *
+   * The access config for the TPU worker.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.AccessConfig access_config = 5; + * + * @return The accessConfig. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.AccessConfig getAccessConfig() { + return accessConfig_ == null + ? com.google.cloud.tpu.v2alpha1.AccessConfig.getDefaultInstance() + : accessConfig_; + } + /** + * + * + *
+   * The access config for the TPU worker.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.AccessConfig access_config = 5; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.AccessConfigOrBuilder getAccessConfigOrBuilder() { + return getAccessConfig(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipAddress_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ipAddress_); + } + if (port_ != 0) { + output.writeInt32(2, port_); + } + if (accessConfig_ != null) { + output.writeMessage(5, getAccessConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipAddress_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, ipAddress_); + } + if (port_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, port_); + } + if (accessConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getAccessConfig()); + } + 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.v2alpha1.NetworkEndpoint)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.NetworkEndpoint other = + (com.google.cloud.tpu.v2alpha1.NetworkEndpoint) obj; + + if (!getIpAddress().equals(other.getIpAddress())) return false; + if (getPort() != other.getPort()) return false; + if (hasAccessConfig() != other.hasAccessConfig()) return false; + if (hasAccessConfig()) { + if (!getAccessConfig().equals(other.getAccessConfig())) 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(); + if (hasAccessConfig()) { + hash = (37 * hash) + ACCESS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getAccessConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.NetworkEndpoint parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.NetworkEndpoint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.NetworkEndpoint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.NetworkEndpoint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.NetworkEndpoint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.NetworkEndpoint} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.NetworkEndpoint) + com.google.cloud.tpu.v2alpha1.NetworkEndpointOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_NetworkEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_NetworkEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.NetworkEndpoint.class, + com.google.cloud.tpu.v2alpha1.NetworkEndpoint.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.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; + + if (accessConfigBuilder_ == null) { + accessConfig_ = null; + } else { + accessConfig_ = null; + accessConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_NetworkEndpoint_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.NetworkEndpoint getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.NetworkEndpoint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.NetworkEndpoint build() { + com.google.cloud.tpu.v2alpha1.NetworkEndpoint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.NetworkEndpoint buildPartial() { + com.google.cloud.tpu.v2alpha1.NetworkEndpoint result = + new com.google.cloud.tpu.v2alpha1.NetworkEndpoint(this); + result.ipAddress_ = ipAddress_; + result.port_ = port_; + if (accessConfigBuilder_ == null) { + result.accessConfig_ = accessConfig_; + } else { + result.accessConfig_ = accessConfigBuilder_.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.v2alpha1.NetworkEndpoint) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.NetworkEndpoint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.NetworkEndpoint other) { + if (other == com.google.cloud.tpu.v2alpha1.NetworkEndpoint.getDefaultInstance()) return this; + if (!other.getIpAddress().isEmpty()) { + ipAddress_ = other.ipAddress_; + onChanged(); + } + if (other.getPort() != 0) { + setPort(other.getPort()); + } + if (other.hasAccessConfig()) { + mergeAccessConfig(other.getAccessConfig()); + } + 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.v2alpha1.NetworkEndpoint parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v2alpha1.NetworkEndpoint) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object ipAddress_ = ""; + /** + * + * + *
+     * The internal 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 internal 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 internal 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 internal 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 internal 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; + } + + private com.google.cloud.tpu.v2alpha1.AccessConfig accessConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.AccessConfig, + com.google.cloud.tpu.v2alpha1.AccessConfig.Builder, + com.google.cloud.tpu.v2alpha1.AccessConfigOrBuilder> + accessConfigBuilder_; + /** + * + * + *
+     * The access config for the TPU worker.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.AccessConfig access_config = 5; + * + * @return Whether the accessConfig field is set. + */ + public boolean hasAccessConfig() { + return accessConfigBuilder_ != null || accessConfig_ != null; + } + /** + * + * + *
+     * The access config for the TPU worker.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.AccessConfig access_config = 5; + * + * @return The accessConfig. + */ + public com.google.cloud.tpu.v2alpha1.AccessConfig getAccessConfig() { + if (accessConfigBuilder_ == null) { + return accessConfig_ == null + ? com.google.cloud.tpu.v2alpha1.AccessConfig.getDefaultInstance() + : accessConfig_; + } else { + return accessConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The access config for the TPU worker.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.AccessConfig access_config = 5; + */ + public Builder setAccessConfig(com.google.cloud.tpu.v2alpha1.AccessConfig value) { + if (accessConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + accessConfig_ = value; + onChanged(); + } else { + accessConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The access config for the TPU worker.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.AccessConfig access_config = 5; + */ + public Builder setAccessConfig( + com.google.cloud.tpu.v2alpha1.AccessConfig.Builder builderForValue) { + if (accessConfigBuilder_ == null) { + accessConfig_ = builderForValue.build(); + onChanged(); + } else { + accessConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The access config for the TPU worker.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.AccessConfig access_config = 5; + */ + public Builder mergeAccessConfig(com.google.cloud.tpu.v2alpha1.AccessConfig value) { + if (accessConfigBuilder_ == null) { + if (accessConfig_ != null) { + accessConfig_ = + com.google.cloud.tpu.v2alpha1.AccessConfig.newBuilder(accessConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + accessConfig_ = value; + } + onChanged(); + } else { + accessConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The access config for the TPU worker.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.AccessConfig access_config = 5; + */ + public Builder clearAccessConfig() { + if (accessConfigBuilder_ == null) { + accessConfig_ = null; + onChanged(); + } else { + accessConfig_ = null; + accessConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The access config for the TPU worker.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.AccessConfig access_config = 5; + */ + public com.google.cloud.tpu.v2alpha1.AccessConfig.Builder getAccessConfigBuilder() { + + onChanged(); + return getAccessConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The access config for the TPU worker.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.AccessConfig access_config = 5; + */ + public com.google.cloud.tpu.v2alpha1.AccessConfigOrBuilder getAccessConfigOrBuilder() { + if (accessConfigBuilder_ != null) { + return accessConfigBuilder_.getMessageOrBuilder(); + } else { + return accessConfig_ == null + ? com.google.cloud.tpu.v2alpha1.AccessConfig.getDefaultInstance() + : accessConfig_; + } + } + /** + * + * + *
+     * The access config for the TPU worker.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.AccessConfig access_config = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.AccessConfig, + com.google.cloud.tpu.v2alpha1.AccessConfig.Builder, + com.google.cloud.tpu.v2alpha1.AccessConfigOrBuilder> + getAccessConfigFieldBuilder() { + if (accessConfigBuilder_ == null) { + accessConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.AccessConfig, + com.google.cloud.tpu.v2alpha1.AccessConfig.Builder, + com.google.cloud.tpu.v2alpha1.AccessConfigOrBuilder>( + getAccessConfig(), getParentForChildren(), isClean()); + accessConfig_ = null; + } + return accessConfigBuilder_; + } + + @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.v2alpha1.NetworkEndpoint) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.NetworkEndpoint) + private static final com.google.cloud.tpu.v2alpha1.NetworkEndpoint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.NetworkEndpoint(); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.NetworkEndpoint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkEndpointOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkEndpointOrBuilder.java new file mode 100644 index 00000000..82c95167 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkEndpointOrBuilder.java @@ -0,0 +1,98 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface NetworkEndpointOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.NetworkEndpoint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The internal IP address of this network endpoint.
+   * 
+ * + * string ip_address = 1; + * + * @return The ipAddress. + */ + java.lang.String getIpAddress(); + /** + * + * + *
+   * The internal 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(); + + /** + * + * + *
+   * The access config for the TPU worker.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.AccessConfig access_config = 5; + * + * @return Whether the accessConfig field is set. + */ + boolean hasAccessConfig(); + /** + * + * + *
+   * The access config for the TPU worker.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.AccessConfig access_config = 5; + * + * @return The accessConfig. + */ + com.google.cloud.tpu.v2alpha1.AccessConfig getAccessConfig(); + /** + * + * + *
+   * The access config for the TPU worker.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.AccessConfig access_config = 5; + */ + com.google.cloud.tpu.v2alpha1.AccessConfigOrBuilder getAccessConfigOrBuilder(); +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/Node.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/Node.java new file mode 100644 index 00000000..91028088 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/Node.java @@ -0,0 +1,6651 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * A TPU instance.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.Node} + */ +public final class Node extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.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_ = ""; + state_ = 0; + healthDescription_ = ""; + runtimeVersion_ = ""; + cidrBlock_ = ""; + networkEndpoints_ = java.util.Collections.emptyList(); + health_ = 0; + tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + dataDisks_ = java.util.Collections.emptyList(); + 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 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(); + + runtimeVersion_ = s; + break; + } + case 106: + { + java.lang.String s = input.readStringRequireUtf8(); + + cidrBlock_ = 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.v2alpha1.SchedulingConfig.Builder subBuilder = null; + if (schedulingConfig_ != null) { + subBuilder = schedulingConfig_.toBuilder(); + } + schedulingConfig_ = + input.readMessage( + com.google.cloud.tpu.v2alpha1.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.v2alpha1.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 264: + { + id_ = input.readInt64(); + break; + } + case 274: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + metadata_ = + com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000004; + } + com.google.protobuf.MapEntry metadata__ = + input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + metadata_.getMutableMap().put(metadata__.getKey(), metadata__.getValue()); + break; + } + case 290: + { + com.google.cloud.tpu.v2alpha1.NetworkConfig.Builder subBuilder = null; + if (networkConfig_ != null) { + subBuilder = networkConfig_.toBuilder(); + } + networkConfig_ = + input.readMessage( + com.google.cloud.tpu.v2alpha1.NetworkConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(networkConfig_); + networkConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 298: + { + com.google.cloud.tpu.v2alpha1.ServiceAccount.Builder subBuilder = null; + if (serviceAccount_ != null) { + subBuilder = serviceAccount_.toBuilder(); + } + serviceAccount_ = + input.readMessage( + com.google.cloud.tpu.v2alpha1.ServiceAccount.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceAccount_); + serviceAccount_ = subBuilder.buildPartial(); + } + + break; + } + case 304: + { + int rawValue = input.readEnum(); + + apiVersion_ = rawValue; + break; + } + case 314: + { + if (!((mutable_bitField0_ & 0x00000020) != 0)) { + symptoms_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + symptoms_.add( + input.readMessage( + com.google.cloud.tpu.v2alpha1.Symptom.parser(), extensionRegistry)); + break; + } + case 322: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + tags_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000008; + } + tags_.add(s); + break; + } + case 330: + { + if (!((mutable_bitField0_ & 0x00000010) != 0)) { + dataDisks_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + dataDisks_.add( + input.readMessage( + com.google.cloud.tpu.v2alpha1.AttachedDisk.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_ & 0x00000020) != 0)) { + symptoms_ = java.util.Collections.unmodifiableList(symptoms_); + } + if (((mutable_bitField0_ & 0x00000008) != 0)) { + tags_ = tags_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000010) != 0)) { + dataDisks_ = java.util.Collections.unmodifiableList(dataDisks_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_Node_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 24: + return internalGetLabels(); + case 34: + return internalGetMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_Node_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.Node.class, + com.google.cloud.tpu.v2alpha1.Node.Builder.class); + } + + /** + * + * + *
+   * Represents the different states of a TPU node during its lifecycle.
+   * 
+ * + * Protobuf enum {@code google.cloud.tpu.v2alpha1.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.
+     * 
+ * + * 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.
+     * 
+ * + * 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.v2alpha1.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.v2alpha1.Node.State) + } + + /** + * + * + *
+   * Health defines the status of a TPU node as reported by
+   * Health Monitor.
+   * 
+ * + * Protobuf enum {@code google.cloud.tpu.v2alpha1.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 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 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 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.v2alpha1.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.v2alpha1.Node.Health) + } + + /** + * + * + *
+   * TPU API Version.
+   * 
+ * + * Protobuf enum {@code google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Immutable. The name of the TPU.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int 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 STATE_FIELD_NUMBER = 9; + private int state_; + /** + * + * + *
+   * Output only. The current state for the TPU Node.
+   * 
+ * + * + * .google.cloud.tpu.v2alpha1.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.v2alpha1.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.Node.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v2alpha1.Node.State result = + com.google.cloud.tpu.v2alpha1.Node.State.valueOf(state_); + return result == null ? com.google.cloud.tpu.v2alpha1.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 RUNTIME_VERSION_FIELD_NUMBER = 11; + private volatile java.lang.Object runtimeVersion_; + /** + * + * + *
+   * Required. The runtime version running in the Node.
+   * 
+ * + * string runtime_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The runtimeVersion. + */ + @java.lang.Override + public java.lang.String getRuntimeVersion() { + java.lang.Object ref = runtimeVersion_; + 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(); + runtimeVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The runtime version running in the Node.
+   * 
+ * + * string runtime_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for runtimeVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRuntimeVersionBytes() { + java.lang.Object ref = runtimeVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + runtimeVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NETWORK_CONFIG_FIELD_NUMBER = 36; + private com.google.cloud.tpu.v2alpha1.NetworkConfig networkConfig_; + /** + * + * + *
+   * Network configurations for the TPU node.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.NetworkConfig network_config = 36; + * + * @return Whether the networkConfig field is set. + */ + @java.lang.Override + public boolean hasNetworkConfig() { + return networkConfig_ != null; + } + /** + * + * + *
+   * Network configurations for the TPU node.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.NetworkConfig network_config = 36; + * + * @return The networkConfig. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.NetworkConfig getNetworkConfig() { + return networkConfig_ == null + ? com.google.cloud.tpu.v2alpha1.NetworkConfig.getDefaultInstance() + : networkConfig_; + } + /** + * + * + *
+   * Network configurations for the TPU node.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.NetworkConfig network_config = 36; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.NetworkConfigOrBuilder getNetworkConfigOrBuilder() { + return getNetworkConfig(); + } + + 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 = 37; + private com.google.cloud.tpu.v2alpha1.ServiceAccount serviceAccount_; + /** + * + * + *
+   * The Google Cloud Platform Service Account to be used by the TPU node VMs.
+   * If None is specified, the default compute service account will be used.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceAccount service_account = 37; + * + * @return Whether the serviceAccount field is set. + */ + @java.lang.Override + public boolean hasServiceAccount() { + return serviceAccount_ != null; + } + /** + * + * + *
+   * The Google Cloud Platform Service Account to be used by the TPU node VMs.
+   * If None is specified, the default compute service account will be used.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceAccount service_account = 37; + * + * @return The serviceAccount. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ServiceAccount getServiceAccount() { + return serviceAccount_ == null + ? com.google.cloud.tpu.v2alpha1.ServiceAccount.getDefaultInstance() + : serviceAccount_; + } + /** + * + * + *
+   * The Google Cloud Platform Service Account to be used by the TPU node VMs.
+   * If None is specified, the default compute service account will be used.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceAccount service_account = 37; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ServiceAccountOrBuilder getServiceAccountOrBuilder() { + return getServiceAccount(); + } + + 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.v2alpha1.SchedulingConfig schedulingConfig_; + /** + * + * + *
+   * The scheduling options for this node.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.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.v2alpha1.SchedulingConfig scheduling_config = 17; + * + * @return The schedulingConfig. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.SchedulingConfig getSchedulingConfig() { + return schedulingConfig_ == null + ? com.google.cloud.tpu.v2alpha1.SchedulingConfig.getDefaultInstance() + : schedulingConfig_; + } + /** + * + * + *
+   * The scheduling options for this node.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.SchedulingConfig scheduling_config = 17; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.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 runtime clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.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 runtime clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.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 runtime clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.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 runtime clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.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 runtime clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.Node.Health health = 22; + * + * @return The health. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.Node.Health getHealth() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v2alpha1.Node.Health result = + com.google.cloud.tpu.v2alpha1.Node.Health.valueOf(health_); + return result == null ? com.google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_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 METADATA_FIELD_NUMBER = 34; + + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_Node_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField metadata_; + + private com.google.protobuf.MapField internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + * + * + *
+   * Custom metadata to apply to the TPU Node.
+   * Can set startup-script and shutdown-script
+   * 
+ * + * map<string, string> metadata = 34; + */ + @java.lang.Override + public boolean containsMetadata(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetMetadata().getMap().containsKey(key); + } + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + * + * + *
+   * Custom metadata to apply to the TPU Node.
+   * Can set startup-script and shutdown-script
+   * 
+ * + * map<string, string> metadata = 34; + */ + @java.lang.Override + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + * + * + *
+   * Custom metadata to apply to the TPU Node.
+   * Can set startup-script and shutdown-script
+   * 
+ * + * map<string, string> metadata = 34; + */ + @java.lang.Override + public java.lang.String getMetadataOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Custom metadata to apply to the TPU Node.
+   * Can set startup-script and shutdown-script
+   * 
+ * + * map<string, string> metadata = 34; + */ + @java.lang.Override + public java.lang.String getMetadataOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int TAGS_FIELD_NUMBER = 40; + private com.google.protobuf.LazyStringList tags_; + /** + * + * + *
+   * Tags to apply to the TPU Node. Tags are used to identify valid sources or
+   * targets for network firewalls.
+   * 
+ * + * repeated string tags = 40; + * + * @return A list containing the tags. + */ + public com.google.protobuf.ProtocolStringList getTagsList() { + return tags_; + } + /** + * + * + *
+   * Tags to apply to the TPU Node. Tags are used to identify valid sources or
+   * targets for network firewalls.
+   * 
+ * + * repeated string tags = 40; + * + * @return The count of tags. + */ + public int getTagsCount() { + return tags_.size(); + } + /** + * + * + *
+   * Tags to apply to the TPU Node. Tags are used to identify valid sources or
+   * targets for network firewalls.
+   * 
+ * + * repeated string tags = 40; + * + * @param index The index of the element to return. + * @return The tags at the given index. + */ + public java.lang.String getTags(int index) { + return tags_.get(index); + } + /** + * + * + *
+   * Tags to apply to the TPU Node. Tags are used to identify valid sources or
+   * targets for network firewalls.
+   * 
+ * + * repeated string tags = 40; + * + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + public com.google.protobuf.ByteString getTagsBytes(int index) { + return tags_.getByteString(index); + } + + public static final int ID_FIELD_NUMBER = 33; + private long id_; + /** + * + * + *
+   * Output only. The unique identifier for the TPU Node.
+   * 
+ * + * int64 id = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + public static final int DATA_DISKS_FIELD_NUMBER = 41; + private java.util.List dataDisks_; + /** + * + * + *
+   * The additional data disks for the Node.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + @java.lang.Override + public java.util.List getDataDisksList() { + return dataDisks_; + } + /** + * + * + *
+   * The additional data disks for the Node.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + @java.lang.Override + public java.util.List + getDataDisksOrBuilderList() { + return dataDisks_; + } + /** + * + * + *
+   * The additional data disks for the Node.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + @java.lang.Override + public int getDataDisksCount() { + return dataDisks_.size(); + } + /** + * + * + *
+   * The additional data disks for the Node.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.AttachedDisk getDataDisks(int index) { + return dataDisks_.get(index); + } + /** + * + * + *
+   * The additional data disks for the Node.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.AttachedDiskOrBuilder getDataDisksOrBuilder(int index) { + return dataDisks_.get(index); + } + + public static final int API_VERSION_FIELD_NUMBER = 38; + private int apiVersion_; + /** + * + * + *
+   * Output only. The API version that created this Node.
+   * 
+ * + * + * .google.cloud.tpu.v2alpha1.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.v2alpha1.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The apiVersion. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.Node.ApiVersion getApiVersion() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v2alpha1.Node.ApiVersion result = + com.google.cloud.tpu.v2alpha1.Node.ApiVersion.valueOf(apiVersion_); + return result == null ? com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.Symptom getSymptoms(int index) { + return symptoms_.get(index); + } + /** + * + * + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(acceleratorType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, acceleratorType_); + } + if (state_ != com.google.cloud.tpu.v2alpha1.Node.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(9, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(healthDescription_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, healthDescription_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(runtimeVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, runtimeVersion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cidrBlock_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, cidrBlock_); + } + 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.v2alpha1.Node.Health.HEALTH_UNSPECIFIED.getNumber()) { + output.writeEnum(22, health_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 24); + if (id_ != 0L) { + output.writeInt64(33, id_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetMetadata(), MetadataDefaultEntryHolder.defaultEntry, 34); + if (networkConfig_ != null) { + output.writeMessage(36, getNetworkConfig()); + } + if (serviceAccount_ != null) { + output.writeMessage(37, getServiceAccount()); + } + if (apiVersion_ + != com.google.cloud.tpu.v2alpha1.Node.ApiVersion.API_VERSION_UNSPECIFIED.getNumber()) { + output.writeEnum(38, apiVersion_); + } + for (int i = 0; i < symptoms_.size(); i++) { + output.writeMessage(39, symptoms_.get(i)); + } + for (int i = 0; i < tags_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 40, tags_.getRaw(i)); + } + for (int i = 0; i < dataDisks_.size(); i++) { + output.writeMessage(41, dataDisks_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(acceleratorType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, acceleratorType_); + } + if (state_ != com.google.cloud.tpu.v2alpha1.Node.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(healthDescription_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, healthDescription_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(runtimeVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, runtimeVersion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cidrBlock_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, cidrBlock_); + } + 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.v2alpha1.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 (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(33, id_); + } + for (java.util.Map.Entry entry : + internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry metadata__ = + MetadataDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(34, metadata__); + } + if (networkConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(36, getNetworkConfig()); + } + if (serviceAccount_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(37, getServiceAccount()); + } + if (apiVersion_ + != com.google.cloud.tpu.v2alpha1.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)); + } + { + int dataSize = 0; + for (int i = 0; i < tags_.size(); i++) { + dataSize += computeStringSizeNoTag(tags_.getRaw(i)); + } + size += dataSize; + size += 2 * getTagsList().size(); + } + for (int i = 0; i < dataDisks_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(41, dataDisks_.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.v2alpha1.Node)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.Node other = (com.google.cloud.tpu.v2alpha1.Node) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getAcceleratorType().equals(other.getAcceleratorType())) return false; + if (state_ != other.state_) return false; + if (!getHealthDescription().equals(other.getHealthDescription())) return false; + if (!getRuntimeVersion().equals(other.getRuntimeVersion())) return false; + if (hasNetworkConfig() != other.hasNetworkConfig()) return false; + if (hasNetworkConfig()) { + if (!getNetworkConfig().equals(other.getNetworkConfig())) return false; + } + if (!getCidrBlock().equals(other.getCidrBlock())) return false; + if (hasServiceAccount() != other.hasServiceAccount()) return false; + if (hasServiceAccount()) { + 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 (!internalGetMetadata().equals(other.internalGetMetadata())) return false; + if (!getTagsList().equals(other.getTagsList())) return false; + if (getId() != other.getId()) return false; + if (!getDataDisksList().equals(other.getDataDisksList())) 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) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + HEALTH_DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getHealthDescription().hashCode(); + hash = (37 * hash) + RUNTIME_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getRuntimeVersion().hashCode(); + if (hasNetworkConfig()) { + hash = (37 * hash) + NETWORK_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getNetworkConfig().hashCode(); + } + hash = (37 * hash) + CIDR_BLOCK_FIELD_NUMBER; + hash = (53 * hash) + getCidrBlock().hashCode(); + if (hasServiceAccount()) { + 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(); + } + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + if (getTagsCount() > 0) { + hash = (37 * hash) + TAGS_FIELD_NUMBER; + hash = (53 * hash) + getTagsList().hashCode(); + } + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getId()); + if (getDataDisksCount() > 0) { + hash = (37 * hash) + DATA_DISKS_FIELD_NUMBER; + hash = (53 * hash) + getDataDisksList().hashCode(); + } + 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.v2alpha1.Node parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.Node parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.Node parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.Node parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.Node parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.Node} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.Node) + com.google.cloud.tpu.v2alpha1.NodeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_Node_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 24: + return internalGetLabels(); + case 34: + return internalGetMetadata(); + 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(); + case 34: + return internalGetMutableMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_Node_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.Node.class, + com.google.cloud.tpu.v2alpha1.Node.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.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(); + getDataDisksFieldBuilder(); + getSymptomsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + description_ = ""; + + acceleratorType_ = ""; + + state_ = 0; + + healthDescription_ = ""; + + runtimeVersion_ = ""; + + if (networkConfigBuilder_ == null) { + networkConfig_ = null; + } else { + networkConfig_ = null; + networkConfigBuilder_ = null; + } + cidrBlock_ = ""; + + if (serviceAccountBuilder_ == null) { + serviceAccount_ = null; + } else { + serviceAccount_ = null; + serviceAccountBuilder_ = null; + } + 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(); + internalGetMutableMetadata().clear(); + tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + id_ = 0L; + + if (dataDisksBuilder_ == null) { + dataDisks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + } else { + dataDisksBuilder_.clear(); + } + apiVersion_ = 0; + + if (symptomsBuilder_ == null) { + symptoms_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + } else { + symptomsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_Node_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.Node getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.Node.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.Node build() { + com.google.cloud.tpu.v2alpha1.Node result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.Node buildPartial() { + com.google.cloud.tpu.v2alpha1.Node result = new com.google.cloud.tpu.v2alpha1.Node(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.description_ = description_; + result.acceleratorType_ = acceleratorType_; + result.state_ = state_; + result.healthDescription_ = healthDescription_; + result.runtimeVersion_ = runtimeVersion_; + if (networkConfigBuilder_ == null) { + result.networkConfig_ = networkConfig_; + } else { + result.networkConfig_ = networkConfigBuilder_.build(); + } + result.cidrBlock_ = cidrBlock_; + if (serviceAccountBuilder_ == null) { + result.serviceAccount_ = serviceAccount_; + } else { + result.serviceAccount_ = serviceAccountBuilder_.build(); + } + 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.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + if (((bitField0_ & 0x00000008) != 0)) { + tags_ = tags_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.tags_ = tags_; + result.id_ = id_; + if (dataDisksBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + dataDisks_ = java.util.Collections.unmodifiableList(dataDisks_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.dataDisks_ = dataDisks_; + } else { + result.dataDisks_ = dataDisksBuilder_.build(); + } + result.apiVersion_ = apiVersion_; + if (symptomsBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + symptoms_ = java.util.Collections.unmodifiableList(symptoms_); + bitField0_ = (bitField0_ & ~0x00000020); + } + 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.v2alpha1.Node) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.Node) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.Node other) { + if (other == com.google.cloud.tpu.v2alpha1.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.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getHealthDescription().isEmpty()) { + healthDescription_ = other.healthDescription_; + onChanged(); + } + if (!other.getRuntimeVersion().isEmpty()) { + runtimeVersion_ = other.runtimeVersion_; + onChanged(); + } + if (other.hasNetworkConfig()) { + mergeNetworkConfig(other.getNetworkConfig()); + } + if (!other.getCidrBlock().isEmpty()) { + cidrBlock_ = other.cidrBlock_; + onChanged(); + } + if (other.hasServiceAccount()) { + mergeServiceAccount(other.getServiceAccount()); + } + 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()); + internalGetMutableMetadata().mergeFrom(other.internalGetMetadata()); + if (!other.tags_.isEmpty()) { + if (tags_.isEmpty()) { + tags_ = other.tags_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureTagsIsMutable(); + tags_.addAll(other.tags_); + } + onChanged(); + } + if (other.getId() != 0L) { + setId(other.getId()); + } + if (dataDisksBuilder_ == null) { + if (!other.dataDisks_.isEmpty()) { + if (dataDisks_.isEmpty()) { + dataDisks_ = other.dataDisks_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureDataDisksIsMutable(); + dataDisks_.addAll(other.dataDisks_); + } + onChanged(); + } + } else { + if (!other.dataDisks_.isEmpty()) { + if (dataDisksBuilder_.isEmpty()) { + dataDisksBuilder_.dispose(); + dataDisksBuilder_ = null; + dataDisks_ = other.dataDisks_; + bitField0_ = (bitField0_ & ~0x00000010); + dataDisksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDataDisksFieldBuilder() + : null; + } else { + dataDisksBuilder_.addAllMessages(other.dataDisks_); + } + } + } + if (other.apiVersion_ != 0) { + setApiVersionValue(other.getApiVersionValue()); + } + if (symptomsBuilder_ == null) { + if (!other.symptoms_.isEmpty()) { + if (symptoms_.isEmpty()) { + symptoms_ = other.symptoms_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureSymptomsIsMutable(); + symptoms_.addAll(other.symptoms_); + } + onChanged(); + } + } else { + if (!other.symptoms_.isEmpty()) { + if (symptomsBuilder_.isEmpty()) { + symptomsBuilder_.dispose(); + symptomsBuilder_ = null; + symptoms_ = other.symptoms_; + bitField0_ = (bitField0_ & ~0x00000020); + 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.v2alpha1.Node parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v2alpha1.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) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. The name of the TPU.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. The name of the TPU.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. The name of the TPU.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object 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 int state_ = 0; + /** + * + * + *
+     * Output only. The current state for the TPU Node.
+     * 
+ * + * + * .google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.Node.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v2alpha1.Node.State result = + com.google.cloud.tpu.v2alpha1.Node.State.valueOf(state_); + return result == null ? com.google.cloud.tpu.v2alpha1.Node.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The current state for the TPU Node.
+     * 
+ * + * + * .google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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 runtimeVersion_ = ""; + /** + * + * + *
+     * Required. The runtime version running in the Node.
+     * 
+ * + * string runtime_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The runtimeVersion. + */ + public java.lang.String getRuntimeVersion() { + java.lang.Object ref = runtimeVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + runtimeVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The runtime version running in the Node.
+     * 
+ * + * string runtime_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for runtimeVersion. + */ + public com.google.protobuf.ByteString getRuntimeVersionBytes() { + java.lang.Object ref = runtimeVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + runtimeVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The runtime version running in the Node.
+     * 
+ * + * string runtime_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The runtimeVersion to set. + * @return This builder for chaining. + */ + public Builder setRuntimeVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + runtimeVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The runtime version running in the Node.
+     * 
+ * + * string runtime_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearRuntimeVersion() { + + runtimeVersion_ = getDefaultInstance().getRuntimeVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The runtime version running in the Node.
+     * 
+ * + * string runtime_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for runtimeVersion to set. + * @return This builder for chaining. + */ + public Builder setRuntimeVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + runtimeVersion_ = value; + onChanged(); + return this; + } + + private com.google.cloud.tpu.v2alpha1.NetworkConfig networkConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.NetworkConfig, + com.google.cloud.tpu.v2alpha1.NetworkConfig.Builder, + com.google.cloud.tpu.v2alpha1.NetworkConfigOrBuilder> + networkConfigBuilder_; + /** + * + * + *
+     * Network configurations for the TPU node.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.NetworkConfig network_config = 36; + * + * @return Whether the networkConfig field is set. + */ + public boolean hasNetworkConfig() { + return networkConfigBuilder_ != null || networkConfig_ != null; + } + /** + * + * + *
+     * Network configurations for the TPU node.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.NetworkConfig network_config = 36; + * + * @return The networkConfig. + */ + public com.google.cloud.tpu.v2alpha1.NetworkConfig getNetworkConfig() { + if (networkConfigBuilder_ == null) { + return networkConfig_ == null + ? com.google.cloud.tpu.v2alpha1.NetworkConfig.getDefaultInstance() + : networkConfig_; + } else { + return networkConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Network configurations for the TPU node.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.NetworkConfig network_config = 36; + */ + public Builder setNetworkConfig(com.google.cloud.tpu.v2alpha1.NetworkConfig value) { + if (networkConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + networkConfig_ = value; + onChanged(); + } else { + networkConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Network configurations for the TPU node.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.NetworkConfig network_config = 36; + */ + public Builder setNetworkConfig( + com.google.cloud.tpu.v2alpha1.NetworkConfig.Builder builderForValue) { + if (networkConfigBuilder_ == null) { + networkConfig_ = builderForValue.build(); + onChanged(); + } else { + networkConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Network configurations for the TPU node.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.NetworkConfig network_config = 36; + */ + public Builder mergeNetworkConfig(com.google.cloud.tpu.v2alpha1.NetworkConfig value) { + if (networkConfigBuilder_ == null) { + if (networkConfig_ != null) { + networkConfig_ = + com.google.cloud.tpu.v2alpha1.NetworkConfig.newBuilder(networkConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + networkConfig_ = value; + } + onChanged(); + } else { + networkConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Network configurations for the TPU node.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.NetworkConfig network_config = 36; + */ + public Builder clearNetworkConfig() { + if (networkConfigBuilder_ == null) { + networkConfig_ = null; + onChanged(); + } else { + networkConfig_ = null; + networkConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Network configurations for the TPU node.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.NetworkConfig network_config = 36; + */ + public com.google.cloud.tpu.v2alpha1.NetworkConfig.Builder getNetworkConfigBuilder() { + + onChanged(); + return getNetworkConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Network configurations for the TPU node.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.NetworkConfig network_config = 36; + */ + public com.google.cloud.tpu.v2alpha1.NetworkConfigOrBuilder getNetworkConfigOrBuilder() { + if (networkConfigBuilder_ != null) { + return networkConfigBuilder_.getMessageOrBuilder(); + } else { + return networkConfig_ == null + ? com.google.cloud.tpu.v2alpha1.NetworkConfig.getDefaultInstance() + : networkConfig_; + } + } + /** + * + * + *
+     * Network configurations for the TPU node.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.NetworkConfig network_config = 36; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.NetworkConfig, + com.google.cloud.tpu.v2alpha1.NetworkConfig.Builder, + com.google.cloud.tpu.v2alpha1.NetworkConfigOrBuilder> + getNetworkConfigFieldBuilder() { + if (networkConfigBuilder_ == null) { + networkConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.NetworkConfig, + com.google.cloud.tpu.v2alpha1.NetworkConfig.Builder, + com.google.cloud.tpu.v2alpha1.NetworkConfigOrBuilder>( + getNetworkConfig(), getParentForChildren(), isClean()); + networkConfig_ = null; + } + return networkConfigBuilder_; + } + + 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 com.google.cloud.tpu.v2alpha1.ServiceAccount serviceAccount_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.ServiceAccount, + com.google.cloud.tpu.v2alpha1.ServiceAccount.Builder, + com.google.cloud.tpu.v2alpha1.ServiceAccountOrBuilder> + serviceAccountBuilder_; + /** + * + * + *
+     * The Google Cloud Platform Service Account to be used by the TPU node VMs.
+     * If None is specified, the default compute service account will be used.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceAccount service_account = 37; + * + * @return Whether the serviceAccount field is set. + */ + public boolean hasServiceAccount() { + return serviceAccountBuilder_ != null || serviceAccount_ != null; + } + /** + * + * + *
+     * The Google Cloud Platform Service Account to be used by the TPU node VMs.
+     * If None is specified, the default compute service account will be used.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceAccount service_account = 37; + * + * @return The serviceAccount. + */ + public com.google.cloud.tpu.v2alpha1.ServiceAccount getServiceAccount() { + if (serviceAccountBuilder_ == null) { + return serviceAccount_ == null + ? com.google.cloud.tpu.v2alpha1.ServiceAccount.getDefaultInstance() + : serviceAccount_; + } else { + return serviceAccountBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The Google Cloud Platform Service Account to be used by the TPU node VMs.
+     * If None is specified, the default compute service account will be used.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceAccount service_account = 37; + */ + public Builder setServiceAccount(com.google.cloud.tpu.v2alpha1.ServiceAccount value) { + if (serviceAccountBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceAccount_ = value; + onChanged(); + } else { + serviceAccountBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The Google Cloud Platform Service Account to be used by the TPU node VMs.
+     * If None is specified, the default compute service account will be used.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceAccount service_account = 37; + */ + public Builder setServiceAccount( + com.google.cloud.tpu.v2alpha1.ServiceAccount.Builder builderForValue) { + if (serviceAccountBuilder_ == null) { + serviceAccount_ = builderForValue.build(); + onChanged(); + } else { + serviceAccountBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The Google Cloud Platform Service Account to be used by the TPU node VMs.
+     * If None is specified, the default compute service account will be used.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceAccount service_account = 37; + */ + public Builder mergeServiceAccount(com.google.cloud.tpu.v2alpha1.ServiceAccount value) { + if (serviceAccountBuilder_ == null) { + if (serviceAccount_ != null) { + serviceAccount_ = + com.google.cloud.tpu.v2alpha1.ServiceAccount.newBuilder(serviceAccount_) + .mergeFrom(value) + .buildPartial(); + } else { + serviceAccount_ = value; + } + onChanged(); + } else { + serviceAccountBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The Google Cloud Platform Service Account to be used by the TPU node VMs.
+     * If None is specified, the default compute service account will be used.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceAccount service_account = 37; + */ + public Builder clearServiceAccount() { + if (serviceAccountBuilder_ == null) { + serviceAccount_ = null; + onChanged(); + } else { + serviceAccount_ = null; + serviceAccountBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The Google Cloud Platform Service Account to be used by the TPU node VMs.
+     * If None is specified, the default compute service account will be used.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceAccount service_account = 37; + */ + public com.google.cloud.tpu.v2alpha1.ServiceAccount.Builder getServiceAccountBuilder() { + + onChanged(); + return getServiceAccountFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Google Cloud Platform Service Account to be used by the TPU node VMs.
+     * If None is specified, the default compute service account will be used.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceAccount service_account = 37; + */ + public com.google.cloud.tpu.v2alpha1.ServiceAccountOrBuilder getServiceAccountOrBuilder() { + if (serviceAccountBuilder_ != null) { + return serviceAccountBuilder_.getMessageOrBuilder(); + } else { + return serviceAccount_ == null + ? com.google.cloud.tpu.v2alpha1.ServiceAccount.getDefaultInstance() + : serviceAccount_; + } + } + /** + * + * + *
+     * The Google Cloud Platform Service Account to be used by the TPU node VMs.
+     * If None is specified, the default compute service account will be used.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceAccount service_account = 37; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.ServiceAccount, + com.google.cloud.tpu.v2alpha1.ServiceAccount.Builder, + com.google.cloud.tpu.v2alpha1.ServiceAccountOrBuilder> + getServiceAccountFieldBuilder() { + if (serviceAccountBuilder_ == null) { + serviceAccountBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.ServiceAccount, + com.google.cloud.tpu.v2alpha1.ServiceAccount.Builder, + com.google.cloud.tpu.v2alpha1.ServiceAccountOrBuilder>( + getServiceAccount(), getParentForChildren(), isClean()); + serviceAccount_ = null; + } + return serviceAccountBuilder_; + } + + 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.v2alpha1.SchedulingConfig schedulingConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.SchedulingConfig, + com.google.cloud.tpu.v2alpha1.SchedulingConfig.Builder, + com.google.cloud.tpu.v2alpha1.SchedulingConfigOrBuilder> + schedulingConfigBuilder_; + /** + * + * + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.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.v2alpha1.SchedulingConfig scheduling_config = 17; + * + * @return The schedulingConfig. + */ + public com.google.cloud.tpu.v2alpha1.SchedulingConfig getSchedulingConfig() { + if (schedulingConfigBuilder_ == null) { + return schedulingConfig_ == null + ? com.google.cloud.tpu.v2alpha1.SchedulingConfig.getDefaultInstance() + : schedulingConfig_; + } else { + return schedulingConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.SchedulingConfig scheduling_config = 17; + */ + public Builder setSchedulingConfig(com.google.cloud.tpu.v2alpha1.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.v2alpha1.SchedulingConfig scheduling_config = 17; + */ + public Builder setSchedulingConfig( + com.google.cloud.tpu.v2alpha1.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.v2alpha1.SchedulingConfig scheduling_config = 17; + */ + public Builder mergeSchedulingConfig(com.google.cloud.tpu.v2alpha1.SchedulingConfig value) { + if (schedulingConfigBuilder_ == null) { + if (schedulingConfig_ != null) { + schedulingConfig_ = + com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.SchedulingConfig scheduling_config = 17; + */ + public com.google.cloud.tpu.v2alpha1.SchedulingConfig.Builder getSchedulingConfigBuilder() { + + onChanged(); + return getSchedulingConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.SchedulingConfig scheduling_config = 17; + */ + public com.google.cloud.tpu.v2alpha1.SchedulingConfigOrBuilder getSchedulingConfigOrBuilder() { + if (schedulingConfigBuilder_ != null) { + return schedulingConfigBuilder_.getMessageOrBuilder(); + } else { + return schedulingConfig_ == null + ? com.google.cloud.tpu.v2alpha1.SchedulingConfig.getDefaultInstance() + : schedulingConfig_; + } + } + /** + * + * + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.SchedulingConfig scheduling_config = 17; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.SchedulingConfig, + com.google.cloud.tpu.v2alpha1.SchedulingConfig.Builder, + com.google.cloud.tpu.v2alpha1.SchedulingConfigOrBuilder> + getSchedulingConfigFieldBuilder() { + if (schedulingConfigBuilder_ == null) { + schedulingConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.SchedulingConfig, + com.google.cloud.tpu.v2alpha1.SchedulingConfig.Builder, + com.google.cloud.tpu.v2alpha1.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.v2alpha1.NetworkEndpoint, + com.google.cloud.tpu.v2alpha1.NetworkEndpoint.Builder, + com.google.cloud.tpu.v2alpha1.NetworkEndpointOrBuilder> + networkEndpointsBuilder_; + + /** + * + * + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that runtime clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.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 runtime clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.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 runtime clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v2alpha1.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 runtime clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNetworkEndpoints( + int index, com.google.cloud.tpu.v2alpha1.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 runtime clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNetworkEndpoints( + int index, com.google.cloud.tpu.v2alpha1.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 runtime clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNetworkEndpoints(com.google.cloud.tpu.v2alpha1.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 runtime clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNetworkEndpoints( + int index, com.google.cloud.tpu.v2alpha1.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 runtime clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNetworkEndpoints( + com.google.cloud.tpu.v2alpha1.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 runtime clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNetworkEndpoints( + int index, com.google.cloud.tpu.v2alpha1.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 runtime clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.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 runtime clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.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 runtime clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.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 runtime clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v2alpha1.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 runtime clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v2alpha1.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 runtime clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.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 runtime clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v2alpha1.NetworkEndpoint.Builder addNetworkEndpointsBuilder() { + return getNetworkEndpointsFieldBuilder() + .addBuilder(com.google.cloud.tpu.v2alpha1.NetworkEndpoint.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that runtime clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v2alpha1.NetworkEndpoint.Builder addNetworkEndpointsBuilder( + int index) { + return getNetworkEndpointsFieldBuilder() + .addBuilder(index, com.google.cloud.tpu.v2alpha1.NetworkEndpoint.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that runtime clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.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.v2alpha1.NetworkEndpoint, + com.google.cloud.tpu.v2alpha1.NetworkEndpoint.Builder, + com.google.cloud.tpu.v2alpha1.NetworkEndpointOrBuilder> + getNetworkEndpointsFieldBuilder() { + if (networkEndpointsBuilder_ == null) { + networkEndpointsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.NetworkEndpoint, + com.google.cloud.tpu.v2alpha1.NetworkEndpoint.Builder, + com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.Node.Health health = 22; + * + * @return The health. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.Node.Health getHealth() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v2alpha1.Node.Health result = + com.google.cloud.tpu.v2alpha1.Node.Health.valueOf(health_); + return result == null ? com.google.cloud.tpu.v2alpha1.Node.Health.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The health status of the TPU node.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.Node.Health health = 22; + * + * @param value The health to set. + * @return This builder for chaining. + */ + public Builder setHealth(com.google.cloud.tpu.v2alpha1.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.v2alpha1.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 com.google.protobuf.MapField metadata_; + + private com.google.protobuf.MapField internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged(); + ; + if (metadata_ == null) { + metadata_ = + com.google.protobuf.MapField.newMapField(MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + * + * + *
+     * Custom metadata to apply to the TPU Node.
+     * Can set startup-script and shutdown-script
+     * 
+ * + * map<string, string> metadata = 34; + */ + @java.lang.Override + public boolean containsMetadata(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetMetadata().getMap().containsKey(key); + } + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + * + * + *
+     * Custom metadata to apply to the TPU Node.
+     * Can set startup-script and shutdown-script
+     * 
+ * + * map<string, string> metadata = 34; + */ + @java.lang.Override + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + * + * + *
+     * Custom metadata to apply to the TPU Node.
+     * Can set startup-script and shutdown-script
+     * 
+ * + * map<string, string> metadata = 34; + */ + @java.lang.Override + public java.lang.String getMetadataOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Custom metadata to apply to the TPU Node.
+     * Can set startup-script and shutdown-script
+     * 
+ * + * map<string, string> metadata = 34; + */ + @java.lang.Override + public java.lang.String getMetadataOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Custom metadata to apply to the TPU Node.
+     * Can set startup-script and shutdown-script
+     * 
+ * + * map<string, string> metadata = 34; + */ + public Builder removeMetadata(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableMetadata().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + * + * + *
+     * Custom metadata to apply to the TPU Node.
+     * Can set startup-script and shutdown-script
+     * 
+ * + * map<string, string> metadata = 34; + */ + public Builder putMetadata(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableMetadata().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Custom metadata to apply to the TPU Node.
+     * Can set startup-script and shutdown-script
+     * 
+ * + * map<string, string> metadata = 34; + */ + public Builder putAllMetadata(java.util.Map values) { + internalGetMutableMetadata().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.LazyStringList tags_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureTagsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + tags_ = new com.google.protobuf.LazyStringArrayList(tags_); + bitField0_ |= 0x00000008; + } + } + /** + * + * + *
+     * Tags to apply to the TPU Node. Tags are used to identify valid sources or
+     * targets for network firewalls.
+     * 
+ * + * repeated string tags = 40; + * + * @return A list containing the tags. + */ + public com.google.protobuf.ProtocolStringList getTagsList() { + return tags_.getUnmodifiableView(); + } + /** + * + * + *
+     * Tags to apply to the TPU Node. Tags are used to identify valid sources or
+     * targets for network firewalls.
+     * 
+ * + * repeated string tags = 40; + * + * @return The count of tags. + */ + public int getTagsCount() { + return tags_.size(); + } + /** + * + * + *
+     * Tags to apply to the TPU Node. Tags are used to identify valid sources or
+     * targets for network firewalls.
+     * 
+ * + * repeated string tags = 40; + * + * @param index The index of the element to return. + * @return The tags at the given index. + */ + public java.lang.String getTags(int index) { + return tags_.get(index); + } + /** + * + * + *
+     * Tags to apply to the TPU Node. Tags are used to identify valid sources or
+     * targets for network firewalls.
+     * 
+ * + * repeated string tags = 40; + * + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + public com.google.protobuf.ByteString getTagsBytes(int index) { + return tags_.getByteString(index); + } + /** + * + * + *
+     * Tags to apply to the TPU Node. Tags are used to identify valid sources or
+     * targets for network firewalls.
+     * 
+ * + * repeated string tags = 40; + * + * @param index The index to set the value at. + * @param value The tags to set. + * @return This builder for chaining. + */ + public Builder setTags(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagsIsMutable(); + tags_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Tags to apply to the TPU Node. Tags are used to identify valid sources or
+     * targets for network firewalls.
+     * 
+ * + * repeated string tags = 40; + * + * @param value The tags to add. + * @return This builder for chaining. + */ + public Builder addTags(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagsIsMutable(); + tags_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Tags to apply to the TPU Node. Tags are used to identify valid sources or
+     * targets for network firewalls.
+     * 
+ * + * repeated string tags = 40; + * + * @param values The tags to add. + * @return This builder for chaining. + */ + public Builder addAllTags(java.lang.Iterable values) { + ensureTagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tags_); + onChanged(); + return this; + } + /** + * + * + *
+     * Tags to apply to the TPU Node. Tags are used to identify valid sources or
+     * targets for network firewalls.
+     * 
+ * + * repeated string tags = 40; + * + * @return This builder for chaining. + */ + public Builder clearTags() { + tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Tags to apply to the TPU Node. Tags are used to identify valid sources or
+     * targets for network firewalls.
+     * 
+ * + * repeated string tags = 40; + * + * @param value The bytes of the tags to add. + * @return This builder for chaining. + */ + public Builder addTagsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTagsIsMutable(); + tags_.add(value); + onChanged(); + return this; + } + + private long id_; + /** + * + * + *
+     * Output only. The unique identifier for the TPU Node.
+     * 
+ * + * int64 id = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + /** + * + * + *
+     * Output only. The unique identifier for the TPU Node.
+     * 
+ * + * int64 id = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(long value) { + + id_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The unique identifier for the TPU Node.
+     * 
+ * + * int64 id = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = 0L; + onChanged(); + return this; + } + + private java.util.List dataDisks_ = + java.util.Collections.emptyList(); + + private void ensureDataDisksIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + dataDisks_ = + new java.util.ArrayList(dataDisks_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.AttachedDisk, + com.google.cloud.tpu.v2alpha1.AttachedDisk.Builder, + com.google.cloud.tpu.v2alpha1.AttachedDiskOrBuilder> + dataDisksBuilder_; + + /** + * + * + *
+     * The additional data disks for the Node.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + public java.util.List getDataDisksList() { + if (dataDisksBuilder_ == null) { + return java.util.Collections.unmodifiableList(dataDisks_); + } else { + return dataDisksBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The additional data disks for the Node.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + public int getDataDisksCount() { + if (dataDisksBuilder_ == null) { + return dataDisks_.size(); + } else { + return dataDisksBuilder_.getCount(); + } + } + /** + * + * + *
+     * The additional data disks for the Node.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + public com.google.cloud.tpu.v2alpha1.AttachedDisk getDataDisks(int index) { + if (dataDisksBuilder_ == null) { + return dataDisks_.get(index); + } else { + return dataDisksBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The additional data disks for the Node.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + public Builder setDataDisks(int index, com.google.cloud.tpu.v2alpha1.AttachedDisk value) { + if (dataDisksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDataDisksIsMutable(); + dataDisks_.set(index, value); + onChanged(); + } else { + dataDisksBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The additional data disks for the Node.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + public Builder setDataDisks( + int index, com.google.cloud.tpu.v2alpha1.AttachedDisk.Builder builderForValue) { + if (dataDisksBuilder_ == null) { + ensureDataDisksIsMutable(); + dataDisks_.set(index, builderForValue.build()); + onChanged(); + } else { + dataDisksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The additional data disks for the Node.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + public Builder addDataDisks(com.google.cloud.tpu.v2alpha1.AttachedDisk value) { + if (dataDisksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDataDisksIsMutable(); + dataDisks_.add(value); + onChanged(); + } else { + dataDisksBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The additional data disks for the Node.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + public Builder addDataDisks(int index, com.google.cloud.tpu.v2alpha1.AttachedDisk value) { + if (dataDisksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDataDisksIsMutable(); + dataDisks_.add(index, value); + onChanged(); + } else { + dataDisksBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The additional data disks for the Node.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + public Builder addDataDisks( + com.google.cloud.tpu.v2alpha1.AttachedDisk.Builder builderForValue) { + if (dataDisksBuilder_ == null) { + ensureDataDisksIsMutable(); + dataDisks_.add(builderForValue.build()); + onChanged(); + } else { + dataDisksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The additional data disks for the Node.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + public Builder addDataDisks( + int index, com.google.cloud.tpu.v2alpha1.AttachedDisk.Builder builderForValue) { + if (dataDisksBuilder_ == null) { + ensureDataDisksIsMutable(); + dataDisks_.add(index, builderForValue.build()); + onChanged(); + } else { + dataDisksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The additional data disks for the Node.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + public Builder addAllDataDisks( + java.lang.Iterable values) { + if (dataDisksBuilder_ == null) { + ensureDataDisksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dataDisks_); + onChanged(); + } else { + dataDisksBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The additional data disks for the Node.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + public Builder clearDataDisks() { + if (dataDisksBuilder_ == null) { + dataDisks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + dataDisksBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The additional data disks for the Node.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + public Builder removeDataDisks(int index) { + if (dataDisksBuilder_ == null) { + ensureDataDisksIsMutable(); + dataDisks_.remove(index); + onChanged(); + } else { + dataDisksBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The additional data disks for the Node.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + public com.google.cloud.tpu.v2alpha1.AttachedDisk.Builder getDataDisksBuilder(int index) { + return getDataDisksFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The additional data disks for the Node.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + public com.google.cloud.tpu.v2alpha1.AttachedDiskOrBuilder getDataDisksOrBuilder(int index) { + if (dataDisksBuilder_ == null) { + return dataDisks_.get(index); + } else { + return dataDisksBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The additional data disks for the Node.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + public java.util.List + getDataDisksOrBuilderList() { + if (dataDisksBuilder_ != null) { + return dataDisksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(dataDisks_); + } + } + /** + * + * + *
+     * The additional data disks for the Node.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + public com.google.cloud.tpu.v2alpha1.AttachedDisk.Builder addDataDisksBuilder() { + return getDataDisksFieldBuilder() + .addBuilder(com.google.cloud.tpu.v2alpha1.AttachedDisk.getDefaultInstance()); + } + /** + * + * + *
+     * The additional data disks for the Node.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + public com.google.cloud.tpu.v2alpha1.AttachedDisk.Builder addDataDisksBuilder(int index) { + return getDataDisksFieldBuilder() + .addBuilder(index, com.google.cloud.tpu.v2alpha1.AttachedDisk.getDefaultInstance()); + } + /** + * + * + *
+     * The additional data disks for the Node.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + public java.util.List + getDataDisksBuilderList() { + return getDataDisksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.AttachedDisk, + com.google.cloud.tpu.v2alpha1.AttachedDisk.Builder, + com.google.cloud.tpu.v2alpha1.AttachedDiskOrBuilder> + getDataDisksFieldBuilder() { + if (dataDisksBuilder_ == null) { + dataDisksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.AttachedDisk, + com.google.cloud.tpu.v2alpha1.AttachedDisk.Builder, + com.google.cloud.tpu.v2alpha1.AttachedDiskOrBuilder>( + dataDisks_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); + dataDisks_ = null; + } + return dataDisksBuilder_; + } + + private int apiVersion_ = 0; + /** + * + * + *
+     * Output only. The API version that created this Node.
+     * 
+ * + * + * .google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The apiVersion. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.Node.ApiVersion getApiVersion() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v2alpha1.Node.ApiVersion result = + com.google.cloud.tpu.v2alpha1.Node.ApiVersion.valueOf(apiVersion_); + return result == null ? com.google.cloud.tpu.v2alpha1.Node.ApiVersion.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The API version that created this Node.
+     * 
+ * + * + * .google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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_ & 0x00000020) != 0)) { + symptoms_ = new java.util.ArrayList(symptoms_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.Symptom, + com.google.cloud.tpu.v2alpha1.Symptom.Builder, + com.google.cloud.tpu.v2alpha1.SymptomOrBuilder> + symptomsBuilder_; + + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v2alpha1.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.v2alpha1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSymptoms(int index, com.google.cloud.tpu.v2alpha1.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.v2alpha1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSymptoms( + int index, com.google.cloud.tpu.v2alpha1.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.v2alpha1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addSymptoms(com.google.cloud.tpu.v2alpha1.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.v2alpha1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addSymptoms(int index, com.google.cloud.tpu.v2alpha1.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.v2alpha1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addSymptoms(com.google.cloud.tpu.v2alpha1.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.v2alpha1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addSymptoms( + int index, com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearSymptoms() { + if (symptomsBuilder_ == null) { + symptoms_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + symptomsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.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.v2alpha1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v2alpha1.Symptom.Builder getSymptomsBuilder(int index) { + return getSymptomsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v2alpha1.Symptom.Builder addSymptomsBuilder() { + return getSymptomsFieldBuilder() + .addBuilder(com.google.cloud.tpu.v2alpha1.Symptom.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v2alpha1.Symptom.Builder addSymptomsBuilder(int index) { + return getSymptomsFieldBuilder() + .addBuilder(index, com.google.cloud.tpu.v2alpha1.Symptom.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.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.v2alpha1.Symptom, + com.google.cloud.tpu.v2alpha1.Symptom.Builder, + com.google.cloud.tpu.v2alpha1.SymptomOrBuilder> + getSymptomsFieldBuilder() { + if (symptomsBuilder_ == null) { + symptomsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.Symptom, + com.google.cloud.tpu.v2alpha1.Symptom.Builder, + com.google.cloud.tpu.v2alpha1.SymptomOrBuilder>( + symptoms_, ((bitField0_ & 0x00000020) != 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.v2alpha1.Node) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.Node) + private static final com.google.cloud.tpu.v2alpha1.Node DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.Node(); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.Node getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NodeName.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NodeName.java new file mode 100644 index 00000000..ede32c0a --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/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.v2alpha1; + +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) { + this.project = nodeName.project; + this.location = nodeName.location; + this.node = nodeName.node; + } + + public NodeName build() { + return new NodeName(this); + } + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NodeOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NodeOrBuilder.java new file mode 100644 index 00000000..dfd1ded2 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NodeOrBuilder.java @@ -0,0 +1,791 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface NodeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.Node) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Immutable. The name of the TPU.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. Immutable. The name of the TPU.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. The current state for the TPU Node.
+   * 
+ * + * + * .google.cloud.tpu.v2alpha1.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.v2alpha1.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.tpu.v2alpha1.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 runtime version running in the Node.
+   * 
+ * + * string runtime_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The runtimeVersion. + */ + java.lang.String getRuntimeVersion(); + /** + * + * + *
+   * Required. The runtime version running in the Node.
+   * 
+ * + * string runtime_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for runtimeVersion. + */ + com.google.protobuf.ByteString getRuntimeVersionBytes(); + + /** + * + * + *
+   * Network configurations for the TPU node.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.NetworkConfig network_config = 36; + * + * @return Whether the networkConfig field is set. + */ + boolean hasNetworkConfig(); + /** + * + * + *
+   * Network configurations for the TPU node.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.NetworkConfig network_config = 36; + * + * @return The networkConfig. + */ + com.google.cloud.tpu.v2alpha1.NetworkConfig getNetworkConfig(); + /** + * + * + *
+   * Network configurations for the TPU node.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.NetworkConfig network_config = 36; + */ + com.google.cloud.tpu.v2alpha1.NetworkConfigOrBuilder getNetworkConfigOrBuilder(); + + /** + * + * + *
+   * 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(); + + /** + * + * + *
+   * The Google Cloud Platform Service Account to be used by the TPU node VMs.
+   * If None is specified, the default compute service account will be used.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceAccount service_account = 37; + * + * @return Whether the serviceAccount field is set. + */ + boolean hasServiceAccount(); + /** + * + * + *
+   * The Google Cloud Platform Service Account to be used by the TPU node VMs.
+   * If None is specified, the default compute service account will be used.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceAccount service_account = 37; + * + * @return The serviceAccount. + */ + com.google.cloud.tpu.v2alpha1.ServiceAccount getServiceAccount(); + /** + * + * + *
+   * The Google Cloud Platform Service Account to be used by the TPU node VMs.
+   * If None is specified, the default compute service account will be used.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.ServiceAccount service_account = 37; + */ + com.google.cloud.tpu.v2alpha1.ServiceAccountOrBuilder getServiceAccountOrBuilder(); + + /** + * + * + *
+   * 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.v2alpha1.SchedulingConfig scheduling_config = 17; + * + * @return Whether the schedulingConfig field is set. + */ + boolean hasSchedulingConfig(); + /** + * + * + *
+   * The scheduling options for this node.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.SchedulingConfig scheduling_config = 17; + * + * @return The schedulingConfig. + */ + com.google.cloud.tpu.v2alpha1.SchedulingConfig getSchedulingConfig(); + /** + * + * + *
+   * The scheduling options for this node.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.SchedulingConfig scheduling_config = 17; + */ + com.google.cloud.tpu.v2alpha1.SchedulingConfigOrBuilder getSchedulingConfigOrBuilder(); + + /** + * + * + *
+   * Output only. The network endpoints where TPU workers can be accessed and
+   * sent work. It is recommended that runtime clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.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 runtime clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.tpu.v2alpha1.NetworkEndpoint getNetworkEndpoints(int index); + /** + * + * + *
+   * Output only. The network endpoints where TPU workers can be accessed and
+   * sent work. It is recommended that runtime clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.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 runtime clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.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 runtime clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.tpu.v2alpha1.NetworkEndpointOrBuilder getNetworkEndpointsOrBuilder(int index); + + /** + * + * + *
+   * The health status of the TPU node.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.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.v2alpha1.Node.Health health = 22; + * + * @return The health. + */ + com.google.cloud.tpu.v2alpha1.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); + + /** + * + * + *
+   * Custom metadata to apply to the TPU Node.
+   * Can set startup-script and shutdown-script
+   * 
+ * + * map<string, string> metadata = 34; + */ + int getMetadataCount(); + /** + * + * + *
+   * Custom metadata to apply to the TPU Node.
+   * Can set startup-script and shutdown-script
+   * 
+ * + * map<string, string> metadata = 34; + */ + boolean containsMetadata(java.lang.String key); + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Deprecated + java.util.Map getMetadata(); + /** + * + * + *
+   * Custom metadata to apply to the TPU Node.
+   * Can set startup-script and shutdown-script
+   * 
+ * + * map<string, string> metadata = 34; + */ + java.util.Map getMetadataMap(); + /** + * + * + *
+   * Custom metadata to apply to the TPU Node.
+   * Can set startup-script and shutdown-script
+   * 
+ * + * map<string, string> metadata = 34; + */ + java.lang.String getMetadataOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Custom metadata to apply to the TPU Node.
+   * Can set startup-script and shutdown-script
+   * 
+ * + * map<string, string> metadata = 34; + */ + java.lang.String getMetadataOrThrow(java.lang.String key); + + /** + * + * + *
+   * Tags to apply to the TPU Node. Tags are used to identify valid sources or
+   * targets for network firewalls.
+   * 
+ * + * repeated string tags = 40; + * + * @return A list containing the tags. + */ + java.util.List getTagsList(); + /** + * + * + *
+   * Tags to apply to the TPU Node. Tags are used to identify valid sources or
+   * targets for network firewalls.
+   * 
+ * + * repeated string tags = 40; + * + * @return The count of tags. + */ + int getTagsCount(); + /** + * + * + *
+   * Tags to apply to the TPU Node. Tags are used to identify valid sources or
+   * targets for network firewalls.
+   * 
+ * + * repeated string tags = 40; + * + * @param index The index of the element to return. + * @return The tags at the given index. + */ + java.lang.String getTags(int index); + /** + * + * + *
+   * Tags to apply to the TPU Node. Tags are used to identify valid sources or
+   * targets for network firewalls.
+   * 
+ * + * repeated string tags = 40; + * + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + com.google.protobuf.ByteString getTagsBytes(int index); + + /** + * + * + *
+   * Output only. The unique identifier for the TPU Node.
+   * 
+ * + * int64 id = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The id. + */ + long getId(); + + /** + * + * + *
+   * The additional data disks for the Node.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + java.util.List getDataDisksList(); + /** + * + * + *
+   * The additional data disks for the Node.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + com.google.cloud.tpu.v2alpha1.AttachedDisk getDataDisks(int index); + /** + * + * + *
+   * The additional data disks for the Node.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + int getDataDisksCount(); + /** + * + * + *
+   * The additional data disks for the Node.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + java.util.List + getDataDisksOrBuilderList(); + /** + * + * + *
+   * The additional data disks for the Node.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.AttachedDisk data_disks = 41; + */ + com.google.cloud.tpu.v2alpha1.AttachedDiskOrBuilder getDataDisksOrBuilder(int index); + + /** + * + * + *
+   * Output only. The API version that created this Node.
+   * 
+ * + * + * .google.cloud.tpu.v2alpha1.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.v2alpha1.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The apiVersion. + */ + com.google.cloud.tpu.v2alpha1.Node.ApiVersion getApiVersion(); + + /** + * + * + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.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.v2alpha1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.tpu.v2alpha1.Symptom getSymptoms(int index); + /** + * + * + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * + * repeated .google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.tpu.v2alpha1.SymptomOrBuilder getSymptomsOrBuilder(int index); +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/OperationMetadata.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/OperationMetadata.java new file mode 100644 index 00000000..1e1d4e21 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/OperationMetadata.java @@ -0,0 +1,1809 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Metadata describing an [Operation][google.longrunning.Operation]
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.OperationMetadata.class, + com.google.cloud.tpu.v2alpha1.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusDetail_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusDetail_); + } + if (cancelRequested_ != false) { + output.writeBool(6, cancelRequested_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, apiVersion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusDetail_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusDetail_); + } + if (cancelRequested_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, cancelRequested_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, apiVersion_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.tpu.v2alpha1.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.OperationMetadata other = + (com.google.cloud.tpu.v2alpha1.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.v2alpha1.OperationMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.OperationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.OperationMetadata) + com.google.cloud.tpu.v2alpha1.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.OperationMetadata.class, + com.google.cloud.tpu.v2alpha1.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.OperationMetadata build() { + com.google.cloud.tpu.v2alpha1.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.OperationMetadata buildPartial() { + com.google.cloud.tpu.v2alpha1.OperationMetadata result = + new com.google.cloud.tpu.v2alpha1.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.v2alpha1.OperationMetadata) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.OperationMetadata other) { + if (other == com.google.cloud.tpu.v2alpha1.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.v2alpha1.OperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v2alpha1.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.v2alpha1.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.OperationMetadata) + private static final com.google.cloud.tpu.v2alpha1.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.OperationMetadata(); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/OperationMetadataOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/OperationMetadataOrBuilder.java new file mode 100644 index 00000000..57e0d5d4 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.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-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersion.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersion.java new file mode 100644 index 00000000..edca045a --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersion.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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * A runtime version that a Node can be configured with.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.RuntimeVersion} + */ +public final class RuntimeVersion extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.RuntimeVersion) + RuntimeVersionOrBuilder { + private static final long serialVersionUID = 0L; + // Use RuntimeVersion.newBuilder() to construct. + private RuntimeVersion(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RuntimeVersion() { + name_ = ""; + version_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RuntimeVersion(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RuntimeVersion( + 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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_RuntimeVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_RuntimeVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.RuntimeVersion.class, + com.google.cloud.tpu.v2alpha1.RuntimeVersion.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 runtime 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 runtime 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + 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.v2alpha1.RuntimeVersion)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.RuntimeVersion other = + (com.google.cloud.tpu.v2alpha1.RuntimeVersion) 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.v2alpha1.RuntimeVersion parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.RuntimeVersion 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.v2alpha1.RuntimeVersion parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.RuntimeVersion 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.v2alpha1.RuntimeVersion parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.RuntimeVersion parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v2alpha1.RuntimeVersion parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.RuntimeVersion 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.v2alpha1.RuntimeVersion parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.RuntimeVersion 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.v2alpha1.RuntimeVersion parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.RuntimeVersion 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.v2alpha1.RuntimeVersion 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 runtime version that a Node can be configured with.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.RuntimeVersion} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.RuntimeVersion) + com.google.cloud.tpu.v2alpha1.RuntimeVersionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_RuntimeVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_RuntimeVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.RuntimeVersion.class, + com.google.cloud.tpu.v2alpha1.RuntimeVersion.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.RuntimeVersion.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_RuntimeVersion_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.RuntimeVersion getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.RuntimeVersion.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.RuntimeVersion build() { + com.google.cloud.tpu.v2alpha1.RuntimeVersion result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.RuntimeVersion buildPartial() { + com.google.cloud.tpu.v2alpha1.RuntimeVersion result = + new com.google.cloud.tpu.v2alpha1.RuntimeVersion(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.v2alpha1.RuntimeVersion) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.RuntimeVersion) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.RuntimeVersion other) { + if (other == com.google.cloud.tpu.v2alpha1.RuntimeVersion.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.v2alpha1.RuntimeVersion parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v2alpha1.RuntimeVersion) 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 runtime 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 runtime 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 runtime 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 runtime version.
+     * 
+ * + * string version = 2; + * + * @return This builder for chaining. + */ + public Builder clearVersion() { + + version_ = getDefaultInstance().getVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * The runtime 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.v2alpha1.RuntimeVersion) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.RuntimeVersion) + private static final com.google.cloud.tpu.v2alpha1.RuntimeVersion DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.RuntimeVersion(); + } + + public static com.google.cloud.tpu.v2alpha1.RuntimeVersion getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RuntimeVersion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RuntimeVersion(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.v2alpha1.RuntimeVersion getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersionName.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersionName.java new file mode 100644 index 00000000..d640bb24 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersionName.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.v2alpha1; + +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 RuntimeVersionName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_RUNTIME_VERSION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/runtimeVersions/{runtime_version}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String runtimeVersion; + + @Deprecated + protected RuntimeVersionName() { + project = null; + location = null; + runtimeVersion = null; + } + + private RuntimeVersionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + runtimeVersion = Preconditions.checkNotNull(builder.getRuntimeVersion()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getRuntimeVersion() { + return runtimeVersion; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static RuntimeVersionName of(String project, String location, String runtimeVersion) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setRuntimeVersion(runtimeVersion) + .build(); + } + + public static String format(String project, String location, String runtimeVersion) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setRuntimeVersion(runtimeVersion) + .build() + .toString(); + } + + public static RuntimeVersionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_RUNTIME_VERSION.validatedMatch( + formattedString, "RuntimeVersionName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("runtime_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 (RuntimeVersionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_RUNTIME_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 (runtimeVersion != null) { + fieldMapBuilder.put("runtime_version", runtimeVersion); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_RUNTIME_VERSION.instantiate( + "project", project, "location", location, "runtime_version", runtimeVersion); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + RuntimeVersionName that = ((RuntimeVersionName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.runtimeVersion, that.runtimeVersion); + } + 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(runtimeVersion); + return h; + } + + /** Builder for projects/{project}/locations/{location}/runtimeVersions/{runtime_version}. */ + public static class Builder { + private String project; + private String location; + private String runtimeVersion; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getRuntimeVersion() { + return runtimeVersion; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setRuntimeVersion(String runtimeVersion) { + this.runtimeVersion = runtimeVersion; + return this; + } + + private Builder(RuntimeVersionName runtimeVersionName) { + this.project = runtimeVersionName.project; + this.location = runtimeVersionName.location; + this.runtimeVersion = runtimeVersionName.runtimeVersion; + } + + public RuntimeVersionName build() { + return new RuntimeVersionName(this); + } + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersionOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersionOrBuilder.java new file mode 100644 index 00000000..06fc731d --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersionOrBuilder.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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface RuntimeVersionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.RuntimeVersion) + 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 runtime version.
+   * 
+ * + * string version = 2; + * + * @return The version. + */ + java.lang.String getVersion(); + /** + * + * + *
+   * The runtime version.
+   * 
+ * + * string version = 2; + * + * @return The bytes for version. + */ + com.google.protobuf.ByteString getVersionBytes(); +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SchedulingConfig.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SchedulingConfig.java new file mode 100644 index 00000000..806391e4 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SchedulingConfig.java @@ -0,0 +1,634 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Sets the scheduling options for this node.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.SchedulingConfig} + */ +public final class SchedulingConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_SchedulingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_SchedulingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.SchedulingConfig.class, + com.google.cloud.tpu.v2alpha1.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.v2alpha1.SchedulingConfig)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.SchedulingConfig other = + (com.google.cloud.tpu.v2alpha1.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.v2alpha1.SchedulingConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.SchedulingConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.SchedulingConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.SchedulingConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.SchedulingConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.SchedulingConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.SchedulingConfig) + com.google.cloud.tpu.v2alpha1.SchedulingConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_SchedulingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_SchedulingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.SchedulingConfig.class, + com.google.cloud.tpu.v2alpha1.SchedulingConfig.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_SchedulingConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.SchedulingConfig getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.SchedulingConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.SchedulingConfig build() { + com.google.cloud.tpu.v2alpha1.SchedulingConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.SchedulingConfig buildPartial() { + com.google.cloud.tpu.v2alpha1.SchedulingConfig result = + new com.google.cloud.tpu.v2alpha1.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.v2alpha1.SchedulingConfig) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.SchedulingConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.SchedulingConfig other) { + if (other == com.google.cloud.tpu.v2alpha1.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.v2alpha1.SchedulingConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v2alpha1.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.v2alpha1.SchedulingConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.SchedulingConfig) + private static final com.google.cloud.tpu.v2alpha1.SchedulingConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.SchedulingConfig(); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.SchedulingConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SchedulingConfigOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SchedulingConfigOrBuilder.java new file mode 100644 index 00000000..4f174ebe --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface SchedulingConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.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-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceAccount.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceAccount.java new file mode 100644 index 00000000..62f21a5f --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceAccount.java @@ -0,0 +1,934 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * A service account.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.ServiceAccount} + */ +public final class ServiceAccount extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.ServiceAccount) + ServiceAccountOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServiceAccount.newBuilder() to construct. + private ServiceAccount(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ServiceAccount() { + email_ = ""; + scope_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ServiceAccount(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ServiceAccount( + 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(); + + email_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + scope_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + scope_.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)) { + scope_ = scope_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ServiceAccount_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ServiceAccount_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.ServiceAccount.class, + com.google.cloud.tpu.v2alpha1.ServiceAccount.Builder.class); + } + + public static final int EMAIL_FIELD_NUMBER = 1; + private volatile java.lang.Object email_; + /** + * + * + *
+   * Email address of the service account. If empty, default Compute service
+   * account will be used.
+   * 
+ * + * string email = 1; + * + * @return The email. + */ + @java.lang.Override + public java.lang.String getEmail() { + java.lang.Object ref = email_; + 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(); + email_ = s; + return s; + } + } + /** + * + * + *
+   * Email address of the service account. If empty, default Compute service
+   * account will be used.
+   * 
+ * + * string email = 1; + * + * @return The bytes for email. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEmailBytes() { + java.lang.Object ref = email_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + email_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCOPE_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList scope_; + /** + * + * + *
+   * The list of scopes to be made available for this service account. If empty,
+   * access to all Cloud APIs will be allowed.
+   * 
+ * + * repeated string scope = 2; + * + * @return A list containing the scope. + */ + public com.google.protobuf.ProtocolStringList getScopeList() { + return scope_; + } + /** + * + * + *
+   * The list of scopes to be made available for this service account. If empty,
+   * access to all Cloud APIs will be allowed.
+   * 
+ * + * repeated string scope = 2; + * + * @return The count of scope. + */ + public int getScopeCount() { + return scope_.size(); + } + /** + * + * + *
+   * The list of scopes to be made available for this service account. If empty,
+   * access to all Cloud APIs will be allowed.
+   * 
+ * + * repeated string scope = 2; + * + * @param index The index of the element to return. + * @return The scope at the given index. + */ + public java.lang.String getScope(int index) { + return scope_.get(index); + } + /** + * + * + *
+   * The list of scopes to be made available for this service account. If empty,
+   * access to all Cloud APIs will be allowed.
+   * 
+ * + * repeated string scope = 2; + * + * @param index The index of the value to return. + * @return The bytes of the scope at the given index. + */ + public com.google.protobuf.ByteString getScopeBytes(int index) { + return scope_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(email_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, email_); + } + for (int i = 0; i < scope_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, scope_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(email_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, email_); + } + { + int dataSize = 0; + for (int i = 0; i < scope_.size(); i++) { + dataSize += computeStringSizeNoTag(scope_.getRaw(i)); + } + size += dataSize; + size += 1 * getScopeList().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.v2alpha1.ServiceAccount)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.ServiceAccount other = + (com.google.cloud.tpu.v2alpha1.ServiceAccount) obj; + + if (!getEmail().equals(other.getEmail())) return false; + if (!getScopeList().equals(other.getScopeList())) 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) + EMAIL_FIELD_NUMBER; + hash = (53 * hash) + getEmail().hashCode(); + if (getScopeCount() > 0) { + hash = (37 * hash) + SCOPE_FIELD_NUMBER; + hash = (53 * hash) + getScopeList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.ServiceAccount parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.ServiceAccount 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.v2alpha1.ServiceAccount parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.ServiceAccount 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.v2alpha1.ServiceAccount parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.ServiceAccount parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v2alpha1.ServiceAccount parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.ServiceAccount 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.v2alpha1.ServiceAccount parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.ServiceAccount 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.v2alpha1.ServiceAccount parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.ServiceAccount 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.v2alpha1.ServiceAccount 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 service account.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.ServiceAccount} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.ServiceAccount) + com.google.cloud.tpu.v2alpha1.ServiceAccountOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ServiceAccount_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ServiceAccount_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.ServiceAccount.class, + com.google.cloud.tpu.v2alpha1.ServiceAccount.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.ServiceAccount.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(); + email_ = ""; + + scope_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ServiceAccount_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ServiceAccount getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.ServiceAccount.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ServiceAccount build() { + com.google.cloud.tpu.v2alpha1.ServiceAccount result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ServiceAccount buildPartial() { + com.google.cloud.tpu.v2alpha1.ServiceAccount result = + new com.google.cloud.tpu.v2alpha1.ServiceAccount(this); + int from_bitField0_ = bitField0_; + result.email_ = email_; + if (((bitField0_ & 0x00000001) != 0)) { + scope_ = scope_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.scope_ = scope_; + 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.v2alpha1.ServiceAccount) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.ServiceAccount) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.ServiceAccount other) { + if (other == com.google.cloud.tpu.v2alpha1.ServiceAccount.getDefaultInstance()) return this; + if (!other.getEmail().isEmpty()) { + email_ = other.email_; + onChanged(); + } + if (!other.scope_.isEmpty()) { + if (scope_.isEmpty()) { + scope_ = other.scope_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureScopeIsMutable(); + scope_.addAll(other.scope_); + } + 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.v2alpha1.ServiceAccount parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v2alpha1.ServiceAccount) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object email_ = ""; + /** + * + * + *
+     * Email address of the service account. If empty, default Compute service
+     * account will be used.
+     * 
+ * + * string email = 1; + * + * @return The email. + */ + public java.lang.String getEmail() { + java.lang.Object ref = email_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + email_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Email address of the service account. If empty, default Compute service
+     * account will be used.
+     * 
+ * + * string email = 1; + * + * @return The bytes for email. + */ + public com.google.protobuf.ByteString getEmailBytes() { + java.lang.Object ref = email_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + email_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Email address of the service account. If empty, default Compute service
+     * account will be used.
+     * 
+ * + * string email = 1; + * + * @param value The email to set. + * @return This builder for chaining. + */ + public Builder setEmail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + email_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Email address of the service account. If empty, default Compute service
+     * account will be used.
+     * 
+ * + * string email = 1; + * + * @return This builder for chaining. + */ + public Builder clearEmail() { + + email_ = getDefaultInstance().getEmail(); + onChanged(); + return this; + } + /** + * + * + *
+     * Email address of the service account. If empty, default Compute service
+     * account will be used.
+     * 
+ * + * string email = 1; + * + * @param value The bytes for email to set. + * @return This builder for chaining. + */ + public Builder setEmailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + email_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList scope_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureScopeIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + scope_ = new com.google.protobuf.LazyStringArrayList(scope_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The list of scopes to be made available for this service account. If empty,
+     * access to all Cloud APIs will be allowed.
+     * 
+ * + * repeated string scope = 2; + * + * @return A list containing the scope. + */ + public com.google.protobuf.ProtocolStringList getScopeList() { + return scope_.getUnmodifiableView(); + } + /** + * + * + *
+     * The list of scopes to be made available for this service account. If empty,
+     * access to all Cloud APIs will be allowed.
+     * 
+ * + * repeated string scope = 2; + * + * @return The count of scope. + */ + public int getScopeCount() { + return scope_.size(); + } + /** + * + * + *
+     * The list of scopes to be made available for this service account. If empty,
+     * access to all Cloud APIs will be allowed.
+     * 
+ * + * repeated string scope = 2; + * + * @param index The index of the element to return. + * @return The scope at the given index. + */ + public java.lang.String getScope(int index) { + return scope_.get(index); + } + /** + * + * + *
+     * The list of scopes to be made available for this service account. If empty,
+     * access to all Cloud APIs will be allowed.
+     * 
+ * + * repeated string scope = 2; + * + * @param index The index of the value to return. + * @return The bytes of the scope at the given index. + */ + public com.google.protobuf.ByteString getScopeBytes(int index) { + return scope_.getByteString(index); + } + /** + * + * + *
+     * The list of scopes to be made available for this service account. If empty,
+     * access to all Cloud APIs will be allowed.
+     * 
+ * + * repeated string scope = 2; + * + * @param index The index to set the value at. + * @param value The scope to set. + * @return This builder for chaining. + */ + public Builder setScope(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureScopeIsMutable(); + scope_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of scopes to be made available for this service account. If empty,
+     * access to all Cloud APIs will be allowed.
+     * 
+ * + * repeated string scope = 2; + * + * @param value The scope to add. + * @return This builder for chaining. + */ + public Builder addScope(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureScopeIsMutable(); + scope_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of scopes to be made available for this service account. If empty,
+     * access to all Cloud APIs will be allowed.
+     * 
+ * + * repeated string scope = 2; + * + * @param values The scope to add. + * @return This builder for chaining. + */ + public Builder addAllScope(java.lang.Iterable values) { + ensureScopeIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, scope_); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of scopes to be made available for this service account. If empty,
+     * access to all Cloud APIs will be allowed.
+     * 
+ * + * repeated string scope = 2; + * + * @return This builder for chaining. + */ + public Builder clearScope() { + scope_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of scopes to be made available for this service account. If empty,
+     * access to all Cloud APIs will be allowed.
+     * 
+ * + * repeated string scope = 2; + * + * @param value The bytes of the scope to add. + * @return This builder for chaining. + */ + public Builder addScopeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureScopeIsMutable(); + scope_.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.v2alpha1.ServiceAccount) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.ServiceAccount) + private static final com.google.cloud.tpu.v2alpha1.ServiceAccount DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.ServiceAccount(); + } + + public static com.google.cloud.tpu.v2alpha1.ServiceAccount getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServiceAccount parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServiceAccount(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.v2alpha1.ServiceAccount getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceAccountOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceAccountOrBuilder.java new file mode 100644 index 00000000..34e4ff10 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceAccountOrBuilder.java @@ -0,0 +1,107 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface ServiceAccountOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.ServiceAccount) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Email address of the service account. If empty, default Compute service
+   * account will be used.
+   * 
+ * + * string email = 1; + * + * @return The email. + */ + java.lang.String getEmail(); + /** + * + * + *
+   * Email address of the service account. If empty, default Compute service
+   * account will be used.
+   * 
+ * + * string email = 1; + * + * @return The bytes for email. + */ + com.google.protobuf.ByteString getEmailBytes(); + + /** + * + * + *
+   * The list of scopes to be made available for this service account. If empty,
+   * access to all Cloud APIs will be allowed.
+   * 
+ * + * repeated string scope = 2; + * + * @return A list containing the scope. + */ + java.util.List getScopeList(); + /** + * + * + *
+   * The list of scopes to be made available for this service account. If empty,
+   * access to all Cloud APIs will be allowed.
+   * 
+ * + * repeated string scope = 2; + * + * @return The count of scope. + */ + int getScopeCount(); + /** + * + * + *
+   * The list of scopes to be made available for this service account. If empty,
+   * access to all Cloud APIs will be allowed.
+   * 
+ * + * repeated string scope = 2; + * + * @param index The index of the element to return. + * @return The scope at the given index. + */ + java.lang.String getScope(int index); + /** + * + * + *
+   * The list of scopes to be made available for this service account. If empty,
+   * access to all Cloud APIs will be allowed.
+   * 
+ * + * repeated string scope = 2; + * + * @param index The index of the value to return. + * @return The bytes of the scope at the given index. + */ + com.google.protobuf.ByteString getScopeBytes(int index); +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceIdentity.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceIdentity.java new file mode 100644 index 00000000..a467b397 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceIdentity.java @@ -0,0 +1,634 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * The per-product per-project service identity for Cloud TPU service.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.ServiceIdentity} + */ +public final class ServiceIdentity extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.ServiceIdentity) + ServiceIdentityOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServiceIdentity.newBuilder() to construct. + private ServiceIdentity(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ServiceIdentity() { + email_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ServiceIdentity(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ServiceIdentity( + 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(); + + email_ = 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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ServiceIdentity_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ServiceIdentity_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.ServiceIdentity.class, + com.google.cloud.tpu.v2alpha1.ServiceIdentity.Builder.class); + } + + public static final int EMAIL_FIELD_NUMBER = 1; + private volatile java.lang.Object email_; + /** + * + * + *
+   * The email address of the service identity.
+   * 
+ * + * string email = 1; + * + * @return The email. + */ + @java.lang.Override + public java.lang.String getEmail() { + java.lang.Object ref = email_; + 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(); + email_ = s; + return s; + } + } + /** + * + * + *
+   * The email address of the service identity.
+   * 
+ * + * string email = 1; + * + * @return The bytes for email. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEmailBytes() { + java.lang.Object ref = email_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + email_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(email_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, email_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(email_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, email_); + } + 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.v2alpha1.ServiceIdentity)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.ServiceIdentity other = + (com.google.cloud.tpu.v2alpha1.ServiceIdentity) obj; + + if (!getEmail().equals(other.getEmail())) 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) + EMAIL_FIELD_NUMBER; + hash = (53 * hash) + getEmail().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.ServiceIdentity parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.ServiceIdentity 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.v2alpha1.ServiceIdentity parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.ServiceIdentity 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.v2alpha1.ServiceIdentity parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.ServiceIdentity parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v2alpha1.ServiceIdentity parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.ServiceIdentity 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.v2alpha1.ServiceIdentity parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.ServiceIdentity 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.v2alpha1.ServiceIdentity parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.ServiceIdentity 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.v2alpha1.ServiceIdentity prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The per-product per-project service identity for Cloud TPU service.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.ServiceIdentity} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.ServiceIdentity) + com.google.cloud.tpu.v2alpha1.ServiceIdentityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ServiceIdentity_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ServiceIdentity_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.ServiceIdentity.class, + com.google.cloud.tpu.v2alpha1.ServiceIdentity.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.ServiceIdentity.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(); + email_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ServiceIdentity_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ServiceIdentity getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.ServiceIdentity.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ServiceIdentity build() { + com.google.cloud.tpu.v2alpha1.ServiceIdentity result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ServiceIdentity buildPartial() { + com.google.cloud.tpu.v2alpha1.ServiceIdentity result = + new com.google.cloud.tpu.v2alpha1.ServiceIdentity(this); + result.email_ = email_; + 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.v2alpha1.ServiceIdentity) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.ServiceIdentity) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.ServiceIdentity other) { + if (other == com.google.cloud.tpu.v2alpha1.ServiceIdentity.getDefaultInstance()) return this; + if (!other.getEmail().isEmpty()) { + email_ = other.email_; + 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.v2alpha1.ServiceIdentity parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v2alpha1.ServiceIdentity) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object email_ = ""; + /** + * + * + *
+     * The email address of the service identity.
+     * 
+ * + * string email = 1; + * + * @return The email. + */ + public java.lang.String getEmail() { + java.lang.Object ref = email_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + email_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The email address of the service identity.
+     * 
+ * + * string email = 1; + * + * @return The bytes for email. + */ + public com.google.protobuf.ByteString getEmailBytes() { + java.lang.Object ref = email_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + email_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The email address of the service identity.
+     * 
+ * + * string email = 1; + * + * @param value The email to set. + * @return This builder for chaining. + */ + public Builder setEmail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + email_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The email address of the service identity.
+     * 
+ * + * string email = 1; + * + * @return This builder for chaining. + */ + public Builder clearEmail() { + + email_ = getDefaultInstance().getEmail(); + onChanged(); + return this; + } + /** + * + * + *
+     * The email address of the service identity.
+     * 
+ * + * string email = 1; + * + * @param value The bytes for email to set. + * @return This builder for chaining. + */ + public Builder setEmailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + email_ = 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.v2alpha1.ServiceIdentity) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.ServiceIdentity) + private static final com.google.cloud.tpu.v2alpha1.ServiceIdentity DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.ServiceIdentity(); + } + + public static com.google.cloud.tpu.v2alpha1.ServiceIdentity getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServiceIdentity parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServiceIdentity(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.v2alpha1.ServiceIdentity getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceIdentityOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceIdentityOrBuilder.java new file mode 100644 index 00000000..41e7346d --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceIdentityOrBuilder.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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface ServiceIdentityOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.ServiceIdentity) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The email address of the service identity.
+   * 
+ * + * string email = 1; + * + * @return The email. + */ + java.lang.String getEmail(); + /** + * + * + *
+   * The email address of the service identity.
+   * 
+ * + * string email = 1; + * + * @return The bytes for email. + */ + com.google.protobuf.ByteString getEmailBytes(); +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StartNodeRequest.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StartNodeRequest.java new file mode 100644 index 00000000..35535aac --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StartNodeRequest.java @@ -0,0 +1,634 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Request for [StartNode][google.cloud.tpu.v2alpha1.Tpu.StartNode].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.StartNodeRequest} + */ +public final class StartNodeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_StartNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_StartNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.StartNodeRequest.class, + com.google.cloud.tpu.v2alpha1.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.tpu.v2alpha1.StartNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.StartNodeRequest other = + (com.google.cloud.tpu.v2alpha1.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.v2alpha1.StartNodeRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.StartNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.StartNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.StartNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.StartNodeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.Tpu.StartNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.StartNodeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.StartNodeRequest) + com.google.cloud.tpu.v2alpha1.StartNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_StartNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_StartNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.StartNodeRequest.class, + com.google.cloud.tpu.v2alpha1.StartNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_StartNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.StartNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.StartNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.StartNodeRequest build() { + com.google.cloud.tpu.v2alpha1.StartNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.StartNodeRequest buildPartial() { + com.google.cloud.tpu.v2alpha1.StartNodeRequest result = + new com.google.cloud.tpu.v2alpha1.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.v2alpha1.StartNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.StartNodeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.StartNodeRequest other) { + if (other == com.google.cloud.tpu.v2alpha1.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.v2alpha1.StartNodeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v2alpha1.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.v2alpha1.StartNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.StartNodeRequest) + private static final com.google.cloud.tpu.v2alpha1.StartNodeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.StartNodeRequest(); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.StartNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StartNodeRequestOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StartNodeRequestOrBuilder.java new file mode 100644 index 00000000..4621b0d6 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface StartNodeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.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-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StopNodeRequest.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StopNodeRequest.java new file mode 100644 index 00000000..bf871621 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StopNodeRequest.java @@ -0,0 +1,634 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Request for [StopNode][google.cloud.tpu.v2alpha1.Tpu.StopNode].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.StopNodeRequest} + */ +public final class StopNodeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_StopNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_StopNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.StopNodeRequest.class, + com.google.cloud.tpu.v2alpha1.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.tpu.v2alpha1.StopNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.StopNodeRequest other = + (com.google.cloud.tpu.v2alpha1.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.v2alpha1.StopNodeRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.StopNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.StopNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.StopNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.StopNodeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.Tpu.StopNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.StopNodeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.StopNodeRequest) + com.google.cloud.tpu.v2alpha1.StopNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_StopNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_StopNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.StopNodeRequest.class, + com.google.cloud.tpu.v2alpha1.StopNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_StopNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.StopNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.StopNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.StopNodeRequest build() { + com.google.cloud.tpu.v2alpha1.StopNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.StopNodeRequest buildPartial() { + com.google.cloud.tpu.v2alpha1.StopNodeRequest result = + new com.google.cloud.tpu.v2alpha1.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.v2alpha1.StopNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.StopNodeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.StopNodeRequest other) { + if (other == com.google.cloud.tpu.v2alpha1.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.v2alpha1.StopNodeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v2alpha1.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.v2alpha1.StopNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.StopNodeRequest) + private static final com.google.cloud.tpu.v2alpha1.StopNodeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.StopNodeRequest(); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.StopNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StopNodeRequestOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StopNodeRequestOrBuilder.java new file mode 100644 index 00000000..84b166f5 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface StopNodeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.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-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/Symptom.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/Symptom.java new file mode 100644 index 00000000..f97843df --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/Symptom.java @@ -0,0 +1,1485 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * A Symptom instance.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.Symptom} + */ +public final class Symptom extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_Symptom_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_Symptom_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.Symptom.class, + com.google.cloud.tpu.v2alpha1.Symptom.Builder.class); + } + + /** + * + * + *
+   * SymptomType represents the different types of Symptoms that a TPU can be
+   * at.
+   * 
+ * + * Protobuf enum {@code google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.Symptom.SymptomType symptom_type = 2; + * + * @return The symptomType. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.Symptom.SymptomType getSymptomType() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v2alpha1.Symptom.SymptomType result = + com.google.cloud.tpu.v2alpha1.Symptom.SymptomType.valueOf(symptomType_); + return result == null ? com.google.cloud.tpu.v2alpha1.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.v2alpha1.Symptom.SymptomType.SYMPTOM_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, symptomType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(details_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, details_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workerId_)) { + 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.v2alpha1.Symptom.SymptomType.SYMPTOM_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, symptomType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(details_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, details_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workerId_)) { + 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.v2alpha1.Symptom)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.Symptom other = (com.google.cloud.tpu.v2alpha1.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.v2alpha1.Symptom parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.Symptom parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.Symptom parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.Symptom parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.Symptom parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.Symptom} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.Symptom) + com.google.cloud.tpu.v2alpha1.SymptomOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_Symptom_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_Symptom_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.Symptom.class, + com.google.cloud.tpu.v2alpha1.Symptom.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_Symptom_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.Symptom getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.Symptom.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.Symptom build() { + com.google.cloud.tpu.v2alpha1.Symptom result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.Symptom buildPartial() { + com.google.cloud.tpu.v2alpha1.Symptom result = + new com.google.cloud.tpu.v2alpha1.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.v2alpha1.Symptom) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.Symptom) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.Symptom other) { + if (other == com.google.cloud.tpu.v2alpha1.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.v2alpha1.Symptom parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v2alpha1.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.v2alpha1.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.v2alpha1.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.v2alpha1.Symptom.SymptomType symptom_type = 2; + * + * @return The symptomType. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.Symptom.SymptomType getSymptomType() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v2alpha1.Symptom.SymptomType result = + com.google.cloud.tpu.v2alpha1.Symptom.SymptomType.valueOf(symptomType_); + return result == null + ? com.google.cloud.tpu.v2alpha1.Symptom.SymptomType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Type of the Symptom.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.Symptom.SymptomType symptom_type = 2; + * + * @param value The symptomType to set. + * @return This builder for chaining. + */ + public Builder setSymptomType(com.google.cloud.tpu.v2alpha1.Symptom.SymptomType value) { + if (value == null) { + throw new NullPointerException(); + } + + symptomType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Type of the Symptom.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.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.v2alpha1.Symptom) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.Symptom) + private static final com.google.cloud.tpu.v2alpha1.Symptom DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.Symptom(); + } + + public static com.google.cloud.tpu.v2alpha1.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.v2alpha1.Symptom getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SymptomOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SymptomOrBuilder.java new file mode 100644 index 00000000..8d3ee93e --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface SymptomOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.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.v2alpha1.Symptom.SymptomType symptom_type = 2; + * + * @return The enum numeric value on the wire for symptomType. + */ + int getSymptomTypeValue(); + /** + * + * + *
+   * Type of the Symptom.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.Symptom.SymptomType symptom_type = 2; + * + * @return The symptomType. + */ + com.google.cloud.tpu.v2alpha1.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-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequest.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequest.java new file mode 100644 index 00000000..3412bcc6 --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequest.java @@ -0,0 +1,1031 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Request for [UpdateNode][google.cloud.tpu.v2alpha1.Tpu.UpdateNode].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.UpdateNodeRequest} + */ +public final class UpdateNodeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.UpdateNodeRequest) + UpdateNodeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateNodeRequest.newBuilder() to construct. + private UpdateNodeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateNodeRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateNodeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateNodeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.tpu.v2alpha1.Node.Builder subBuilder = null; + if (node_ != null) { + subBuilder = node_.toBuilder(); + } + node_ = + input.readMessage(com.google.cloud.tpu.v2alpha1.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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_UpdateNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_UpdateNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.UpdateNodeRequest.class, + com.google.cloud.tpu.v2alpha1.UpdateNodeRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. Mask of fields from [Node][Tpu.Node] to update.
+   * Supported fields: None.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. Mask of fields from [Node][Tpu.Node] to update.
+   * Supported fields: None.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. Mask of fields from [Node][Tpu.Node] to update.
+   * Supported fields: None.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int NODE_FIELD_NUMBER = 2; + private com.google.cloud.tpu.v2alpha1.Node node_; + /** + * + * + *
+   * Required. The node. Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the node field is set. + */ + @java.lang.Override + public boolean hasNode() { + return node_ != null; + } + /** + * + * + *
+   * Required. The node. Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The node. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.Node getNode() { + return node_ == null ? com.google.cloud.tpu.v2alpha1.Node.getDefaultInstance() : node_; + } + /** + * + * + *
+   * Required. The node. Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.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 (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (node_ != null) { + output.writeMessage(2, getNode()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (node_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, 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.v2alpha1.UpdateNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.UpdateNodeRequest other = + (com.google.cloud.tpu.v2alpha1.UpdateNodeRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) 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(); + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().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.v2alpha1.UpdateNodeRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.UpdateNodeRequest 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.v2alpha1.UpdateNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.UpdateNodeRequest 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.v2alpha1.UpdateNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.UpdateNodeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.tpu.v2alpha1.UpdateNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.UpdateNodeRequest 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.v2alpha1.UpdateNodeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.UpdateNodeRequest 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.v2alpha1.UpdateNodeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.UpdateNodeRequest 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.v2alpha1.UpdateNodeRequest 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 [UpdateNode][google.cloud.tpu.v2alpha1.Tpu.UpdateNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.UpdateNodeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.UpdateNodeRequest) + com.google.cloud.tpu.v2alpha1.UpdateNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_UpdateNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_UpdateNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.UpdateNodeRequest.class, + com.google.cloud.tpu.v2alpha1.UpdateNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.UpdateNodeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + if (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.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_UpdateNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.UpdateNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.UpdateNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.UpdateNodeRequest build() { + com.google.cloud.tpu.v2alpha1.UpdateNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.UpdateNodeRequest buildPartial() { + com.google.cloud.tpu.v2alpha1.UpdateNodeRequest result = + new com.google.cloud.tpu.v2alpha1.UpdateNodeRequest(this); + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + 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.v2alpha1.UpdateNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.UpdateNodeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.UpdateNodeRequest other) { + if (other == com.google.cloud.tpu.v2alpha1.UpdateNodeRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + 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.v2alpha1.UpdateNodeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v2alpha1.UpdateNodeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. Mask of fields from [Node][Tpu.Node] to update.
+     * Supported fields: None.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. Mask of fields from [Node][Tpu.Node] to update.
+     * Supported fields: None.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Mask of fields from [Node][Tpu.Node] to update.
+     * Supported fields: None.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields from [Node][Tpu.Node] to update.
+     * Supported fields: None.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields from [Node][Tpu.Node] to update.
+     * Supported fields: None.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields from [Node][Tpu.Node] to update.
+     * Supported fields: None.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields from [Node][Tpu.Node] to update.
+     * Supported fields: None.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Mask of fields from [Node][Tpu.Node] to update.
+     * Supported fields: None.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. Mask of fields from [Node][Tpu.Node] to update.
+     * Supported fields: None.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.cloud.tpu.v2alpha1.Node node_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.Node, + com.google.cloud.tpu.v2alpha1.Node.Builder, + com.google.cloud.tpu.v2alpha1.NodeOrBuilder> + nodeBuilder_; + /** + * + * + *
+     * Required. The node. Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the node field is set. + */ + public boolean hasNode() { + return nodeBuilder_ != null || node_ != null; + } + /** + * + * + *
+     * Required. The node. Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The node. + */ + public com.google.cloud.tpu.v2alpha1.Node getNode() { + if (nodeBuilder_ == null) { + return node_ == null ? com.google.cloud.tpu.v2alpha1.Node.getDefaultInstance() : node_; + } else { + return nodeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The node. Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNode(com.google.cloud.tpu.v2alpha1.Node value) { + if (nodeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + node_ = value; + onChanged(); + } else { + nodeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The node. Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNode(com.google.cloud.tpu.v2alpha1.Node.Builder builderForValue) { + if (nodeBuilder_ == null) { + node_ = builderForValue.build(); + onChanged(); + } else { + nodeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The node. Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeNode(com.google.cloud.tpu.v2alpha1.Node value) { + if (nodeBuilder_ == null) { + if (node_ != null) { + node_ = + com.google.cloud.tpu.v2alpha1.Node.newBuilder(node_).mergeFrom(value).buildPartial(); + } else { + node_ = value; + } + onChanged(); + } else { + nodeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The node. Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearNode() { + if (nodeBuilder_ == null) { + node_ = null; + onChanged(); + } else { + node_ = null; + nodeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The node. Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.tpu.v2alpha1.Node.Builder getNodeBuilder() { + + onChanged(); + return getNodeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The node. Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.tpu.v2alpha1.NodeOrBuilder getNodeOrBuilder() { + if (nodeBuilder_ != null) { + return nodeBuilder_.getMessageOrBuilder(); + } else { + return node_ == null ? com.google.cloud.tpu.v2alpha1.Node.getDefaultInstance() : node_; + } + } + /** + * + * + *
+     * Required. The node. Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.Node, + com.google.cloud.tpu.v2alpha1.Node.Builder, + com.google.cloud.tpu.v2alpha1.NodeOrBuilder> + getNodeFieldBuilder() { + if (nodeBuilder_ == null) { + nodeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.Node, + com.google.cloud.tpu.v2alpha1.Node.Builder, + com.google.cloud.tpu.v2alpha1.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.v2alpha1.UpdateNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.UpdateNodeRequest) + private static final com.google.cloud.tpu.v2alpha1.UpdateNodeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.UpdateNodeRequest(); + } + + public static com.google.cloud.tpu.v2alpha1.UpdateNodeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateNodeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateNodeRequest(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.v2alpha1.UpdateNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequestOrBuilder.java b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequestOrBuilder.java new file mode 100644 index 00000000..8a0ec26a --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequestOrBuilder.java @@ -0,0 +1,104 @@ +/* + * 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/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface UpdateNodeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.UpdateNodeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Mask of fields from [Node][Tpu.Node] to update.
+   * Supported fields: None.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. Mask of fields from [Node][Tpu.Node] to update.
+   * Supported fields: None.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. Mask of fields from [Node][Tpu.Node] to update.
+   * Supported fields: None.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The node. Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the node field is set. + */ + boolean hasNode(); + /** + * + * + *
+   * Required. The node. Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The node. + */ + com.google.cloud.tpu.v2alpha1.Node getNode(); + /** + * + * + *
+   * Required. The node. Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.tpu.v2alpha1.NodeOrBuilder getNodeOrBuilder(); +} diff --git a/proto-google-cloud-tpu-v2alpha1/src/main/proto/google/cloud/tpu/v2alpha1/cloud_tpu.proto b/proto-google-cloud-tpu-v2alpha1/src/main/proto/google/cloud/tpu/v2alpha1/cloud_tpu.proto new file mode 100644 index 00000000..d805128f --- /dev/null +++ b/proto-google-cloud-tpu-v2alpha1/src/main/proto/google/cloud/tpu/v2alpha1/cloud_tpu.proto @@ -0,0 +1,782 @@ +// 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.v2alpha1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/tpu/v2alpha1;tpu"; +option java_multiple_files = true; +option java_outer_classname = "CloudTpuProto"; +option java_package = "com.google.cloud.tpu.v2alpha1"; + +// Manages TPU nodes and other resources +// +// TPU API v2alpha1 +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: "/v2alpha1/{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: "/v2alpha1/{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: "/v2alpha1/{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: "/v2alpha1/{name=projects/*/locations/*/nodes/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Node" + metadata_type: "OperationMetadata" + }; + } + + // Stops a node. This operation is only available with single TPU nodes. + rpc StopNode(StopNodeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2alpha1/{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: "/v2alpha1/{name=projects/*/locations/*/nodes/*}:start" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Node" + metadata_type: "OperationMetadata" + }; + } + + // Updates the configurations of a node. + rpc UpdateNode(UpdateNodeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2alpha1/{node.name=projects/*/locations/*/nodes/*}" + body: "node" + }; + option (google.api.method_signature) = "node,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Node" + metadata_type: "OperationMetadata" + }; + } + + // Generates the Cloud TPU service identity for the project. + rpc GenerateServiceIdentity(GenerateServiceIdentityRequest) + returns (GenerateServiceIdentityResponse) { + option (google.api.http) = { + post: "/v2alpha1/{parent=projects/*/locations/*}:generateServiceIdentity" + body: "*" + }; + } + + // Lists accelerator types supported by this API. + rpc ListAcceleratorTypes(ListAcceleratorTypesRequest) + returns (ListAcceleratorTypesResponse) { + option (google.api.http) = { + get: "/v2alpha1/{parent=projects/*/locations/*}/acceleratorTypes" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets AcceleratorType. + rpc GetAcceleratorType(GetAcceleratorTypeRequest) returns (AcceleratorType) { + option (google.api.http) = { + get: "/v2alpha1/{name=projects/*/locations/*/acceleratorTypes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists runtime versions supported by this API. + rpc ListRuntimeVersions(ListRuntimeVersionsRequest) + returns (ListRuntimeVersionsResponse) { + option (google.api.http) = { + get: "/v2alpha1/{parent=projects/*/locations/*}/runtimeVersions" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a runtime version. + rpc GetRuntimeVersion(GetRuntimeVersionRequest) returns (RuntimeVersion) { + option (google.api.http) = { + get: "/v2alpha1/{name=projects/*/locations/*/runtimeVersions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves the guest attributes for the node. + rpc GetGuestAttributes(GetGuestAttributesRequest) + returns (GetGuestAttributesResponse) { + option (google.api.http) = { + post: "/v2alpha1/{name=projects/*/locations/*/nodes/*}:getGuestAttributes" + body: "*" + }; + } +} + +// A guest attributes. +message GuestAttributes { + // The path to be queried. This can be the default namespace ('/') or a + // nested namespace ('/\/') or a specified key + // ('/\/\') + string query_path = 1; + + // The value of the requested queried path. + GuestAttributesValue query_value = 2; +} + +// Array of guest attribute namespace/key/value tuples. +message GuestAttributesValue { + // The list of guest attributes entries. + repeated GuestAttributesEntry items = 1; +} + +// A guest attributes namespace/key/value entry. +message GuestAttributesEntry { + // Namespace for the guest attribute entry. + string namespace = 1; + + // Key for the guest attribute entry. + string key = 2; + + // Value for the guest attribute entry. + string value = 3; +} + +// A node-attached disk resource. +// Next ID: 8; +message AttachedDisk { + // The different mode of the attached disk. + enum DiskMode { + // The disk mode is not known/set. + DISK_MODE_UNSPECIFIED = 0; + + // Attaches the disk in read-write mode. Only one TPU node can attach a disk + // in read-write mode at a time. + READ_WRITE = 1; + + // Attaches the disk in read-only mode. Multiple TPU nodes can attach + // a disk in read-only mode at a time. + READ_ONLY = 2; + } + + // Specifies the full path to an existing disk. + // For example: "projects/my-project/zones/us-central1-c/disks/my-disk". + string source_disk = 3; + + // The mode in which to attach this disk. + // If not specified, the default is READ_WRITE mode. + // Only applicable to data_disks. + DiskMode mode = 4; +} + +// 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 internal IP address of this network endpoint. + string ip_address = 1; + + // The port of this network endpoint. + int32 port = 2; + + // The access config for the TPU worker. + AccessConfig access_config = 5; +} + +// An access config attached to the TPU worker. +message AccessConfig { + // Output only. An external IP address associated with the TPU worker. + string external_ip = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Network related configurations. +message NetworkConfig { + // The name of the network for the TPU node. It must be a preexisting Google + // Compute Engine network. If none is provided, "default" will be used. + string network = 1; + + // The name of the subnetwork for the TPU node. It must be a preexisting + // Google Compute Engine subnetwork. If none is provided, "default" will be + // used. + string subnetwork = 2; + + // Indicates that external IP addresses would be associated with the TPU + // workers. If set to false, the specified subnetwork or network should have + // Private Google Access enabled. + bool enable_external_ips = 3; +} + +// A service account. +message ServiceAccount { + // Email address of the service account. If empty, default Compute service + // account will be used. + string email = 1; + + // The list of scopes to be made available for this service account. If empty, + // access to all Cloud APIs will be allowed. + repeated string scope = 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. + 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 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) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // 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. 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 runtime version running in the Node. + string runtime_version = 11 [(google.api.field_behavior) = REQUIRED]; + + // Network configurations for the TPU node. + NetworkConfig network_config = 36; + + // 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; + + // The Google Cloud Platform Service Account to be used by the TPU node VMs. + // If None is specified, the default compute service account will be used. + ServiceAccount service_account = 37; + + // 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 runtime 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; + + // Custom metadata to apply to the TPU Node. + // Can set startup-script and shutdown-script + map metadata = 34; + + // Tags to apply to the TPU Node. Tags are used to identify valid sources or + // targets for network firewalls. + repeated string tags = 40; + + // Output only. The unique identifier for the TPU Node. + int64 id = 33 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The additional data disks for the Node. + repeated AttachedDisk data_disks = 41; + + // 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.v2alpha1.Tpu.ListNodes]. +message ListNodesRequest { + // Required. The parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { 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.v2alpha1.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.v2alpha1.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.v2alpha1.Tpu.CreateNode]. +message CreateNodeRequest { + // Required. The parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // 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.v2alpha1.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 [StopNode][google.cloud.tpu.v2alpha1.Tpu.StopNode]. +message StopNodeRequest { + // The resource name. + string name = 1; +} + +// Request for [StartNode][google.cloud.tpu.v2alpha1.Tpu.StartNode]. +message StartNodeRequest { + // The resource name. + string name = 1; +} + +// Request for [UpdateNode][google.cloud.tpu.v2alpha1.Tpu.UpdateNode]. +message UpdateNodeRequest { + // Required. Mask of fields from [Node][Tpu.Node] to update. + // Supported fields: None. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The node. Only fields specified in update_mask are updated. + Node node = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The per-product per-project service identity for Cloud TPU service. +message ServiceIdentity { + // The email address of the service identity. + string email = 1; +} + +// Request for +// [GenerateServiceIdentity][google.cloud.tpu.v2alpha1.Tpu.GenerateServiceIdentity]. +message GenerateServiceIdentityRequest { + // Required. The parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; +} + +// Response for +// [GenerateServiceIdentity][google.cloud.tpu.v2alpha1.Tpu.GenerateServiceIdentity]. +message GenerateServiceIdentityResponse { + // ServiceIdentity that was created or retrieved. + ServiceIdentity identity = 1; +} + +// 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.v2alpha1.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.v2alpha1.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.v2alpha1.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 runtime version that a Node can be configured with. +message RuntimeVersion { + option (google.api.resource) = { + type: "tpu.googleapis.com/RuntimeVersion" + pattern: "projects/{project}/locations/{location}/runtimeVersions/{runtime_version}" + }; + + // The resource name. + string name = 1; + + // The runtime version. + string version = 2; +} + +// Request for +// [GetRuntimeVersion][google.cloud.tpu.v2alpha1.Tpu.GetRuntimeVersion]. +message GetRuntimeVersionRequest { + // Required. The resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "tpu.googleapis.com/RuntimeVersion" + } + ]; +} + +// Request for +// [ListRuntimeVersions][google.cloud.tpu.v2alpha1.Tpu.ListRuntimeVersions]. +message ListRuntimeVersionsRequest { + // Required. The parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "tpu.googleapis.com/RuntimeVersion" + } + ]; + + // 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 +// [ListRuntimeVersions][google.cloud.tpu.v2alpha1.Tpu.ListRuntimeVersions]. +message ListRuntimeVersionsResponse { + // The listed nodes. + repeated RuntimeVersion runtime_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 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; +} + +// Request for +// [GetGuestAttributes][google.cloud.tpu.v2alpha1.Tpu.GetGuestAttributes]. +message GetGuestAttributesRequest { + // Required. The resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "tpu.googleapis.com/Node" } + ]; + + // The guest attributes path to be queried. + string query_path = 2; + + // The 0-based worker ID. If it is empty, all workers' GuestAttributes will be + // returned. + repeated string worker_ids = 3; +} + +// Response for +// [GetGuestAttributes][google.cloud.tpu.v2alpha1.Tpu.GetGuestAttributes]. +message GetGuestAttributesResponse { + // The guest attributes for the TPU workers. + repeated GuestAttributes guest_attributes = 1; +} diff --git a/versions.txt b/versions.txt index d2c4d371..df7d4830 100644 --- a/versions.txt +++ b/versions.txt @@ -3,4 +3,6 @@ google-cloud-tpu:2.1.3:2.1.4-SNAPSHOT grpc-google-cloud-tpu-v1:2.1.3:2.1.4-SNAPSHOT +grpc-google-cloud-tpu-v2alpha1:2.1.3:2.1.4-SNAPSHOT proto-google-cloud-tpu-v1:2.1.3:2.1.4-SNAPSHOT +proto-google-cloud-tpu-v2alpha1:2.1.3:2.1.4-SNAPSHOT