From 5474c2f041c486b7c963037dcb4bbadab03ed8bb Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 19 Sep 2022 15:42:03 +0000 Subject: [PATCH] feat: Add Secure Boot support to TPU v2alpha1 API PiperOrigin-RevId: 474644226 Source-Link: https://github.com/googleapis/googleapis/commit/f90b329a7eb583a21a20796892b993e91e8ccf34 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4ad8763bde676f92a3eb70753ae1cfed0e81387e Copy-Tag: eyJwIjoiamF2YS10cHUvLk93bEJvdC55YW1sIiwiaCI6IjRhZDg3NjNiZGU2NzZmOTJhM2ViNzA3NTNhZTFjZmVkMGU4MTM4N2UifQ== --- .../com/google/cloud/tpu/v1/TpuClient.java | 1838 +++++ .../com/google/cloud/tpu/v1/TpuSettings.java | 371 + .../google/cloud/tpu/v1/gapic_metadata.json | 51 + .../com/google/cloud/tpu/v1/package-info.java | 43 + .../tpu/v1/stub/GrpcTpuCallableFactory.java | 113 + .../google/cloud/tpu/v1/stub/GrpcTpuStub.java | 582 ++ .../com/google/cloud/tpu/v1/stub/TpuStub.java | 148 + .../cloud/tpu/v1/stub/TpuStubSettings.java | 973 +++ .../java/com/google/cloud/tpu/v1/MockTpu.java | 59 + .../com/google/cloud/tpu/v1/MockTpuImpl.java | 288 + .../google/cloud/tpu/v1/TpuClientTest.java | 1083 +++ .../java/com/google/cloud/tpu/v1/TpuGrpc.java | 1168 ++++ .../google/cloud/tpu/v1/AcceleratorType.java | 761 ++ .../cloud/tpu/v1/AcceleratorTypeName.java | 227 + .../tpu/v1/AcceleratorTypeOrBuilder.java | 49 + .../google/cloud/tpu/v1/CloudTpuProto.java | 454 ++ .../cloud/tpu/v1/CreateNodeRequest.java | 997 +++ .../tpu/v1/CreateNodeRequestOrBuilder.java | 76 + .../cloud/tpu/v1/DeleteNodeRequest.java | 595 ++ .../tpu/v1/DeleteNodeRequestOrBuilder.java | 29 + .../tpu/v1/GetAcceleratorTypeRequest.java | 595 ++ .../GetAcceleratorTypeRequestOrBuilder.java | 29 + .../google/cloud/tpu/v1/GetNodeRequest.java | 595 ++ .../cloud/tpu/v1/GetNodeRequestOrBuilder.java | 29 + .../tpu/v1/GetTensorFlowVersionRequest.java | 595 ++ .../GetTensorFlowVersionRequestOrBuilder.java | 29 + .../tpu/v1/ListAcceleratorTypesRequest.java | 1173 ++++ .../ListAcceleratorTypesRequestOrBuilder.java | 99 + .../tpu/v1/ListAcceleratorTypesResponse.java | 1282 ++++ ...ListAcceleratorTypesResponseOrBuilder.java | 114 + .../google/cloud/tpu/v1/ListNodesRequest.java | 841 +++ .../tpu/v1/ListNodesRequestOrBuilder.java | 59 + .../cloud/tpu/v1/ListNodesResponse.java | 1282 ++++ .../tpu/v1/ListNodesResponseOrBuilder.java | 114 + .../tpu/v1/ListTensorFlowVersionsRequest.java | 1173 ++++ ...istTensorFlowVersionsRequestOrBuilder.java | 99 + .../v1/ListTensorFlowVersionsResponse.java | 1282 ++++ ...stTensorFlowVersionsResponseOrBuilder.java | 114 + .../com/google/cloud/tpu/v1/LocationName.java | 192 + .../google/cloud/tpu/v1/NetworkEndpoint.java | 675 ++ .../tpu/v1/NetworkEndpointOrBuilder.java | 39 + .../java/com/google/cloud/tpu/v1/Node.java | 5143 ++++++++++++++ .../com/google/cloud/tpu/v1/NodeName.java | 217 + .../google/cloud/tpu/v1/NodeOrBuilder.java | 528 ++ .../cloud/tpu/v1/OperationMetadata.java | 1653 +++++ .../tpu/v1/OperationMetadataOrBuilder.java | 155 + .../cloud/tpu/v1/ReimageNodeRequest.java | 761 ++ .../tpu/v1/ReimageNodeRequestOrBuilder.java | 49 + .../google/cloud/tpu/v1/SchedulingConfig.java | 591 ++ .../tpu/v1/SchedulingConfigOrBuilder.java | 29 + .../google/cloud/tpu/v1/StartNodeRequest.java | 595 ++ .../tpu/v1/StartNodeRequestOrBuilder.java | 29 + .../google/cloud/tpu/v1/StopNodeRequest.java | 595 ++ .../tpu/v1/StopNodeRequestOrBuilder.java | 29 + .../java/com/google/cloud/tpu/v1/Symptom.java | 1337 ++++ .../google/cloud/tpu/v1/SymptomOrBuilder.java | 95 + .../cloud/tpu/v1/TensorFlowVersion.java | 761 ++ .../cloud/tpu/v1/TensorFlowVersionName.java | 231 + .../tpu/v1/TensorFlowVersionOrBuilder.java | 49 + .../proto/google/cloud/tpu/v1/cloud_tpu.proto | 622 ++ .../tpustubsettings/getnode/SyncGetNode.java | 45 + .../SyncCreateSetCredentialsProvider.java | 44 + .../create/SyncCreateSetEndpoint.java | 40 + .../tpuclient/createnode/AsyncCreateNode.java | 52 + .../createnode/AsyncCreateNodeLRO.java | 53 + .../tpuclient/createnode/SyncCreateNode.java | 48 + .../SyncCreateNodeLocationnameNodeString.java | 44 + .../SyncCreateNodeStringNodeString.java | 44 + .../tpuclient/deletenode/AsyncDeleteNode.java | 49 + .../deletenode/AsyncDeleteNodeLRO.java | 51 + .../tpuclient/deletenode/SyncDeleteNode.java | 46 + .../deletenode/SyncDeleteNodeNodename.java | 42 + .../deletenode/SyncDeleteNodeString.java | 42 + .../AsyncGetAcceleratorType.java | 52 + .../SyncGetAcceleratorType.java | 48 + ...GetAcceleratorTypeAcceleratortypename.java | 43 + .../SyncGetAcceleratorTypeString.java | 43 + .../v1/tpuclient/getnode/AsyncGetNode.java | 49 + .../tpu/v1/tpuclient/getnode/SyncGetNode.java | 46 + .../getnode/SyncGetNodeNodename.java | 42 + .../tpuclient/getnode/SyncGetNodeString.java | 42 + .../AsyncGetTensorFlowVersion.java | 52 + .../SyncGetTensorFlowVersion.java | 48 + .../SyncGetTensorFlowVersionString.java | 43 + ...ensorFlowVersionTensorflowversionname.java | 43 + .../AsyncListAcceleratorTypes.java | 58 + .../AsyncListAcceleratorTypesPaged.java | 66 + .../SyncListAcceleratorTypes.java | 54 + ...stAcceleratorTypesAcceleratortypename.java | 45 + .../SyncListAcceleratorTypesString.java | 45 + .../tpuclient/listnodes/AsyncListNodes.java | 53 + .../listnodes/AsyncListNodesPaged.java | 61 + .../v1/tpuclient/listnodes/SyncListNodes.java | 50 + .../listnodes/SyncListNodesLocationname.java | 44 + .../listnodes/SyncListNodesString.java | 44 + .../AsyncListTensorFlowVersions.java | 58 + .../AsyncListTensorFlowVersionsPaged.java | 66 + .../SyncListTensorFlowVersions.java | 54 + .../SyncListTensorFlowVersionsString.java | 45 + ...nsorFlowVersionsTensorflowversionname.java | 45 + .../reimagenode/AsyncReimageNode.java | 49 + .../reimagenode/AsyncReimageNodeLRO.java | 51 + .../reimagenode/SyncReimageNode.java | 46 + .../tpuclient/startnode/AsyncStartNode.java | 45 + .../startnode/AsyncStartNodeLRO.java | 47 + .../v1/tpuclient/startnode/SyncStartNode.java | 42 + .../v1/tpuclient/stopnode/AsyncStopNode.java | 45 + .../tpuclient/stopnode/AsyncStopNodeLRO.java | 47 + .../v1/tpuclient/stopnode/SyncStopNode.java | 42 + .../v1/tpusettings/getnode/SyncGetNode.java | 45 + .../google/cloud/tpu/v2alpha1/TpuClient.java | 1977 ++++++ .../cloud/tpu/v2alpha1/TpuSettings.java | 394 ++ .../cloud/tpu/v2alpha1/gapic_metadata.json | 57 + .../cloud/tpu/v2alpha1/package-info.java | 45 + .../v2alpha1/stub/GrpcTpuCallableFactory.java | 115 + .../cloud/tpu/v2alpha1/stub/GrpcTpuStub.java | 655 ++ .../cloud/tpu/v2alpha1/stub/TpuStub.java | 162 + .../tpu/v2alpha1/stub/TpuStubSettings.java | 1018 +++ .../google/cloud/tpu/v2alpha1/MockTpu.java | 59 + .../cloud/tpu/v2alpha1/MockTpuImpl.java | 332 + .../cloud/tpu/v2alpha1/TpuClientTest.java | 1184 ++++ .../google/cloud/tpu/v2alpha1/TpuGrpc.java | 1340 ++++ .../cloud/tpu/v2alpha1/AcceleratorType.java | 761 ++ .../tpu/v2alpha1/AcceleratorTypeName.java | 227 + .../v2alpha1/AcceleratorTypeOrBuilder.java | 49 + .../cloud/tpu/v2alpha1/AccessConfig.java | 595 ++ .../tpu/v2alpha1/AccessConfigOrBuilder.java | 29 + .../cloud/tpu/v2alpha1/AttachedDisk.java | 891 +++ .../tpu/v2alpha1/AttachedDiskOrBuilder.java | 54 + .../cloud/tpu/v2alpha1/CloudTpuProto.java | 665 ++ .../cloud/tpu/v2alpha1/CreateNodeRequest.java | 997 +++ .../v2alpha1/CreateNodeRequestOrBuilder.java | 76 + .../cloud/tpu/v2alpha1/DeleteNodeRequest.java | 595 ++ .../v2alpha1/DeleteNodeRequestOrBuilder.java | 29 + .../GenerateServiceIdentityRequest.java | 597 ++ ...nerateServiceIdentityRequestOrBuilder.java | 29 + .../GenerateServiceIdentityResponse.java | 667 ++ ...erateServiceIdentityResponseOrBuilder.java | 36 + .../v2alpha1/GetAcceleratorTypeRequest.java | 597 ++ .../GetAcceleratorTypeRequestOrBuilder.java | 29 + .../v2alpha1/GetGuestAttributesRequest.java | 1023 +++ .../GetGuestAttributesRequestOrBuilder.java | 94 + .../v2alpha1/GetGuestAttributesResponse.java | 874 +++ .../GetGuestAttributesResponseOrBuilder.java | 53 + .../cloud/tpu/v2alpha1/GetNodeRequest.java | 595 ++ .../tpu/v2alpha1/GetNodeRequestOrBuilder.java | 29 + .../v2alpha1/GetRuntimeVersionRequest.java | 597 ++ .../GetRuntimeVersionRequestOrBuilder.java | 29 + .../cloud/tpu/v2alpha1/GuestAttributes.java | 845 +++ .../tpu/v2alpha1/GuestAttributesEntry.java | 927 +++ .../GuestAttributesEntryOrBuilder.java | 69 + .../v2alpha1/GuestAttributesOrBuilder.java | 60 + .../tpu/v2alpha1/GuestAttributesValue.java | 872 +++ .../GuestAttributesValueOrBuilder.java | 53 + .../v2alpha1/ListAcceleratorTypesRequest.java | 1175 ++++ .../ListAcceleratorTypesRequestOrBuilder.java | 99 + .../ListAcceleratorTypesResponse.java | 1284 ++++ ...ListAcceleratorTypesResponseOrBuilder.java | 114 + .../cloud/tpu/v2alpha1/ListNodesRequest.java | 841 +++ .../v2alpha1/ListNodesRequestOrBuilder.java | 59 + .../cloud/tpu/v2alpha1/ListNodesResponse.java | 1282 ++++ .../v2alpha1/ListNodesResponseOrBuilder.java | 114 + .../v2alpha1/ListRuntimeVersionsRequest.java | 1175 ++++ .../ListRuntimeVersionsRequestOrBuilder.java | 99 + .../v2alpha1/ListRuntimeVersionsResponse.java | 1284 ++++ .../ListRuntimeVersionsResponseOrBuilder.java | 114 + .../cloud/tpu/v2alpha1/LocationName.java | 192 + .../cloud/tpu/v2alpha1/NetworkConfig.java | 871 +++ .../tpu/v2alpha1/NetworkConfigOrBuilder.java | 67 + .../cloud/tpu/v2alpha1/NetworkEndpoint.java | 911 +++ .../v2alpha1/NetworkEndpointOrBuilder.java | 66 + .../com/google/cloud/tpu/v2alpha1/Node.java | 6092 +++++++++++++++++ .../google/cloud/tpu/v2alpha1/NodeName.java | 217 + .../cloud/tpu/v2alpha1/NodeOrBuilder.java | 654 ++ .../cloud/tpu/v2alpha1/OperationMetadata.java | 1653 +++++ .../v2alpha1/OperationMetadataOrBuilder.java | 155 + .../cloud/tpu/v2alpha1/RuntimeVersion.java | 761 ++ .../tpu/v2alpha1/RuntimeVersionName.java | 227 + .../tpu/v2alpha1/RuntimeVersionOrBuilder.java | 49 + .../cloud/tpu/v2alpha1/SchedulingConfig.java | 591 ++ .../v2alpha1/SchedulingConfigOrBuilder.java | 29 + .../cloud/tpu/v2alpha1/ServiceAccount.java | 862 +++ .../tpu/v2alpha1/ServiceAccountOrBuilder.java | 76 + .../cloud/tpu/v2alpha1/ServiceIdentity.java | 595 ++ .../v2alpha1/ServiceIdentityOrBuilder.java | 29 + .../tpu/v2alpha1/ShieldedInstanceConfig.java | 510 ++ .../ShieldedInstanceConfigOrBuilder.java | 19 + .../cloud/tpu/v2alpha1/StartNodeRequest.java | 595 ++ .../v2alpha1/StartNodeRequestOrBuilder.java | 29 + .../cloud/tpu/v2alpha1/StopNodeRequest.java | 595 ++ .../v2alpha1/StopNodeRequestOrBuilder.java | 29 + .../google/cloud/tpu/v2alpha1/Symptom.java | 1337 ++++ .../cloud/tpu/v2alpha1/SymptomOrBuilder.java | 95 + .../cloud/tpu/v2alpha1/UpdateNodeRequest.java | 913 +++ .../v2alpha1/UpdateNodeRequestOrBuilder.java | 66 + .../google/cloud/tpu/v2alpha1/cloud_tpu.proto | 791 +++ .../tpustubsettings/getnode/SyncGetNode.java | 45 + .../SyncCreateSetCredentialsProvider.java | 44 + .../create/SyncCreateSetEndpoint.java | 40 + .../tpuclient/createnode/AsyncCreateNode.java | 52 + .../createnode/AsyncCreateNodeLRO.java | 53 + .../tpuclient/createnode/SyncCreateNode.java | 48 + .../SyncCreateNodeLocationnameNodeString.java | 44 + .../SyncCreateNodeStringNodeString.java | 44 + .../tpuclient/deletenode/AsyncDeleteNode.java | 49 + .../deletenode/AsyncDeleteNodeLRO.java | 51 + .../tpuclient/deletenode/SyncDeleteNode.java | 46 + .../deletenode/SyncDeleteNodeNodename.java | 42 + .../deletenode/SyncDeleteNodeString.java | 42 + .../AsyncGenerateServiceIdentity.java | 50 + .../SyncGenerateServiceIdentity.java | 46 + .../AsyncGetAcceleratorType.java | 52 + .../SyncGetAcceleratorType.java | 48 + ...GetAcceleratorTypeAcceleratortypename.java | 43 + .../SyncGetAcceleratorTypeString.java | 43 + .../AsyncGetGuestAttributes.java | 53 + .../SyncGetGuestAttributes.java | 49 + .../tpuclient/getnode/AsyncGetNode.java | 49 + .../tpuclient/getnode/SyncGetNode.java | 46 + .../getnode/SyncGetNodeNodename.java | 42 + .../tpuclient/getnode/SyncGetNodeString.java | 42 + .../AsyncGetRuntimeVersion.java | 50 + .../SyncGetRuntimeVersion.java | 47 + ...ncGetRuntimeVersionRuntimeversionname.java | 43 + .../SyncGetRuntimeVersionString.java | 43 + .../AsyncListAcceleratorTypes.java | 58 + .../AsyncListAcceleratorTypesPaged.java | 66 + .../SyncListAcceleratorTypes.java | 54 + ...stAcceleratorTypesAcceleratortypename.java | 45 + .../SyncListAcceleratorTypesString.java | 45 + .../tpuclient/listnodes/AsyncListNodes.java | 53 + .../listnodes/AsyncListNodesPaged.java | 61 + .../tpuclient/listnodes/SyncListNodes.java | 50 + .../listnodes/SyncListNodesNodename.java | 44 + .../listnodes/SyncListNodesString.java | 44 + .../AsyncListRuntimeVersions.java | 57 + .../AsyncListRuntimeVersionsPaged.java | 65 + .../SyncListRuntimeVersions.java | 53 + ...ListRuntimeVersionsRuntimeversionname.java | 45 + .../SyncListRuntimeVersionsString.java | 45 + .../tpuclient/startnode/AsyncStartNode.java | 45 + .../startnode/AsyncStartNodeLRO.java | 47 + .../tpuclient/startnode/SyncStartNode.java | 42 + .../tpuclient/stopnode/AsyncStopNode.java | 45 + .../tpuclient/stopnode/AsyncStopNodeLRO.java | 47 + .../tpuclient/stopnode/SyncStopNode.java | 42 + .../tpuclient/updatenode/AsyncUpdateNode.java | 51 + .../updatenode/AsyncUpdateNodeLRO.java | 52 + .../tpuclient/updatenode/SyncUpdateNode.java | 47 + .../SyncUpdateNodeNodeFieldmask.java | 43 + .../tpusettings/getnode/SyncGetNode.java | 45 + 251 files changed, 85916 insertions(+) create mode 100644 owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuClient.java create mode 100644 owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuSettings.java create mode 100644 owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/gapic_metadata.json create mode 100644 owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/package-info.java create mode 100644 owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/GrpcTpuCallableFactory.java create mode 100644 owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/GrpcTpuStub.java create mode 100644 owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStub.java create mode 100644 owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStubSettings.java create mode 100644 owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/MockTpu.java create mode 100644 owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/MockTpuImpl.java create mode 100644 owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/TpuClientTest.java create mode 100644 owl-bot-staging/java-tpu/v1/grpc-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TpuGrpc.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorType.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorTypeName.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorTypeOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CloudTpuProto.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CreateNodeRequest.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CreateNodeRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/DeleteNodeRequest.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/DeleteNodeRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetAcceleratorTypeRequest.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetAcceleratorTypeRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetNodeRequest.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetNodeRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetTensorFlowVersionRequest.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetTensorFlowVersionRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesRequest.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesResponse.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesResponseOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesRequest.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesResponse.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesResponseOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsRequest.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsResponse.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsResponseOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/LocationName.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NetworkEndpoint.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NetworkEndpointOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/Node.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NodeName.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NodeOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/OperationMetadata.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/OperationMetadataOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ReimageNodeRequest.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ReimageNodeRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SchedulingConfig.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SchedulingConfigOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StartNodeRequest.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StartNodeRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StopNodeRequest.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StopNodeRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/Symptom.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SymptomOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersion.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersionName.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersionOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/proto/google/cloud/tpu/v1/cloud_tpu.proto create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/stub/tpustubsettings/getnode/SyncGetNode.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/create/SyncCreateSetCredentialsProvider.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/create/SyncCreateSetEndpoint.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/createnode/AsyncCreateNode.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/createnode/AsyncCreateNodeLRO.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/createnode/SyncCreateNode.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/createnode/SyncCreateNodeLocationnameNodeString.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/createnode/SyncCreateNodeStringNodeString.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/deletenode/AsyncDeleteNode.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/deletenode/AsyncDeleteNodeLRO.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/deletenode/SyncDeleteNode.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/deletenode/SyncDeleteNodeNodename.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/deletenode/SyncDeleteNodeString.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getacceleratortype/AsyncGetAcceleratorType.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getacceleratortype/SyncGetAcceleratorType.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getacceleratortype/SyncGetAcceleratorTypeAcceleratortypename.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getacceleratortype/SyncGetAcceleratorTypeString.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getnode/AsyncGetNode.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getnode/SyncGetNode.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getnode/SyncGetNodeNodename.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getnode/SyncGetNodeString.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/gettensorflowversion/AsyncGetTensorFlowVersion.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/gettensorflowversion/SyncGetTensorFlowVersion.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/gettensorflowversion/SyncGetTensorFlowVersionString.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/gettensorflowversion/SyncGetTensorFlowVersionTensorflowversionname.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listacceleratortypes/AsyncListAcceleratorTypes.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listacceleratortypes/AsyncListAcceleratorTypesPaged.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listacceleratortypes/SyncListAcceleratorTypes.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listacceleratortypes/SyncListAcceleratorTypesAcceleratortypename.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listacceleratortypes/SyncListAcceleratorTypesString.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listnodes/AsyncListNodes.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listnodes/AsyncListNodesPaged.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listnodes/SyncListNodes.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listnodes/SyncListNodesLocationname.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listnodes/SyncListNodesString.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listtensorflowversions/AsyncListTensorFlowVersions.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listtensorflowversions/AsyncListTensorFlowVersionsPaged.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listtensorflowversions/SyncListTensorFlowVersions.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listtensorflowversions/SyncListTensorFlowVersionsString.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listtensorflowversions/SyncListTensorFlowVersionsTensorflowversionname.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/reimagenode/AsyncReimageNode.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/reimagenode/AsyncReimageNodeLRO.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/reimagenode/SyncReimageNode.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/startnode/AsyncStartNode.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/startnode/AsyncStartNodeLRO.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/startnode/SyncStartNode.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/stopnode/AsyncStopNode.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/stopnode/AsyncStopNodeLRO.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/stopnode/SyncStopNode.java create mode 100644 owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpusettings/getnode/SyncGetNode.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuClient.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuSettings.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/gapic_metadata.json create mode 100644 owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/package-info.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/GrpcTpuCallableFactory.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/GrpcTpuStub.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStub.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStubSettings.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockTpu.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockTpuImpl.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/TpuClientTest.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/grpc-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/TpuGrpc.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorType.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorTypeName.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorTypeOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AccessConfig.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AccessConfigOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AttachedDisk.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AttachedDiskOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CloudTpuProto.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CreateNodeRequest.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CreateNodeRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteNodeRequest.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteNodeRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityRequest.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityResponse.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityResponseOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetAcceleratorTypeRequest.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetAcceleratorTypeRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesRequest.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesResponse.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesResponseOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetNodeRequest.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetNodeRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetRuntimeVersionRequest.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetRuntimeVersionRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributes.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesEntry.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesEntryOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesValue.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesValueOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesRequest.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesResponse.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesResponseOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesRequest.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesResponse.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesResponseOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsRequest.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsResponse.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsResponseOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/LocationName.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfig.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfigOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkEndpoint.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkEndpointOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/Node.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NodeName.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NodeOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/OperationMetadata.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/OperationMetadataOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersion.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersionName.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersionOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SchedulingConfig.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SchedulingConfigOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceAccount.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceAccountOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceIdentity.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceIdentityOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ShieldedInstanceConfig.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ShieldedInstanceConfigOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StartNodeRequest.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StartNodeRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StopNodeRequest.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StopNodeRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/Symptom.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SymptomOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequest.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequestOrBuilder.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/proto/google/cloud/tpu/v2alpha1/cloud_tpu.proto create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/stub/tpustubsettings/getnode/SyncGetNode.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/create/SyncCreateSetCredentialsProvider.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/create/SyncCreateSetEndpoint.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/createnode/AsyncCreateNode.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/createnode/AsyncCreateNodeLRO.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/createnode/SyncCreateNode.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/createnode/SyncCreateNodeLocationnameNodeString.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/createnode/SyncCreateNodeStringNodeString.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/deletenode/AsyncDeleteNode.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/deletenode/AsyncDeleteNodeLRO.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/deletenode/SyncDeleteNode.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/deletenode/SyncDeleteNodeNodename.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/deletenode/SyncDeleteNodeString.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/generateserviceidentity/AsyncGenerateServiceIdentity.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/generateserviceidentity/SyncGenerateServiceIdentity.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getacceleratortype/AsyncGetAcceleratorType.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getacceleratortype/SyncGetAcceleratorType.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getacceleratortype/SyncGetAcceleratorTypeAcceleratortypename.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getacceleratortype/SyncGetAcceleratorTypeString.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getguestattributes/AsyncGetGuestAttributes.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getguestattributes/SyncGetGuestAttributes.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getnode/AsyncGetNode.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getnode/SyncGetNode.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getnode/SyncGetNodeNodename.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getnode/SyncGetNodeString.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getruntimeversion/AsyncGetRuntimeVersion.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getruntimeversion/SyncGetRuntimeVersion.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getruntimeversion/SyncGetRuntimeVersionRuntimeversionname.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getruntimeversion/SyncGetRuntimeVersionString.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listacceleratortypes/AsyncListAcceleratorTypes.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listacceleratortypes/AsyncListAcceleratorTypesPaged.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listacceleratortypes/SyncListAcceleratorTypes.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listacceleratortypes/SyncListAcceleratorTypesAcceleratortypename.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listacceleratortypes/SyncListAcceleratorTypesString.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listnodes/AsyncListNodes.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listnodes/AsyncListNodesPaged.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listnodes/SyncListNodes.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listnodes/SyncListNodesNodename.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listnodes/SyncListNodesString.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listruntimeversions/AsyncListRuntimeVersions.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listruntimeversions/AsyncListRuntimeVersionsPaged.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listruntimeversions/SyncListRuntimeVersions.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listruntimeversions/SyncListRuntimeVersionsRuntimeversionname.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listruntimeversions/SyncListRuntimeVersionsString.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/startnode/AsyncStartNode.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/startnode/AsyncStartNodeLRO.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/startnode/SyncStartNode.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/stopnode/AsyncStopNode.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/stopnode/AsyncStopNodeLRO.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/stopnode/SyncStopNode.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/updatenode/AsyncUpdateNode.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/updatenode/AsyncUpdateNodeLRO.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/updatenode/SyncUpdateNode.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/updatenode/SyncUpdateNodeNodeFieldmask.java create mode 100644 owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpusettings/getnode/SyncGetNode.java diff --git a/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuClient.java b/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuClient.java new file mode 100644 index 000000000000..6f541fed9c6f --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuClient.java @@ -0,0 +1,1838 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.tpu.v1.stub.TpuStub; +import com.google.cloud.tpu.v1.stub.TpuStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Manages TPU nodes and other resources + * + *

TPU API v1 + * + *

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

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * 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
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * TpuSettings tpuSettings =
+ *     TpuSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * TpuClient tpuClient = TpuClient.create(tpuSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * TpuSettings tpuSettings = TpuSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * TpuClient tpuClient = TpuClient.create(tpuSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class TpuClient implements BackgroundResource { + private final TpuSettings settings; + private final TpuStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of TpuClient with default settings. */ + public static final TpuClient create() throws IOException { + return create(TpuSettings.newBuilder().build()); + } + + /** + * Constructs an instance of TpuClient, using the given settings. The channels are created based + * on the settings passed in, or defaults for any settings that are not set. + */ + public static final TpuClient create(TpuSettings settings) throws IOException { + return new TpuClient(settings); + } + + /** + * Constructs an instance of TpuClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(TpuSettings). + */ + 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()); + } + + protected TpuClient(TpuStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final TpuSettings getSettings() { + return settings; + } + + 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Node element : tpuClient.listNodes(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListNodesPagedResponse listNodes(LocationName parent) { + ListNodesRequest request = + ListNodesRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listNodes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists nodes. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   ListNodesRequest request =
+   *       ListNodesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   ListNodesRequest request =
+   *       ListNodesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   ListNodesRequest request =
+   *       ListNodesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListNodesResponse response = tpuClient.listNodesCallable().call(request);
+   *     for (Node element : response.getNodesList()) {
+   *       // 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   DeleteNodeRequest request =
+   *       DeleteNodeRequest.newBuilder()
+   *           .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
+   *           .build();
+   *   ApiFuture future = tpuClient.deleteNodeCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteNodeCallable() { + return stub.deleteNodeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reimages a node's OS. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   ReimageNodeRequest request =
+   *       ReimageNodeRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setTensorflowVersion("tensorflowVersion-470125103")
+   *           .build();
+   *   Node response = tpuClient.reimageNodeAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture reimageNodeAsync( + ReimageNodeRequest request) { + return reimageNodeOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reimages a node's OS. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   ReimageNodeRequest request =
+   *       ReimageNodeRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setTensorflowVersion("tensorflowVersion-470125103")
+   *           .build();
+   *   OperationFuture future =
+   *       tpuClient.reimageNodeOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Node response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + reimageNodeOperationCallable() { + return stub.reimageNodeOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reimages a node's OS. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   ReimageNodeRequest request =
+   *       ReimageNodeRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setTensorflowVersion("tensorflowVersion-470125103")
+   *           .build();
+   *   ApiFuture future = tpuClient.reimageNodeCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable reimageNodeCallable() { + return stub.reimageNodeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Stops a node. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   StopNodeRequest request = StopNodeRequest.newBuilder().setName("name3373707").build();
+   *   Node response = tpuClient.stopNodeAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture stopNodeAsync(StopNodeRequest request) { + return stopNodeOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Stops a node. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   StopNodeRequest request = StopNodeRequest.newBuilder().setName("name3373707").build();
+   *   OperationFuture future =
+   *       tpuClient.stopNodeOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Node response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + stopNodeOperationCallable() { + return stub.stopNodeOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Stops a node. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   StartNodeRequest request = StartNodeRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = tpuClient.startNodeCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable startNodeCallable() { + return stub.startNodeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List TensorFlow versions supported by this API. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   TensorFlowVersionName parent =
+   *       TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]");
+   *   for (TensorFlowVersion element : tpuClient.listTensorFlowVersions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTensorFlowVersionsPagedResponse listTensorFlowVersions( + TensorFlowVersionName parent) { + ListTensorFlowVersionsRequest request = + ListTensorFlowVersionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listTensorFlowVersions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List TensorFlow versions supported by this API. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   String parent =
+   *       TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]").toString();
+   *   for (TensorFlowVersion element : tpuClient.listTensorFlowVersions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTensorFlowVersionsPagedResponse listTensorFlowVersions(String parent) { + ListTensorFlowVersionsRequest request = + ListTensorFlowVersionsRequest.newBuilder().setParent(parent).build(); + return listTensorFlowVersions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List TensorFlow versions supported by this API. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   ListTensorFlowVersionsRequest request =
+   *       ListTensorFlowVersionsRequest.newBuilder()
+   *           .setParent(
+   *               TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (TensorFlowVersion element : tpuClient.listTensorFlowVersions(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTensorFlowVersionsPagedResponse listTensorFlowVersions( + ListTensorFlowVersionsRequest request) { + return listTensorFlowVersionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List TensorFlow versions supported by this API. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   ListTensorFlowVersionsRequest request =
+   *       ListTensorFlowVersionsRequest.newBuilder()
+   *           .setParent(
+   *               TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       tpuClient.listTensorFlowVersionsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (TensorFlowVersion element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listTensorFlowVersionsPagedCallable() { + return stub.listTensorFlowVersionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List TensorFlow versions supported by this API. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   ListTensorFlowVersionsRequest request =
+   *       ListTensorFlowVersionsRequest.newBuilder()
+   *           .setParent(
+   *               TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListTensorFlowVersionsResponse response =
+   *         tpuClient.listTensorFlowVersionsCallable().call(request);
+   *     for (TensorFlowVersion element : response.getTensorflowVersionsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listTensorFlowVersionsCallable() { + return stub.listTensorFlowVersionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets TensorFlow Version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   TensorFlowVersionName name =
+   *       TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]");
+   *   TensorFlowVersion response = tpuClient.getTensorFlowVersion(name);
+   * }
+   * }
+ * + * @param name Required. The resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TensorFlowVersion getTensorFlowVersion(TensorFlowVersionName name) { + GetTensorFlowVersionRequest request = + GetTensorFlowVersionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getTensorFlowVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets TensorFlow Version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   String name =
+   *       TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]").toString();
+   *   TensorFlowVersion response = tpuClient.getTensorFlowVersion(name);
+   * }
+   * }
+ * + * @param name Required. The resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TensorFlowVersion getTensorFlowVersion(String name) { + GetTensorFlowVersionRequest request = + GetTensorFlowVersionRequest.newBuilder().setName(name).build(); + return getTensorFlowVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets TensorFlow Version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   GetTensorFlowVersionRequest request =
+   *       GetTensorFlowVersionRequest.newBuilder()
+   *           .setName(
+   *               TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   TensorFlowVersion response = tpuClient.getTensorFlowVersion(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TensorFlowVersion getTensorFlowVersion(GetTensorFlowVersionRequest request) { + return getTensorFlowVersionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets TensorFlow Version. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   GetTensorFlowVersionRequest request =
+   *       GetTensorFlowVersionRequest.newBuilder()
+   *           .setName(
+   *               TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       tpuClient.getTensorFlowVersionCallable().futureCall(request);
+   *   // Do something.
+   *   TensorFlowVersion response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getTensorFlowVersionCallable() { + return stub.getTensorFlowVersionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists accelerator types supported by this API. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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.getAcceleratorTypesList()) {
+   *       // 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (TpuClient tpuClient = TpuClient.create()) {
+   *   GetAcceleratorTypeRequest request =
+   *       GetAcceleratorTypeRequest.newBuilder()
+   *           .setName(
+   *               AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       tpuClient.getAcceleratorTypeCallable().futureCall(request);
+   *   // Do something.
+   *   AcceleratorType response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getAcceleratorTypeCallable() { + return stub.getAcceleratorTypeCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListNodesPagedResponse + extends AbstractPagedListResponse< + ListNodesRequest, ListNodesResponse, Node, ListNodesPage, ListNodesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListNodesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, 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 ListTensorFlowVersionsPagedResponse + extends AbstractPagedListResponse< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + TensorFlowVersion, + ListTensorFlowVersionsPage, + ListTensorFlowVersionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListTensorFlowVersionsRequest, ListTensorFlowVersionsResponse, TensorFlowVersion> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListTensorFlowVersionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListTensorFlowVersionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListTensorFlowVersionsPagedResponse(ListTensorFlowVersionsPage page) { + super(page, ListTensorFlowVersionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListTensorFlowVersionsPage + extends AbstractPage< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + TensorFlowVersion, + ListTensorFlowVersionsPage> { + + private ListTensorFlowVersionsPage( + PageContext< + ListTensorFlowVersionsRequest, ListTensorFlowVersionsResponse, TensorFlowVersion> + context, + ListTensorFlowVersionsResponse response) { + super(context, response); + } + + private static ListTensorFlowVersionsPage createEmptyPage() { + return new ListTensorFlowVersionsPage(null, null); + } + + @Override + protected ListTensorFlowVersionsPage createPage( + PageContext< + ListTensorFlowVersionsRequest, ListTensorFlowVersionsResponse, TensorFlowVersion> + context, + ListTensorFlowVersionsResponse response) { + return new ListTensorFlowVersionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListTensorFlowVersionsRequest, ListTensorFlowVersionsResponse, TensorFlowVersion> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListTensorFlowVersionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + TensorFlowVersion, + ListTensorFlowVersionsPage, + ListTensorFlowVersionsFixedSizeCollection> { + + private ListTensorFlowVersionsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListTensorFlowVersionsFixedSizeCollection createEmptyCollection() { + return new ListTensorFlowVersionsFixedSizeCollection(null, 0); + } + + @Override + protected ListTensorFlowVersionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListTensorFlowVersionsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListAcceleratorTypesPagedResponse + extends AbstractPagedListResponse< + ListAcceleratorTypesRequest, + ListAcceleratorTypesResponse, + AcceleratorType, + ListAcceleratorTypesPage, + ListAcceleratorTypesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListAcceleratorTypesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + 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); + } + } +} diff --git a/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuSettings.java b/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuSettings.java new file mode 100644 index 000000000000..d427f4ff75ba --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuSettings.java @@ -0,0 +1,371 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1; + +import static com.google.cloud.tpu.v1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListTensorFlowVersionsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.tpu.v1.stub.TpuStubSettings; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link TpuClient}. + * + *

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

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

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

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

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * TpuSettings.Builder tpuSettingsBuilder = TpuSettings.newBuilder();
+ * tpuSettingsBuilder
+ *     .getNodeSettings()
+ *     .setRetrySettings(
+ *         tpuSettingsBuilder.getNodeSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * TpuSettings tpuSettings = tpuSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class TpuSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listNodes. */ + public PagedCallSettings + listNodesSettings() { + return ((TpuStubSettings) getStubSettings()).listNodesSettings(); + } + + /** Returns the object with the settings used for calls to getNode. */ + public UnaryCallSettings getNodeSettings() { + return ((TpuStubSettings) getStubSettings()).getNodeSettings(); + } + + /** Returns the object with the settings used for calls to createNode. */ + public UnaryCallSettings createNodeSettings() { + return ((TpuStubSettings) getStubSettings()).createNodeSettings(); + } + + /** Returns the object with the settings used for calls to createNode. */ + public OperationCallSettings + createNodeOperationSettings() { + return ((TpuStubSettings) getStubSettings()).createNodeOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteNode. */ + public UnaryCallSettings deleteNodeSettings() { + return ((TpuStubSettings) getStubSettings()).deleteNodeSettings(); + } + + /** Returns the object with the settings used for calls to deleteNode. */ + public OperationCallSettings + deleteNodeOperationSettings() { + return ((TpuStubSettings) getStubSettings()).deleteNodeOperationSettings(); + } + + /** Returns the object with the settings used for calls to reimageNode. */ + public UnaryCallSettings reimageNodeSettings() { + return ((TpuStubSettings) getStubSettings()).reimageNodeSettings(); + } + + /** Returns the object with the settings used for calls to reimageNode. */ + public OperationCallSettings + reimageNodeOperationSettings() { + return ((TpuStubSettings) getStubSettings()).reimageNodeOperationSettings(); + } + + /** Returns the object with the settings used for calls to stopNode. */ + public UnaryCallSettings stopNodeSettings() { + return ((TpuStubSettings) getStubSettings()).stopNodeSettings(); + } + + /** Returns the object with the settings used for calls to stopNode. */ + public OperationCallSettings + stopNodeOperationSettings() { + return ((TpuStubSettings) getStubSettings()).stopNodeOperationSettings(); + } + + /** Returns the object with the settings used for calls to startNode. */ + public UnaryCallSettings startNodeSettings() { + return ((TpuStubSettings) getStubSettings()).startNodeSettings(); + } + + /** Returns the object with the settings used for calls to startNode. */ + public OperationCallSettings + startNodeOperationSettings() { + return ((TpuStubSettings) getStubSettings()).startNodeOperationSettings(); + } + + /** Returns the object with the settings used for calls to listTensorFlowVersions. */ + public PagedCallSettings< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + ListTensorFlowVersionsPagedResponse> + listTensorFlowVersionsSettings() { + return ((TpuStubSettings) getStubSettings()).listTensorFlowVersionsSettings(); + } + + /** Returns the object with the settings used for calls to getTensorFlowVersion. */ + public UnaryCallSettings + getTensorFlowVersionSettings() { + return ((TpuStubSettings) getStubSettings()).getTensorFlowVersionSettings(); + } + + /** Returns the object with the settings used for calls to listAcceleratorTypes. */ + public PagedCallSettings< + ListAcceleratorTypesRequest, + ListAcceleratorTypesResponse, + ListAcceleratorTypesPagedResponse> + listAcceleratorTypesSettings() { + return ((TpuStubSettings) getStubSettings()).listAcceleratorTypesSettings(); + } + + /** Returns the object with the settings used for calls to getAcceleratorType. */ + public UnaryCallSettings + getAcceleratorTypeSettings() { + return ((TpuStubSettings) getStubSettings()).getAcceleratorTypeSettings(); + } + + public static final TpuSettings create(TpuStubSettings stub) throws IOException { + return new TpuSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return TpuStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return TpuStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return TpuStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return TpuStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return TpuStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return TpuStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TpuStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected TpuSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for TpuSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(TpuStubSettings.newBuilder(clientContext)); + } + + protected Builder(TpuSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(TpuStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(TpuStubSettings.newBuilder()); + } + + public TpuStubSettings.Builder getStubSettingsBuilder() { + return ((TpuStubSettings.Builder) getStubSettings()); + } + + /** + * 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 reimageNode. */ + public UnaryCallSettings.Builder reimageNodeSettings() { + return getStubSettingsBuilder().reimageNodeSettings(); + } + + /** Returns the builder for the settings used for calls to reimageNode. */ + public OperationCallSettings.Builder + reimageNodeOperationSettings() { + return getStubSettingsBuilder().reimageNodeOperationSettings(); + } + + /** Returns the builder for the settings used for calls to stopNode. */ + public UnaryCallSettings.Builder stopNodeSettings() { + return getStubSettingsBuilder().stopNodeSettings(); + } + + /** Returns the builder for the settings used for calls to stopNode. */ + public OperationCallSettings.Builder + stopNodeOperationSettings() { + return getStubSettingsBuilder().stopNodeOperationSettings(); + } + + /** Returns the builder for the settings used for calls to startNode. */ + public UnaryCallSettings.Builder startNodeSettings() { + return getStubSettingsBuilder().startNodeSettings(); + } + + /** Returns the builder for the settings used for calls to startNode. */ + public OperationCallSettings.Builder + startNodeOperationSettings() { + return getStubSettingsBuilder().startNodeOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listTensorFlowVersions. */ + public PagedCallSettings.Builder< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + ListTensorFlowVersionsPagedResponse> + listTensorFlowVersionsSettings() { + return getStubSettingsBuilder().listTensorFlowVersionsSettings(); + } + + /** Returns the builder for the settings used for calls to getTensorFlowVersion. */ + public UnaryCallSettings.Builder + getTensorFlowVersionSettings() { + return getStubSettingsBuilder().getTensorFlowVersionSettings(); + } + + /** Returns the builder for the settings used for calls to listAcceleratorTypes. */ + public PagedCallSettings.Builder< + ListAcceleratorTypesRequest, + ListAcceleratorTypesResponse, + ListAcceleratorTypesPagedResponse> + listAcceleratorTypesSettings() { + return getStubSettingsBuilder().listAcceleratorTypesSettings(); + } + + /** Returns the builder for the settings used for calls to getAcceleratorType. */ + public UnaryCallSettings.Builder + getAcceleratorTypeSettings() { + return getStubSettingsBuilder().getAcceleratorTypeSettings(); + } + + @Override + public TpuSettings build() throws IOException { + return new TpuSettings(this); + } + } +} diff --git a/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/gapic_metadata.json b/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/gapic_metadata.json new file mode 100644 index 000000000000..6226bd981dce --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/gapic_metadata.json @@ -0,0 +1,51 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.tpu.v1", + "libraryPackage": "com.google.cloud.tpu.v1", + "services": { + "Tpu": { + "clients": { + "grpc": { + "libraryClient": "TpuClient", + "rpcs": { + "CreateNode": { + "methods": ["createNodeAsync", "createNodeAsync", "createNodeAsync", "createNodeOperationCallable", "createNodeCallable"] + }, + "DeleteNode": { + "methods": ["deleteNodeAsync", "deleteNodeAsync", "deleteNodeAsync", "deleteNodeOperationCallable", "deleteNodeCallable"] + }, + "GetAcceleratorType": { + "methods": ["getAcceleratorType", "getAcceleratorType", "getAcceleratorType", "getAcceleratorTypeCallable"] + }, + "GetNode": { + "methods": ["getNode", "getNode", "getNode", "getNodeCallable"] + }, + "GetTensorFlowVersion": { + "methods": ["getTensorFlowVersion", "getTensorFlowVersion", "getTensorFlowVersion", "getTensorFlowVersionCallable"] + }, + "ListAcceleratorTypes": { + "methods": ["listAcceleratorTypes", "listAcceleratorTypes", "listAcceleratorTypes", "listAcceleratorTypesPagedCallable", "listAcceleratorTypesCallable"] + }, + "ListNodes": { + "methods": ["listNodes", "listNodes", "listNodes", "listNodesPagedCallable", "listNodesCallable"] + }, + "ListTensorFlowVersions": { + "methods": ["listTensorFlowVersions", "listTensorFlowVersions", "listTensorFlowVersions", "listTensorFlowVersionsPagedCallable", "listTensorFlowVersionsCallable"] + }, + "ReimageNode": { + "methods": ["reimageNodeAsync", "reimageNodeOperationCallable", "reimageNodeCallable"] + }, + "StartNode": { + "methods": ["startNodeAsync", "startNodeOperationCallable", "startNodeCallable"] + }, + "StopNode": { + "methods": ["stopNodeAsync", "stopNodeOperationCallable", "stopNodeCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/package-info.java b/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/package-info.java new file mode 100644 index 000000000000..98f17162ac91 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/package-info.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The interfaces provided are listed below, along with usage samples. + * + *

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

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

TPU API v1 + * + *

Sample for TpuClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (TpuClient tpuClient = TpuClient.create()) {
+ *   NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]");
+ *   Node response = tpuClient.getNode(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.tpu.v1; + +import javax.annotation.Generated; diff --git a/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/GrpcTpuCallableFactory.java b/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/GrpcTpuCallableFactory.java new file mode 100644 index 000000000000..b38cbf30ca57 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/GrpcTpuCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Tpu service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcTpuCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/GrpcTpuStub.java b/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/GrpcTpuStub.java new file mode 100644 index 000000000000..1821526d47ee --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/GrpcTpuStub.java @@ -0,0 +1,582 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.stub; + +import static com.google.cloud.tpu.v1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListTensorFlowVersionsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.tpu.v1.AcceleratorType; +import com.google.cloud.tpu.v1.CreateNodeRequest; +import com.google.cloud.tpu.v1.DeleteNodeRequest; +import com.google.cloud.tpu.v1.GetAcceleratorTypeRequest; +import com.google.cloud.tpu.v1.GetNodeRequest; +import com.google.cloud.tpu.v1.GetTensorFlowVersionRequest; +import com.google.cloud.tpu.v1.ListAcceleratorTypesRequest; +import com.google.cloud.tpu.v1.ListAcceleratorTypesResponse; +import com.google.cloud.tpu.v1.ListNodesRequest; +import com.google.cloud.tpu.v1.ListNodesResponse; +import com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest; +import com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse; +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.OperationMetadata; +import com.google.cloud.tpu.v1.ReimageNodeRequest; +import com.google.cloud.tpu.v1.StartNodeRequest; +import com.google.cloud.tpu.v1.StopNodeRequest; +import com.google.cloud.tpu.v1.TensorFlowVersion; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Tpu service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcTpuStub extends TpuStub { + private static final MethodDescriptor + listNodesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v1.Tpu/ListNodes") + .setRequestMarshaller(ProtoUtils.marshaller(ListNodesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListNodesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getNodeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v1.Tpu/GetNode") + .setRequestMarshaller(ProtoUtils.marshaller(GetNodeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Node.getDefaultInstance())) + .build(); + + private static final MethodDescriptor createNodeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v1.Tpu/CreateNode") + .setRequestMarshaller(ProtoUtils.marshaller(CreateNodeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteNodeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v1.Tpu/DeleteNode") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteNodeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor reimageNodeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v1.Tpu/ReimageNode") + .setRequestMarshaller(ProtoUtils.marshaller(ReimageNodeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor stopNodeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v1.Tpu/StopNode") + .setRequestMarshaller(ProtoUtils.marshaller(StopNodeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor startNodeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v1.Tpu/StartNode") + .setRequestMarshaller(ProtoUtils.marshaller(StartNodeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + ListTensorFlowVersionsRequest, ListTensorFlowVersionsResponse> + listTensorFlowVersionsMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v1.Tpu/ListTensorFlowVersions") + .setRequestMarshaller( + ProtoUtils.marshaller(ListTensorFlowVersionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListTensorFlowVersionsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getTensorFlowVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v1.Tpu/GetTensorFlowVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(GetTensorFlowVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(TensorFlowVersion.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listAcceleratorTypesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v1.Tpu/ListAcceleratorTypes") + .setRequestMarshaller( + ProtoUtils.marshaller(ListAcceleratorTypesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListAcceleratorTypesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getAcceleratorTypeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v1.Tpu/GetAcceleratorType") + .setRequestMarshaller( + ProtoUtils.marshaller(GetAcceleratorTypeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(AcceleratorType.getDefaultInstance())) + .build(); + + private final UnaryCallable listNodesCallable; + private final UnaryCallable listNodesPagedCallable; + private final UnaryCallable getNodeCallable; + private final UnaryCallable createNodeCallable; + private final OperationCallable + createNodeOperationCallable; + private final UnaryCallable deleteNodeCallable; + private final OperationCallable + deleteNodeOperationCallable; + private final UnaryCallable reimageNodeCallable; + private final OperationCallable + reimageNodeOperationCallable; + private final UnaryCallable stopNodeCallable; + private final OperationCallable + stopNodeOperationCallable; + private final UnaryCallable startNodeCallable; + private final OperationCallable + startNodeOperationCallable; + private final UnaryCallable + listTensorFlowVersionsCallable; + private final UnaryCallable + listTensorFlowVersionsPagedCallable; + private final UnaryCallable + getTensorFlowVersionCallable; + private final UnaryCallable + listAcceleratorTypesCallable; + private final UnaryCallable + listAcceleratorTypesPagedCallable; + private final UnaryCallable + getAcceleratorTypeCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcTpuStub create(TpuStubSettings settings) throws IOException { + return new GrpcTpuStub(settings, ClientContext.create(settings)); + } + + public static final GrpcTpuStub create(ClientContext clientContext) throws IOException { + return new GrpcTpuStub(TpuStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcTpuStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcTpuStub(TpuStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcTpuStub, using the given settings. This is protected so that it + * is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected GrpcTpuStub(TpuStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcTpuCallableFactory()); + } + + /** + * Constructs an instance of GrpcTpuStub, using the given settings. This is protected so that it + * is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected GrpcTpuStub( + TpuStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listNodesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listNodesMethodDescriptor) + .setParamsExtractor( + 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 reimageNodeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(reimageNodeMethodDescriptor) + .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 + listTensorFlowVersionsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listTensorFlowVersionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + getTensorFlowVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getTensorFlowVersionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + 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(); + + this.listNodesCallable = + callableFactory.createUnaryCallable( + listNodesTransportSettings, settings.listNodesSettings(), clientContext); + this.listNodesPagedCallable = + callableFactory.createPagedCallable( + listNodesTransportSettings, settings.listNodesSettings(), clientContext); + this.getNodeCallable = + callableFactory.createUnaryCallable( + getNodeTransportSettings, settings.getNodeSettings(), clientContext); + this.createNodeCallable = + callableFactory.createUnaryCallable( + createNodeTransportSettings, settings.createNodeSettings(), clientContext); + this.createNodeOperationCallable = + callableFactory.createOperationCallable( + createNodeTransportSettings, + settings.createNodeOperationSettings(), + clientContext, + operationsStub); + this.deleteNodeCallable = + callableFactory.createUnaryCallable( + deleteNodeTransportSettings, settings.deleteNodeSettings(), clientContext); + this.deleteNodeOperationCallable = + callableFactory.createOperationCallable( + deleteNodeTransportSettings, + settings.deleteNodeOperationSettings(), + clientContext, + operationsStub); + this.reimageNodeCallable = + callableFactory.createUnaryCallable( + reimageNodeTransportSettings, settings.reimageNodeSettings(), clientContext); + this.reimageNodeOperationCallable = + callableFactory.createOperationCallable( + reimageNodeTransportSettings, + settings.reimageNodeOperationSettings(), + clientContext, + operationsStub); + this.stopNodeCallable = + callableFactory.createUnaryCallable( + stopNodeTransportSettings, settings.stopNodeSettings(), clientContext); + this.stopNodeOperationCallable = + callableFactory.createOperationCallable( + stopNodeTransportSettings, + settings.stopNodeOperationSettings(), + clientContext, + operationsStub); + this.startNodeCallable = + callableFactory.createUnaryCallable( + startNodeTransportSettings, settings.startNodeSettings(), clientContext); + this.startNodeOperationCallable = + callableFactory.createOperationCallable( + startNodeTransportSettings, + settings.startNodeOperationSettings(), + clientContext, + operationsStub); + this.listTensorFlowVersionsCallable = + callableFactory.createUnaryCallable( + listTensorFlowVersionsTransportSettings, + settings.listTensorFlowVersionsSettings(), + clientContext); + this.listTensorFlowVersionsPagedCallable = + callableFactory.createPagedCallable( + listTensorFlowVersionsTransportSettings, + settings.listTensorFlowVersionsSettings(), + clientContext); + this.getTensorFlowVersionCallable = + callableFactory.createUnaryCallable( + getTensorFlowVersionTransportSettings, + settings.getTensorFlowVersionSettings(), + clientContext); + this.listAcceleratorTypesCallable = + callableFactory.createUnaryCallable( + listAcceleratorTypesTransportSettings, + settings.listAcceleratorTypesSettings(), + clientContext); + this.listAcceleratorTypesPagedCallable = + callableFactory.createPagedCallable( + listAcceleratorTypesTransportSettings, + settings.listAcceleratorTypesSettings(), + clientContext); + this.getAcceleratorTypeCallable = + callableFactory.createUnaryCallable( + getAcceleratorTypeTransportSettings, + settings.getAcceleratorTypeSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listNodesCallable() { + return listNodesCallable; + } + + @Override + public UnaryCallable listNodesPagedCallable() { + return listNodesPagedCallable; + } + + @Override + public UnaryCallable getNodeCallable() { + return getNodeCallable; + } + + @Override + public UnaryCallable createNodeCallable() { + return createNodeCallable; + } + + @Override + public OperationCallable + createNodeOperationCallable() { + return createNodeOperationCallable; + } + + @Override + public UnaryCallable deleteNodeCallable() { + return deleteNodeCallable; + } + + @Override + public OperationCallable + deleteNodeOperationCallable() { + return deleteNodeOperationCallable; + } + + @Override + public UnaryCallable reimageNodeCallable() { + return reimageNodeCallable; + } + + @Override + public OperationCallable + reimageNodeOperationCallable() { + return reimageNodeOperationCallable; + } + + @Override + public UnaryCallable stopNodeCallable() { + return stopNodeCallable; + } + + @Override + public OperationCallable stopNodeOperationCallable() { + return stopNodeOperationCallable; + } + + @Override + public UnaryCallable startNodeCallable() { + return startNodeCallable; + } + + @Override + public OperationCallable startNodeOperationCallable() { + return startNodeOperationCallable; + } + + @Override + public UnaryCallable + listTensorFlowVersionsCallable() { + return listTensorFlowVersionsCallable; + } + + @Override + public UnaryCallable + listTensorFlowVersionsPagedCallable() { + return listTensorFlowVersionsPagedCallable; + } + + @Override + public UnaryCallable + getTensorFlowVersionCallable() { + return getTensorFlowVersionCallable; + } + + @Override + public UnaryCallable + listAcceleratorTypesCallable() { + return listAcceleratorTypesCallable; + } + + @Override + public UnaryCallable + listAcceleratorTypesPagedCallable() { + return listAcceleratorTypesPagedCallable; + } + + @Override + public UnaryCallable getAcceleratorTypeCallable() { + return getAcceleratorTypeCallable; + } + + @Override + public final void close() { + 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/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStub.java b/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStub.java new file mode 100644 index 000000000000..588921956a6a --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStub.java @@ -0,0 +1,148 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.stub; + +import static com.google.cloud.tpu.v1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListTensorFlowVersionsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.tpu.v1.AcceleratorType; +import com.google.cloud.tpu.v1.CreateNodeRequest; +import com.google.cloud.tpu.v1.DeleteNodeRequest; +import com.google.cloud.tpu.v1.GetAcceleratorTypeRequest; +import com.google.cloud.tpu.v1.GetNodeRequest; +import com.google.cloud.tpu.v1.GetTensorFlowVersionRequest; +import com.google.cloud.tpu.v1.ListAcceleratorTypesRequest; +import com.google.cloud.tpu.v1.ListAcceleratorTypesResponse; +import com.google.cloud.tpu.v1.ListNodesRequest; +import com.google.cloud.tpu.v1.ListNodesResponse; +import com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest; +import com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse; +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.OperationMetadata; +import com.google.cloud.tpu.v1.ReimageNodeRequest; +import com.google.cloud.tpu.v1.StartNodeRequest; +import com.google.cloud.tpu.v1.StopNodeRequest; +import com.google.cloud.tpu.v1.TensorFlowVersion; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Tpu service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class TpuStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable listNodesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listNodesPagedCallable()"); + } + + public UnaryCallable listNodesCallable() { + throw new UnsupportedOperationException("Not implemented: listNodesCallable()"); + } + + public UnaryCallable getNodeCallable() { + throw new UnsupportedOperationException("Not implemented: getNodeCallable()"); + } + + public OperationCallable + createNodeOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createNodeOperationCallable()"); + } + + public UnaryCallable createNodeCallable() { + throw new UnsupportedOperationException("Not implemented: createNodeCallable()"); + } + + public OperationCallable + deleteNodeOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteNodeOperationCallable()"); + } + + public UnaryCallable deleteNodeCallable() { + throw new UnsupportedOperationException("Not implemented: deleteNodeCallable()"); + } + + public OperationCallable + reimageNodeOperationCallable() { + throw new UnsupportedOperationException("Not implemented: reimageNodeOperationCallable()"); + } + + public UnaryCallable reimageNodeCallable() { + throw new UnsupportedOperationException("Not implemented: reimageNodeCallable()"); + } + + public OperationCallable stopNodeOperationCallable() { + throw new UnsupportedOperationException("Not implemented: stopNodeOperationCallable()"); + } + + public UnaryCallable stopNodeCallable() { + throw new UnsupportedOperationException("Not implemented: stopNodeCallable()"); + } + + public OperationCallable startNodeOperationCallable() { + throw new UnsupportedOperationException("Not implemented: startNodeOperationCallable()"); + } + + public UnaryCallable startNodeCallable() { + throw new UnsupportedOperationException("Not implemented: startNodeCallable()"); + } + + public UnaryCallable + listTensorFlowVersionsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listTensorFlowVersionsPagedCallable()"); + } + + public UnaryCallable + listTensorFlowVersionsCallable() { + throw new UnsupportedOperationException("Not implemented: listTensorFlowVersionsCallable()"); + } + + public UnaryCallable + getTensorFlowVersionCallable() { + throw new UnsupportedOperationException("Not implemented: getTensorFlowVersionCallable()"); + } + + public UnaryCallable + listAcceleratorTypesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listAcceleratorTypesPagedCallable()"); + } + + public UnaryCallable + listAcceleratorTypesCallable() { + throw new UnsupportedOperationException("Not implemented: listAcceleratorTypesCallable()"); + } + + public UnaryCallable getAcceleratorTypeCallable() { + throw new UnsupportedOperationException("Not implemented: getAcceleratorTypeCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStubSettings.java b/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStubSettings.java new file mode 100644 index 000000000000..a527232ad04e --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStubSettings.java @@ -0,0 +1,973 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.stub; + +import static com.google.cloud.tpu.v1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListTensorFlowVersionsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.tpu.v1.AcceleratorType; +import com.google.cloud.tpu.v1.CreateNodeRequest; +import com.google.cloud.tpu.v1.DeleteNodeRequest; +import com.google.cloud.tpu.v1.GetAcceleratorTypeRequest; +import com.google.cloud.tpu.v1.GetNodeRequest; +import com.google.cloud.tpu.v1.GetTensorFlowVersionRequest; +import com.google.cloud.tpu.v1.ListAcceleratorTypesRequest; +import com.google.cloud.tpu.v1.ListAcceleratorTypesResponse; +import com.google.cloud.tpu.v1.ListNodesRequest; +import com.google.cloud.tpu.v1.ListNodesResponse; +import com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest; +import com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse; +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.OperationMetadata; +import com.google.cloud.tpu.v1.ReimageNodeRequest; +import com.google.cloud.tpu.v1.StartNodeRequest; +import com.google.cloud.tpu.v1.StopNodeRequest; +import com.google.cloud.tpu.v1.TensorFlowVersion; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link TpuStub}. + * + *

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

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

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

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

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * TpuStubSettings.Builder tpuSettingsBuilder = TpuStubSettings.newBuilder();
+ * tpuSettingsBuilder
+ *     .getNodeSettings()
+ *     .setRetrySettings(
+ *         tpuSettingsBuilder.getNodeSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * TpuStubSettings tpuSettings = tpuSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class TpuStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final PagedCallSettings + listNodesSettings; + private final UnaryCallSettings getNodeSettings; + private final UnaryCallSettings createNodeSettings; + private final OperationCallSettings + createNodeOperationSettings; + private final UnaryCallSettings deleteNodeSettings; + private final OperationCallSettings + deleteNodeOperationSettings; + private final UnaryCallSettings reimageNodeSettings; + private final OperationCallSettings + reimageNodeOperationSettings; + private final UnaryCallSettings stopNodeSettings; + private final OperationCallSettings + stopNodeOperationSettings; + private final UnaryCallSettings startNodeSettings; + private final OperationCallSettings + startNodeOperationSettings; + private final PagedCallSettings< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + ListTensorFlowVersionsPagedResponse> + listTensorFlowVersionsSettings; + private final UnaryCallSettings + getTensorFlowVersionSettings; + private final PagedCallSettings< + ListAcceleratorTypesRequest, + ListAcceleratorTypesResponse, + ListAcceleratorTypesPagedResponse> + listAcceleratorTypesSettings; + private final UnaryCallSettings + getAcceleratorTypeSettings; + + private static final PagedListDescriptor + LIST_NODES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListNodesRequest injectToken(ListNodesRequest payload, String token) { + return ListNodesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListNodesRequest injectPageSize(ListNodesRequest payload, int pageSize) { + return ListNodesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListNodesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListNodesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListNodesResponse payload) { + return payload.getNodesList() == null + ? ImmutableList.of() + : payload.getNodesList(); + } + }; + + private static final PagedListDescriptor< + ListTensorFlowVersionsRequest, ListTensorFlowVersionsResponse, TensorFlowVersion> + LIST_TENSOR_FLOW_VERSIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListTensorFlowVersionsRequest, ListTensorFlowVersionsResponse, TensorFlowVersion>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListTensorFlowVersionsRequest injectToken( + ListTensorFlowVersionsRequest payload, String token) { + return ListTensorFlowVersionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListTensorFlowVersionsRequest injectPageSize( + ListTensorFlowVersionsRequest payload, int pageSize) { + return ListTensorFlowVersionsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListTensorFlowVersionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListTensorFlowVersionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListTensorFlowVersionsResponse payload) { + return payload.getTensorflowVersionsList() == null + ? ImmutableList.of() + : payload.getTensorflowVersionsList(); + } + }; + + private static final PagedListDescriptor< + ListAcceleratorTypesRequest, ListAcceleratorTypesResponse, AcceleratorType> + LIST_ACCELERATOR_TYPES_PAGE_STR_DESC = + new PagedListDescriptor< + ListAcceleratorTypesRequest, ListAcceleratorTypesResponse, AcceleratorType>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListAcceleratorTypesRequest injectToken( + ListAcceleratorTypesRequest payload, String token) { + return ListAcceleratorTypesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListAcceleratorTypesRequest injectPageSize( + ListAcceleratorTypesRequest payload, int pageSize) { + return ListAcceleratorTypesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListAcceleratorTypesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListAcceleratorTypesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListAcceleratorTypesResponse payload) { + return payload.getAcceleratorTypesList() == null + ? ImmutableList.of() + : payload.getAcceleratorTypesList(); + } + }; + + private static final PagedListResponseFactory< + ListNodesRequest, ListNodesResponse, ListNodesPagedResponse> + LIST_NODES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListNodesRequest, ListNodesResponse, ListNodesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListNodesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_NODES_PAGE_STR_DESC, request, context); + return ListNodesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + ListTensorFlowVersionsPagedResponse> + LIST_TENSOR_FLOW_VERSIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + ListTensorFlowVersionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListTensorFlowVersionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + TensorFlowVersion> + pageContext = + PageContext.create( + callable, LIST_TENSOR_FLOW_VERSIONS_PAGE_STR_DESC, request, context); + return ListTensorFlowVersionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListAcceleratorTypesRequest, + ListAcceleratorTypesResponse, + ListAcceleratorTypesPagedResponse> + LIST_ACCELERATOR_TYPES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListAcceleratorTypesRequest, + ListAcceleratorTypesResponse, + ListAcceleratorTypesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListAcceleratorTypesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListAcceleratorTypesRequest, ListAcceleratorTypesResponse, AcceleratorType> + pageContext = + PageContext.create( + callable, LIST_ACCELERATOR_TYPES_PAGE_STR_DESC, request, context); + return ListAcceleratorTypesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listNodes. */ + public PagedCallSettings + listNodesSettings() { + return listNodesSettings; + } + + /** Returns the object with the settings used for calls to getNode. */ + public UnaryCallSettings getNodeSettings() { + return getNodeSettings; + } + + /** Returns the object with the settings used for calls to createNode. */ + public UnaryCallSettings createNodeSettings() { + return createNodeSettings; + } + + /** Returns the object with the settings used for calls to createNode. */ + public OperationCallSettings + createNodeOperationSettings() { + return createNodeOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteNode. */ + public UnaryCallSettings deleteNodeSettings() { + return deleteNodeSettings; + } + + /** Returns the object with the settings used for calls to deleteNode. */ + public OperationCallSettings + deleteNodeOperationSettings() { + return deleteNodeOperationSettings; + } + + /** Returns the object with the settings used for calls to reimageNode. */ + public UnaryCallSettings reimageNodeSettings() { + return reimageNodeSettings; + } + + /** Returns the object with the settings used for calls to reimageNode. */ + public OperationCallSettings + reimageNodeOperationSettings() { + return reimageNodeOperationSettings; + } + + /** Returns the object with the settings used for calls to stopNode. */ + public UnaryCallSettings stopNodeSettings() { + return stopNodeSettings; + } + + /** Returns the object with the settings used for calls to stopNode. */ + public OperationCallSettings + stopNodeOperationSettings() { + return stopNodeOperationSettings; + } + + /** Returns the object with the settings used for calls to startNode. */ + public UnaryCallSettings startNodeSettings() { + return startNodeSettings; + } + + /** Returns the object with the settings used for calls to startNode. */ + public OperationCallSettings + startNodeOperationSettings() { + return startNodeOperationSettings; + } + + /** Returns the object with the settings used for calls to listTensorFlowVersions. */ + public PagedCallSettings< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + ListTensorFlowVersionsPagedResponse> + listTensorFlowVersionsSettings() { + return listTensorFlowVersionsSettings; + } + + /** Returns the object with the settings used for calls to getTensorFlowVersion. */ + public UnaryCallSettings + getTensorFlowVersionSettings() { + return getTensorFlowVersionSettings; + } + + /** Returns the object with the settings used for calls to listAcceleratorTypes. */ + public PagedCallSettings< + ListAcceleratorTypesRequest, + ListAcceleratorTypesResponse, + ListAcceleratorTypesPagedResponse> + listAcceleratorTypesSettings() { + return listAcceleratorTypesSettings; + } + + /** Returns the object with the settings used for calls to getAcceleratorType. */ + public UnaryCallSettings + getAcceleratorTypeSettings() { + return getAcceleratorTypeSettings; + } + + 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(); + reimageNodeSettings = settingsBuilder.reimageNodeSettings().build(); + reimageNodeOperationSettings = settingsBuilder.reimageNodeOperationSettings().build(); + stopNodeSettings = settingsBuilder.stopNodeSettings().build(); + stopNodeOperationSettings = settingsBuilder.stopNodeOperationSettings().build(); + startNodeSettings = settingsBuilder.startNodeSettings().build(); + startNodeOperationSettings = settingsBuilder.startNodeOperationSettings().build(); + listTensorFlowVersionsSettings = settingsBuilder.listTensorFlowVersionsSettings().build(); + getTensorFlowVersionSettings = settingsBuilder.getTensorFlowVersionSettings().build(); + listAcceleratorTypesSettings = settingsBuilder.listAcceleratorTypesSettings().build(); + getAcceleratorTypeSettings = settingsBuilder.getAcceleratorTypeSettings().build(); + } + + /** Builder for TpuStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListNodesRequest, ListNodesResponse, ListNodesPagedResponse> + listNodesSettings; + private final UnaryCallSettings.Builder getNodeSettings; + private final UnaryCallSettings.Builder createNodeSettings; + private final OperationCallSettings.Builder + createNodeOperationSettings; + private final UnaryCallSettings.Builder deleteNodeSettings; + private final OperationCallSettings.Builder + deleteNodeOperationSettings; + private final UnaryCallSettings.Builder reimageNodeSettings; + private final OperationCallSettings.Builder + reimageNodeOperationSettings; + private final UnaryCallSettings.Builder stopNodeSettings; + private final OperationCallSettings.Builder + stopNodeOperationSettings; + private final UnaryCallSettings.Builder startNodeSettings; + private final OperationCallSettings.Builder + startNodeOperationSettings; + private final PagedCallSettings.Builder< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + ListTensorFlowVersionsPagedResponse> + listTensorFlowVersionsSettings; + private final UnaryCallSettings.Builder + getTensorFlowVersionSettings; + private final PagedCallSettings.Builder< + ListAcceleratorTypesRequest, + ListAcceleratorTypesResponse, + ListAcceleratorTypesPagedResponse> + listAcceleratorTypesSettings; + private final UnaryCallSettings.Builder + getAcceleratorTypeSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listNodesSettings = PagedCallSettings.newBuilder(LIST_NODES_PAGE_STR_FACT); + getNodeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createNodeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createNodeOperationSettings = OperationCallSettings.newBuilder(); + deleteNodeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteNodeOperationSettings = OperationCallSettings.newBuilder(); + reimageNodeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + reimageNodeOperationSettings = OperationCallSettings.newBuilder(); + stopNodeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + stopNodeOperationSettings = OperationCallSettings.newBuilder(); + startNodeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + startNodeOperationSettings = OperationCallSettings.newBuilder(); + listTensorFlowVersionsSettings = + PagedCallSettings.newBuilder(LIST_TENSOR_FLOW_VERSIONS_PAGE_STR_FACT); + getTensorFlowVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listAcceleratorTypesSettings = + PagedCallSettings.newBuilder(LIST_ACCELERATOR_TYPES_PAGE_STR_FACT); + getAcceleratorTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listNodesSettings, + getNodeSettings, + createNodeSettings, + deleteNodeSettings, + reimageNodeSettings, + stopNodeSettings, + startNodeSettings, + listTensorFlowVersionsSettings, + getTensorFlowVersionSettings, + listAcceleratorTypesSettings, + getAcceleratorTypeSettings); + initDefaults(this); + } + + protected Builder(TpuStubSettings settings) { + super(settings); + + listNodesSettings = settings.listNodesSettings.toBuilder(); + getNodeSettings = settings.getNodeSettings.toBuilder(); + createNodeSettings = settings.createNodeSettings.toBuilder(); + createNodeOperationSettings = settings.createNodeOperationSettings.toBuilder(); + deleteNodeSettings = settings.deleteNodeSettings.toBuilder(); + deleteNodeOperationSettings = settings.deleteNodeOperationSettings.toBuilder(); + reimageNodeSettings = settings.reimageNodeSettings.toBuilder(); + reimageNodeOperationSettings = settings.reimageNodeOperationSettings.toBuilder(); + stopNodeSettings = settings.stopNodeSettings.toBuilder(); + stopNodeOperationSettings = settings.stopNodeOperationSettings.toBuilder(); + startNodeSettings = settings.startNodeSettings.toBuilder(); + startNodeOperationSettings = settings.startNodeOperationSettings.toBuilder(); + listTensorFlowVersionsSettings = settings.listTensorFlowVersionsSettings.toBuilder(); + getTensorFlowVersionSettings = settings.getTensorFlowVersionSettings.toBuilder(); + listAcceleratorTypesSettings = settings.listAcceleratorTypesSettings.toBuilder(); + getAcceleratorTypeSettings = settings.getAcceleratorTypeSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listNodesSettings, + getNodeSettings, + createNodeSettings, + deleteNodeSettings, + reimageNodeSettings, + stopNodeSettings, + startNodeSettings, + listTensorFlowVersionsSettings, + getTensorFlowVersionSettings, + listAcceleratorTypesSettings, + getAcceleratorTypeSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + 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 + .reimageNodeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .stopNodeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .startNodeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listTensorFlowVersionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getTensorFlowVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listAcceleratorTypesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getAcceleratorTypeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .createNodeOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Node.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteNodeOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Node.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .reimageNodeOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Node.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .stopNodeOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Node.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .startNodeOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Node.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * 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 reimageNode. */ + public UnaryCallSettings.Builder reimageNodeSettings() { + return reimageNodeSettings; + } + + /** Returns the builder for the settings used for calls to reimageNode. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + reimageNodeOperationSettings() { + return reimageNodeOperationSettings; + } + + /** Returns the builder for the settings used for calls to stopNode. */ + public UnaryCallSettings.Builder stopNodeSettings() { + return stopNodeSettings; + } + + /** Returns the builder for the settings used for calls to stopNode. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + stopNodeOperationSettings() { + return stopNodeOperationSettings; + } + + /** Returns the builder for the settings used for calls to startNode. */ + public UnaryCallSettings.Builder startNodeSettings() { + return startNodeSettings; + } + + /** Returns the builder for the settings used for calls to startNode. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + startNodeOperationSettings() { + return startNodeOperationSettings; + } + + /** Returns the builder for the settings used for calls to listTensorFlowVersions. */ + public PagedCallSettings.Builder< + ListTensorFlowVersionsRequest, + ListTensorFlowVersionsResponse, + ListTensorFlowVersionsPagedResponse> + listTensorFlowVersionsSettings() { + return listTensorFlowVersionsSettings; + } + + /** Returns the builder for the settings used for calls to getTensorFlowVersion. */ + public UnaryCallSettings.Builder + getTensorFlowVersionSettings() { + return getTensorFlowVersionSettings; + } + + /** Returns the builder for the settings used for calls to listAcceleratorTypes. */ + public PagedCallSettings.Builder< + ListAcceleratorTypesRequest, + ListAcceleratorTypesResponse, + ListAcceleratorTypesPagedResponse> + listAcceleratorTypesSettings() { + return listAcceleratorTypesSettings; + } + + /** Returns the builder for the settings used for calls to getAcceleratorType. */ + public UnaryCallSettings.Builder + getAcceleratorTypeSettings() { + return getAcceleratorTypeSettings; + } + + @Override + public TpuStubSettings build() throws IOException { + return new TpuStubSettings(this); + } + } +} diff --git a/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/MockTpu.java b/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/MockTpu.java new file mode 100644 index 000000000000..b20f303457fc --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/MockTpu.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockTpu implements MockGrpcService { + private final MockTpuImpl serviceImpl; + + public MockTpu() { + serviceImpl = new MockTpuImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/MockTpuImpl.java b/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/MockTpuImpl.java new file mode 100644 index 000000000000..20c9591984ce --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/MockTpuImpl.java @@ -0,0 +1,288 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.tpu.v1.TpuGrpc.TpuImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockTpuImpl extends TpuImplBase { + private List requests; + private Queue responses; + + public MockTpuImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listNodes( + ListNodesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListNodesResponse) { + requests.add(request); + responseObserver.onNext(((ListNodesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListNodes, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListNodesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getNode(GetNodeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Node) { + requests.add(request); + responseObserver.onNext(((Node) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetNode, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Node.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createNode(CreateNodeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateNode, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteNode(DeleteNodeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteNode, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void reimageNode(ReimageNodeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ReimageNode, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void stopNode(StopNodeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method StopNode, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void startNode(StartNodeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method StartNode, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listTensorFlowVersions( + ListTensorFlowVersionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListTensorFlowVersionsResponse) { + requests.add(request); + responseObserver.onNext(((ListTensorFlowVersionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListTensorFlowVersions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListTensorFlowVersionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getTensorFlowVersion( + GetTensorFlowVersionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TensorFlowVersion) { + requests.add(request); + responseObserver.onNext(((TensorFlowVersion) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetTensorFlowVersion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TensorFlowVersion.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listAcceleratorTypes( + ListAcceleratorTypesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListAcceleratorTypesResponse) { + requests.add(request); + responseObserver.onNext(((ListAcceleratorTypesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListAcceleratorTypes, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListAcceleratorTypesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getAcceleratorType( + GetAcceleratorTypeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AcceleratorType) { + requests.add(request); + responseObserver.onNext(((AcceleratorType) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetAcceleratorType, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AcceleratorType.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/TpuClientTest.java b/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/TpuClientTest.java new file mode 100644 index 000000000000..c5ed362951fb --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/TpuClientTest.java @@ -0,0 +1,1083 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1; + +import static com.google.cloud.tpu.v1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListTensorFlowVersionsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class TpuClientTest { + private static MockServiceHelper mockServiceHelper; + private static MockTpu mockTpu; + private 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); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListNodesPagedResponse pagedListResponse = client.listNodes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getNodesList().get(0), resources.get(0)); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListNodesRequest actualRequest = ((ListNodesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listNodesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listNodes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listNodesTest2() throws Exception { + Node responsesElement = Node.newBuilder().build(); + ListNodesResponse expectedResponse = + ListNodesResponse.newBuilder() + .setNextPageToken("") + .addAllNodes(Arrays.asList(responsesElement)) + .build(); + mockTpu.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListNodesPagedResponse pagedListResponse = client.listNodes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getNodesList().get(0), resources.get(0)); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListNodesRequest actualRequest = ((ListNodesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listNodesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + String parent = "parent-995424086"; + client.listNodes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getNodeTest() throws Exception { + Node expectedResponse = + Node.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setDescription("description-1724546052") + .setAcceleratorType("acceleratorType-82462651") + .setIpAddress("ipAddress1634032845") + .setPort("port3446913") + .setHealthDescription("healthDescription1231837184") + .setTensorflowVersion("tensorflowVersion-470125103") + .setNetwork("network1843485230") + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount("serviceAccount1079137720") + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .setUseServiceNetworking(true) + .addAllSymptoms(new ArrayList()) + .build(); + mockTpu.addResponse(expectedResponse); + + NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); + + Node actualResponse = client.getNode(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetNodeRequest actualRequest = ((GetNodeRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getNodeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); + client.getNode(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getNodeTest2() throws Exception { + Node expectedResponse = + Node.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setDescription("description-1724546052") + .setAcceleratorType("acceleratorType-82462651") + .setIpAddress("ipAddress1634032845") + .setPort("port3446913") + .setHealthDescription("healthDescription1231837184") + .setTensorflowVersion("tensorflowVersion-470125103") + .setNetwork("network1843485230") + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount("serviceAccount1079137720") + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .setUseServiceNetworking(true) + .addAllSymptoms(new ArrayList()) + .build(); + mockTpu.addResponse(expectedResponse); + + String name = "name3373707"; + + Node actualResponse = client.getNode(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetNodeRequest actualRequest = ((GetNodeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getNodeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + String name = "name3373707"; + client.getNode(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createNodeTest() throws Exception { + Node expectedResponse = + Node.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setDescription("description-1724546052") + .setAcceleratorType("acceleratorType-82462651") + .setIpAddress("ipAddress1634032845") + .setPort("port3446913") + .setHealthDescription("healthDescription1231837184") + .setTensorflowVersion("tensorflowVersion-470125103") + .setNetwork("network1843485230") + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount("serviceAccount1079137720") + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .setUseServiceNetworking(true) + .addAllSymptoms(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createNodeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTpu.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Node node = Node.newBuilder().build(); + String nodeId = "nodeId-1040171331"; + + Node actualResponse = client.createNodeAsync(parent, node, nodeId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateNodeRequest actualRequest = ((CreateNodeRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(node, actualRequest.getNode()); + Assert.assertEquals(nodeId, actualRequest.getNodeId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createNodeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Node node = Node.newBuilder().build(); + String nodeId = "nodeId-1040171331"; + client.createNodeAsync(parent, node, nodeId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createNodeTest2() throws Exception { + Node expectedResponse = + Node.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setDescription("description-1724546052") + .setAcceleratorType("acceleratorType-82462651") + .setIpAddress("ipAddress1634032845") + .setPort("port3446913") + .setHealthDescription("healthDescription1231837184") + .setTensorflowVersion("tensorflowVersion-470125103") + .setNetwork("network1843485230") + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount("serviceAccount1079137720") + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .setUseServiceNetworking(true) + .addAllSymptoms(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createNodeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTpu.addResponse(resultOperation); + + String parent = "parent-995424086"; + Node node = Node.newBuilder().build(); + String nodeId = "nodeId-1040171331"; + + Node actualResponse = client.createNodeAsync(parent, node, nodeId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateNodeRequest actualRequest = ((CreateNodeRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(node, actualRequest.getNode()); + Assert.assertEquals(nodeId, actualRequest.getNodeId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createNodeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + String parent = "parent-995424086"; + Node node = Node.newBuilder().build(); + String nodeId = "nodeId-1040171331"; + client.createNodeAsync(parent, node, nodeId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteNodeTest() throws Exception { + Node expectedResponse = + Node.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setDescription("description-1724546052") + .setAcceleratorType("acceleratorType-82462651") + .setIpAddress("ipAddress1634032845") + .setPort("port3446913") + .setHealthDescription("healthDescription1231837184") + .setTensorflowVersion("tensorflowVersion-470125103") + .setNetwork("network1843485230") + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount("serviceAccount1079137720") + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .setUseServiceNetworking(true) + .addAllSymptoms(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteNodeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTpu.addResponse(resultOperation); + + NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); + + Node actualResponse = client.deleteNodeAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteNodeRequest actualRequest = ((DeleteNodeRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteNodeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); + client.deleteNodeAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteNodeTest2() throws Exception { + Node expectedResponse = + Node.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setDescription("description-1724546052") + .setAcceleratorType("acceleratorType-82462651") + .setIpAddress("ipAddress1634032845") + .setPort("port3446913") + .setHealthDescription("healthDescription1231837184") + .setTensorflowVersion("tensorflowVersion-470125103") + .setNetwork("network1843485230") + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount("serviceAccount1079137720") + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .setUseServiceNetworking(true) + .addAllSymptoms(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteNodeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTpu.addResponse(resultOperation); + + String name = "name3373707"; + + Node actualResponse = client.deleteNodeAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteNodeRequest actualRequest = ((DeleteNodeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteNodeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + String name = "name3373707"; + client.deleteNodeAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void reimageNodeTest() throws Exception { + Node expectedResponse = + Node.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setDescription("description-1724546052") + .setAcceleratorType("acceleratorType-82462651") + .setIpAddress("ipAddress1634032845") + .setPort("port3446913") + .setHealthDescription("healthDescription1231837184") + .setTensorflowVersion("tensorflowVersion-470125103") + .setNetwork("network1843485230") + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount("serviceAccount1079137720") + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .setUseServiceNetworking(true) + .addAllSymptoms(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("reimageNodeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTpu.addResponse(resultOperation); + + ReimageNodeRequest request = + ReimageNodeRequest.newBuilder() + .setName("name3373707") + .setTensorflowVersion("tensorflowVersion-470125103") + .build(); + + Node actualResponse = client.reimageNodeAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ReimageNodeRequest actualRequest = ((ReimageNodeRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getTensorflowVersion(), actualRequest.getTensorflowVersion()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void reimageNodeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + ReimageNodeRequest request = + ReimageNodeRequest.newBuilder() + .setName("name3373707") + .setTensorflowVersion("tensorflowVersion-470125103") + .build(); + client.reimageNodeAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void stopNodeTest() throws Exception { + Node expectedResponse = + Node.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setDescription("description-1724546052") + .setAcceleratorType("acceleratorType-82462651") + .setIpAddress("ipAddress1634032845") + .setPort("port3446913") + .setHealthDescription("healthDescription1231837184") + .setTensorflowVersion("tensorflowVersion-470125103") + .setNetwork("network1843485230") + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount("serviceAccount1079137720") + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .setUseServiceNetworking(true) + .addAllSymptoms(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("stopNodeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTpu.addResponse(resultOperation); + + StopNodeRequest request = StopNodeRequest.newBuilder().setName("name3373707").build(); + + Node actualResponse = client.stopNodeAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + StopNodeRequest actualRequest = ((StopNodeRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void stopNodeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + StopNodeRequest request = StopNodeRequest.newBuilder().setName("name3373707").build(); + client.stopNodeAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void startNodeTest() throws Exception { + Node expectedResponse = + Node.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setDescription("description-1724546052") + .setAcceleratorType("acceleratorType-82462651") + .setIpAddress("ipAddress1634032845") + .setPort("port3446913") + .setHealthDescription("healthDescription1231837184") + .setTensorflowVersion("tensorflowVersion-470125103") + .setNetwork("network1843485230") + .setCidrBlock("cidrBlock1646183801") + .setServiceAccount("serviceAccount1079137720") + .setCreateTime(Timestamp.newBuilder().build()) + .setSchedulingConfig(SchedulingConfig.newBuilder().build()) + .addAllNetworkEndpoints(new ArrayList()) + .putAllLabels(new HashMap()) + .setUseServiceNetworking(true) + .addAllSymptoms(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("startNodeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTpu.addResponse(resultOperation); + + StartNodeRequest request = StartNodeRequest.newBuilder().setName("name3373707").build(); + + Node actualResponse = client.startNodeAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + StartNodeRequest actualRequest = ((StartNodeRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void startNodeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + StartNodeRequest request = StartNodeRequest.newBuilder().setName("name3373707").build(); + client.startNodeAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listTensorFlowVersionsTest() throws Exception { + TensorFlowVersion responsesElement = TensorFlowVersion.newBuilder().build(); + ListTensorFlowVersionsResponse expectedResponse = + ListTensorFlowVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllTensorflowVersions(Arrays.asList(responsesElement)) + .build(); + mockTpu.addResponse(expectedResponse); + + TensorFlowVersionName parent = + TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]"); + + ListTensorFlowVersionsPagedResponse pagedListResponse = client.listTensorFlowVersions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTensorflowVersionsList().get(0), resources.get(0)); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTensorFlowVersionsRequest actualRequest = + ((ListTensorFlowVersionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listTensorFlowVersionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + TensorFlowVersionName parent = + TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]"); + client.listTensorFlowVersions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTensorFlowVersionsTest2() throws Exception { + TensorFlowVersion responsesElement = TensorFlowVersion.newBuilder().build(); + ListTensorFlowVersionsResponse expectedResponse = + ListTensorFlowVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllTensorflowVersions(Arrays.asList(responsesElement)) + .build(); + mockTpu.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListTensorFlowVersionsPagedResponse pagedListResponse = client.listTensorFlowVersions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTensorflowVersionsList().get(0), resources.get(0)); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTensorFlowVersionsRequest actualRequest = + ((ListTensorFlowVersionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listTensorFlowVersionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + String parent = "parent-995424086"; + client.listTensorFlowVersions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTensorFlowVersionTest() throws Exception { + TensorFlowVersion expectedResponse = + TensorFlowVersion.newBuilder() + .setName( + TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]") + .toString()) + .setVersion("version351608024") + .build(); + mockTpu.addResponse(expectedResponse); + + TensorFlowVersionName name = + TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]"); + + TensorFlowVersion actualResponse = client.getTensorFlowVersion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetTensorFlowVersionRequest actualRequest = + ((GetTensorFlowVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getTensorFlowVersionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + TensorFlowVersionName name = + TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]"); + client.getTensorFlowVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTensorFlowVersionTest2() throws Exception { + TensorFlowVersion expectedResponse = + TensorFlowVersion.newBuilder() + .setName( + TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]") + .toString()) + .setVersion("version351608024") + .build(); + mockTpu.addResponse(expectedResponse); + + String name = "name3373707"; + + TensorFlowVersion actualResponse = client.getTensorFlowVersion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetTensorFlowVersionRequest actualRequest = + ((GetTensorFlowVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getTensorFlowVersionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + String name = "name3373707"; + client.getTensorFlowVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAcceleratorTypesTest() throws Exception { + AcceleratorType responsesElement = AcceleratorType.newBuilder().build(); + ListAcceleratorTypesResponse expectedResponse = + ListAcceleratorTypesResponse.newBuilder() + .setNextPageToken("") + .addAllAcceleratorTypes(Arrays.asList(responsesElement)) + .build(); + mockTpu.addResponse(expectedResponse); + + AcceleratorTypeName parent = + AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]"); + + ListAcceleratorTypesPagedResponse pagedListResponse = client.listAcceleratorTypes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAcceleratorTypesList().get(0), resources.get(0)); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAcceleratorTypesRequest actualRequest = + ((ListAcceleratorTypesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAcceleratorTypesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + AcceleratorTypeName parent = + AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]"); + client.listAcceleratorTypes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAcceleratorTypesTest2() throws Exception { + AcceleratorType responsesElement = AcceleratorType.newBuilder().build(); + ListAcceleratorTypesResponse expectedResponse = + ListAcceleratorTypesResponse.newBuilder() + .setNextPageToken("") + .addAllAcceleratorTypes(Arrays.asList(responsesElement)) + .build(); + mockTpu.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListAcceleratorTypesPagedResponse pagedListResponse = client.listAcceleratorTypes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAcceleratorTypesList().get(0), resources.get(0)); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAcceleratorTypesRequest actualRequest = + ((ListAcceleratorTypesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAcceleratorTypesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + String parent = "parent-995424086"; + client.listAcceleratorTypes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAcceleratorTypeTest() throws Exception { + AcceleratorType expectedResponse = + AcceleratorType.newBuilder() + .setName( + AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]").toString()) + .setType("type3575610") + .build(); + mockTpu.addResponse(expectedResponse); + + AcceleratorTypeName name = + AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]"); + + AcceleratorType actualResponse = client.getAcceleratorType(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAcceleratorTypeRequest actualRequest = ((GetAcceleratorTypeRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAcceleratorTypeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + AcceleratorTypeName name = + AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]"); + client.getAcceleratorType(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAcceleratorTypeTest2() throws Exception { + AcceleratorType expectedResponse = + AcceleratorType.newBuilder() + .setName( + AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]").toString()) + .setType("type3575610") + .build(); + mockTpu.addResponse(expectedResponse); + + String name = "name3373707"; + + AcceleratorType actualResponse = client.getAcceleratorType(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAcceleratorTypeRequest actualRequest = ((GetAcceleratorTypeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAcceleratorTypeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + String name = "name3373707"; + client.getAcceleratorType(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/owl-bot-staging/java-tpu/v1/grpc-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TpuGrpc.java b/owl-bot-staging/java-tpu/v1/grpc-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TpuGrpc.java new file mode 100644 index 000000000000..93e1da3f39ff --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/grpc-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TpuGrpc.java @@ -0,0 +1,1168 @@ +package com.google.cloud.tpu.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + *
+ * Manages TPU nodes and other resources
+ * TPU API v1
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/tpu/v1/cloud_tpu.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class TpuGrpc { + + private TpuGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.tpu.v1.Tpu"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getListNodesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListNodes", + requestType = com.google.cloud.tpu.v1.ListNodesRequest.class, + responseType = com.google.cloud.tpu.v1.ListNodesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListNodesMethod() { + io.grpc.MethodDescriptor getListNodesMethod; + if ((getListNodesMethod = TpuGrpc.getListNodesMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getListNodesMethod = TpuGrpc.getListNodesMethod) == null) { + TpuGrpc.getListNodesMethod = getListNodesMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListNodes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.ListNodesRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.ListNodesResponse.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("ListNodes")) + .build(); + } + } + } + return getListNodesMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetNode", + requestType = com.google.cloud.tpu.v1.GetNodeRequest.class, + responseType = com.google.cloud.tpu.v1.Node.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetNodeMethod() { + io.grpc.MethodDescriptor getGetNodeMethod; + if ((getGetNodeMethod = TpuGrpc.getGetNodeMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getGetNodeMethod = TpuGrpc.getGetNodeMethod) == null) { + TpuGrpc.getGetNodeMethod = getGetNodeMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetNode")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.GetNodeRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.Node.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("GetNode")) + .build(); + } + } + } + return getGetNodeMethod; + } + + private static volatile io.grpc.MethodDescriptor getCreateNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateNode", + requestType = com.google.cloud.tpu.v1.CreateNodeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getCreateNodeMethod() { + io.grpc.MethodDescriptor getCreateNodeMethod; + if ((getCreateNodeMethod = TpuGrpc.getCreateNodeMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getCreateNodeMethod = TpuGrpc.getCreateNodeMethod) == null) { + TpuGrpc.getCreateNodeMethod = getCreateNodeMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateNode")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.CreateNodeRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("CreateNode")) + .build(); + } + } + } + return getCreateNodeMethod; + } + + private static volatile io.grpc.MethodDescriptor getDeleteNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteNode", + requestType = com.google.cloud.tpu.v1.DeleteNodeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getDeleteNodeMethod() { + io.grpc.MethodDescriptor getDeleteNodeMethod; + if ((getDeleteNodeMethod = TpuGrpc.getDeleteNodeMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getDeleteNodeMethod = TpuGrpc.getDeleteNodeMethod) == null) { + TpuGrpc.getDeleteNodeMethod = getDeleteNodeMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteNode")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.DeleteNodeRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("DeleteNode")) + .build(); + } + } + } + return getDeleteNodeMethod; + } + + private static volatile io.grpc.MethodDescriptor getReimageNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ReimageNode", + requestType = com.google.cloud.tpu.v1.ReimageNodeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getReimageNodeMethod() { + io.grpc.MethodDescriptor getReimageNodeMethod; + if ((getReimageNodeMethod = TpuGrpc.getReimageNodeMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getReimageNodeMethod = TpuGrpc.getReimageNodeMethod) == null) { + TpuGrpc.getReimageNodeMethod = getReimageNodeMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ReimageNode")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.ReimageNodeRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("ReimageNode")) + .build(); + } + } + } + return getReimageNodeMethod; + } + + private static volatile io.grpc.MethodDescriptor getStopNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StopNode", + requestType = com.google.cloud.tpu.v1.StopNodeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getStopNodeMethod() { + io.grpc.MethodDescriptor getStopNodeMethod; + if ((getStopNodeMethod = TpuGrpc.getStopNodeMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getStopNodeMethod = TpuGrpc.getStopNodeMethod) == null) { + TpuGrpc.getStopNodeMethod = getStopNodeMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StopNode")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.StopNodeRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("StopNode")) + .build(); + } + } + } + return getStopNodeMethod; + } + + private static volatile io.grpc.MethodDescriptor getStartNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StartNode", + requestType = com.google.cloud.tpu.v1.StartNodeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getStartNodeMethod() { + io.grpc.MethodDescriptor getStartNodeMethod; + if ((getStartNodeMethod = TpuGrpc.getStartNodeMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getStartNodeMethod = TpuGrpc.getStartNodeMethod) == null) { + TpuGrpc.getStartNodeMethod = getStartNodeMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StartNode")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.StartNodeRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("StartNode")) + .build(); + } + } + } + return getStartNodeMethod; + } + + private static volatile io.grpc.MethodDescriptor getListTensorFlowVersionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListTensorFlowVersions", + requestType = com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest.class, + responseType = com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListTensorFlowVersionsMethod() { + io.grpc.MethodDescriptor getListTensorFlowVersionsMethod; + if ((getListTensorFlowVersionsMethod = TpuGrpc.getListTensorFlowVersionsMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getListTensorFlowVersionsMethod = TpuGrpc.getListTensorFlowVersionsMethod) == null) { + TpuGrpc.getListTensorFlowVersionsMethod = getListTensorFlowVersionsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListTensorFlowVersions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("ListTensorFlowVersions")) + .build(); + } + } + } + return getListTensorFlowVersionsMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetTensorFlowVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetTensorFlowVersion", + requestType = com.google.cloud.tpu.v1.GetTensorFlowVersionRequest.class, + responseType = com.google.cloud.tpu.v1.TensorFlowVersion.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetTensorFlowVersionMethod() { + io.grpc.MethodDescriptor getGetTensorFlowVersionMethod; + if ((getGetTensorFlowVersionMethod = TpuGrpc.getGetTensorFlowVersionMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getGetTensorFlowVersionMethod = TpuGrpc.getGetTensorFlowVersionMethod) == null) { + TpuGrpc.getGetTensorFlowVersionMethod = getGetTensorFlowVersionMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetTensorFlowVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.TensorFlowVersion.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("GetTensorFlowVersion")) + .build(); + } + } + } + return getGetTensorFlowVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor getListAcceleratorTypesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListAcceleratorTypes", + requestType = com.google.cloud.tpu.v1.ListAcceleratorTypesRequest.class, + responseType = com.google.cloud.tpu.v1.ListAcceleratorTypesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListAcceleratorTypesMethod() { + io.grpc.MethodDescriptor getListAcceleratorTypesMethod; + if ((getListAcceleratorTypesMethod = TpuGrpc.getListAcceleratorTypesMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getListAcceleratorTypesMethod = TpuGrpc.getListAcceleratorTypesMethod) == null) { + TpuGrpc.getListAcceleratorTypesMethod = getListAcceleratorTypesMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListAcceleratorTypes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.ListAcceleratorTypesResponse.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("ListAcceleratorTypes")) + .build(); + } + } + } + return getListAcceleratorTypesMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetAcceleratorTypeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAcceleratorType", + requestType = com.google.cloud.tpu.v1.GetAcceleratorTypeRequest.class, + responseType = com.google.cloud.tpu.v1.AcceleratorType.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetAcceleratorTypeMethod() { + io.grpc.MethodDescriptor getGetAcceleratorTypeMethod; + if ((getGetAcceleratorTypeMethod = TpuGrpc.getGetAcceleratorTypeMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getGetAcceleratorTypeMethod = TpuGrpc.getGetAcceleratorTypeMethod) == null) { + TpuGrpc.getGetAcceleratorTypeMethod = getGetAcceleratorTypeMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetAcceleratorType")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v1.AcceleratorType.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("GetAcceleratorType")) + .build(); + } + } + } + return getGetAcceleratorTypeMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static TpuStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TpuStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TpuStub(channel, callOptions); + } + }; + return TpuStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static TpuBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TpuBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TpuBlockingStub(channel, callOptions); + } + }; + return TpuBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static TpuFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TpuFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TpuFutureStub(channel, callOptions); + } + }; + return TpuFutureStub.newStub(factory, channel); + } + + /** + *
+   * Manages TPU nodes and other resources
+   * TPU API v1
+   * 
+ */ + public static abstract class TpuImplBase implements io.grpc.BindableService { + + /** + *
+     * Lists nodes.
+     * 
+ */ + public void listNodes(com.google.cloud.tpu.v1.ListNodesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListNodesMethod(), responseObserver); + } + + /** + *
+     * Gets the details of a node.
+     * 
+ */ + public void getNode(com.google.cloud.tpu.v1.GetNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetNodeMethod(), responseObserver); + } + + /** + *
+     * Creates a node.
+     * 
+ */ + public void createNode(com.google.cloud.tpu.v1.CreateNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateNodeMethod(), responseObserver); + } + + /** + *
+     * Deletes a node.
+     * 
+ */ + public void deleteNode(com.google.cloud.tpu.v1.DeleteNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteNodeMethod(), responseObserver); + } + + /** + *
+     * Reimages a node's OS.
+     * 
+ */ + public void reimageNode(com.google.cloud.tpu.v1.ReimageNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getReimageNodeMethod(), responseObserver); + } + + /** + *
+     * Stops a node.
+     * 
+ */ + public void stopNode(com.google.cloud.tpu.v1.StopNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStopNodeMethod(), responseObserver); + } + + /** + *
+     * Starts a node.
+     * 
+ */ + public void startNode(com.google.cloud.tpu.v1.StartNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStartNodeMethod(), responseObserver); + } + + /** + *
+     * List TensorFlow versions supported by this API.
+     * 
+ */ + public void listTensorFlowVersions(com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListTensorFlowVersionsMethod(), responseObserver); + } + + /** + *
+     * Gets TensorFlow Version.
+     * 
+ */ + public void getTensorFlowVersion(com.google.cloud.tpu.v1.GetTensorFlowVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetTensorFlowVersionMethod(), responseObserver); + } + + /** + *
+     * Lists accelerator types supported by this API.
+     * 
+ */ + public void listAcceleratorTypes(com.google.cloud.tpu.v1.ListAcceleratorTypesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListAcceleratorTypesMethod(), responseObserver); + } + + /** + *
+     * Gets AcceleratorType.
+     * 
+ */ + public void getAcceleratorType(com.google.cloud.tpu.v1.GetAcceleratorTypeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetAcceleratorTypeMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListNodesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v1.ListNodesRequest, + com.google.cloud.tpu.v1.ListNodesResponse>( + this, METHODID_LIST_NODES))) + .addMethod( + getGetNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v1.GetNodeRequest, + com.google.cloud.tpu.v1.Node>( + this, METHODID_GET_NODE))) + .addMethod( + getCreateNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v1.CreateNodeRequest, + com.google.longrunning.Operation>( + this, METHODID_CREATE_NODE))) + .addMethod( + getDeleteNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v1.DeleteNodeRequest, + com.google.longrunning.Operation>( + this, METHODID_DELETE_NODE))) + .addMethod( + getReimageNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v1.ReimageNodeRequest, + com.google.longrunning.Operation>( + this, METHODID_REIMAGE_NODE))) + .addMethod( + getStopNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v1.StopNodeRequest, + com.google.longrunning.Operation>( + this, METHODID_STOP_NODE))) + .addMethod( + getStartNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v1.StartNodeRequest, + com.google.longrunning.Operation>( + this, METHODID_START_NODE))) + .addMethod( + getListTensorFlowVersionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest, + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse>( + this, METHODID_LIST_TENSOR_FLOW_VERSIONS))) + .addMethod( + getGetTensorFlowVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest, + com.google.cloud.tpu.v1.TensorFlowVersion>( + this, METHODID_GET_TENSOR_FLOW_VERSION))) + .addMethod( + getListAcceleratorTypesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest, + com.google.cloud.tpu.v1.ListAcceleratorTypesResponse>( + this, METHODID_LIST_ACCELERATOR_TYPES))) + .addMethod( + getGetAcceleratorTypeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest, + com.google.cloud.tpu.v1.AcceleratorType>( + this, METHODID_GET_ACCELERATOR_TYPE))) + .build(); + } + } + + /** + *
+   * Manages TPU nodes and other resources
+   * TPU API v1
+   * 
+ */ + public static final class TpuStub extends io.grpc.stub.AbstractAsyncStub { + private TpuStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TpuStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TpuStub(channel, callOptions); + } + + /** + *
+     * Lists nodes.
+     * 
+ */ + public void listNodes(com.google.cloud.tpu.v1.ListNodesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListNodesMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Gets the details of a node.
+     * 
+ */ + public void getNode(com.google.cloud.tpu.v1.GetNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetNodeMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Creates a node.
+     * 
+ */ + public void createNode(com.google.cloud.tpu.v1.CreateNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateNodeMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Deletes a node.
+     * 
+ */ + public void deleteNode(com.google.cloud.tpu.v1.DeleteNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteNodeMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Reimages a node's OS.
+     * 
+ */ + public void reimageNode(com.google.cloud.tpu.v1.ReimageNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getReimageNodeMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Stops a node.
+     * 
+ */ + public void stopNode(com.google.cloud.tpu.v1.StopNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getStopNodeMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Starts a node.
+     * 
+ */ + public void startNode(com.google.cloud.tpu.v1.StartNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getStartNodeMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * List TensorFlow versions supported by this API.
+     * 
+ */ + public void listTensorFlowVersions(com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListTensorFlowVersionsMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Gets TensorFlow Version.
+     * 
+ */ + public void getTensorFlowVersion(com.google.cloud.tpu.v1.GetTensorFlowVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetTensorFlowVersionMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Lists accelerator types supported by this API.
+     * 
+ */ + public void listAcceleratorTypes(com.google.cloud.tpu.v1.ListAcceleratorTypesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListAcceleratorTypesMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Gets AcceleratorType.
+     * 
+ */ + public void getAcceleratorType(com.google.cloud.tpu.v1.GetAcceleratorTypeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetAcceleratorTypeMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + *
+   * Manages TPU nodes and other resources
+   * TPU API v1
+   * 
+ */ + public static final class TpuBlockingStub extends io.grpc.stub.AbstractBlockingStub { + private TpuBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TpuBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TpuBlockingStub(channel, callOptions); + } + + /** + *
+     * Lists nodes.
+     * 
+ */ + public com.google.cloud.tpu.v1.ListNodesResponse listNodes(com.google.cloud.tpu.v1.ListNodesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListNodesMethod(), getCallOptions(), request); + } + + /** + *
+     * Gets the details of a node.
+     * 
+ */ + public com.google.cloud.tpu.v1.Node getNode(com.google.cloud.tpu.v1.GetNodeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetNodeMethod(), getCallOptions(), request); + } + + /** + *
+     * Creates a node.
+     * 
+ */ + public com.google.longrunning.Operation createNode(com.google.cloud.tpu.v1.CreateNodeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateNodeMethod(), getCallOptions(), request); + } + + /** + *
+     * Deletes a node.
+     * 
+ */ + public com.google.longrunning.Operation deleteNode(com.google.cloud.tpu.v1.DeleteNodeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteNodeMethod(), getCallOptions(), request); + } + + /** + *
+     * Reimages a node's OS.
+     * 
+ */ + public com.google.longrunning.Operation reimageNode(com.google.cloud.tpu.v1.ReimageNodeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getReimageNodeMethod(), getCallOptions(), request); + } + + /** + *
+     * Stops a node.
+     * 
+ */ + public com.google.longrunning.Operation stopNode(com.google.cloud.tpu.v1.StopNodeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getStopNodeMethod(), getCallOptions(), request); + } + + /** + *
+     * Starts a node.
+     * 
+ */ + public com.google.longrunning.Operation startNode(com.google.cloud.tpu.v1.StartNodeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getStartNodeMethod(), getCallOptions(), request); + } + + /** + *
+     * List TensorFlow versions supported by this API.
+     * 
+ */ + public com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse listTensorFlowVersions(com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListTensorFlowVersionsMethod(), getCallOptions(), request); + } + + /** + *
+     * Gets TensorFlow Version.
+     * 
+ */ + public com.google.cloud.tpu.v1.TensorFlowVersion getTensorFlowVersion(com.google.cloud.tpu.v1.GetTensorFlowVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetTensorFlowVersionMethod(), getCallOptions(), request); + } + + /** + *
+     * Lists accelerator types supported by this API.
+     * 
+ */ + public com.google.cloud.tpu.v1.ListAcceleratorTypesResponse listAcceleratorTypes(com.google.cloud.tpu.v1.ListAcceleratorTypesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListAcceleratorTypesMethod(), getCallOptions(), request); + } + + /** + *
+     * Gets AcceleratorType.
+     * 
+ */ + public com.google.cloud.tpu.v1.AcceleratorType getAcceleratorType(com.google.cloud.tpu.v1.GetAcceleratorTypeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetAcceleratorTypeMethod(), getCallOptions(), request); + } + } + + /** + *
+   * Manages TPU nodes and other resources
+   * TPU API v1
+   * 
+ */ + public static final class TpuFutureStub extends io.grpc.stub.AbstractFutureStub { + private TpuFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TpuFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TpuFutureStub(channel, callOptions); + } + + /** + *
+     * Lists nodes.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listNodes( + com.google.cloud.tpu.v1.ListNodesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListNodesMethod(), getCallOptions()), request); + } + + /** + *
+     * Gets the details of a node.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getNode( + com.google.cloud.tpu.v1.GetNodeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetNodeMethod(), getCallOptions()), request); + } + + /** + *
+     * Creates a node.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture createNode( + com.google.cloud.tpu.v1.CreateNodeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateNodeMethod(), getCallOptions()), request); + } + + /** + *
+     * Deletes a node.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteNode( + com.google.cloud.tpu.v1.DeleteNodeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteNodeMethod(), getCallOptions()), request); + } + + /** + *
+     * Reimages a node's OS.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture reimageNode( + com.google.cloud.tpu.v1.ReimageNodeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getReimageNodeMethod(), getCallOptions()), request); + } + + /** + *
+     * Stops a node.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture stopNode( + com.google.cloud.tpu.v1.StopNodeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getStopNodeMethod(), getCallOptions()), request); + } + + /** + *
+     * Starts a node.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture startNode( + com.google.cloud.tpu.v1.StartNodeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getStartNodeMethod(), getCallOptions()), request); + } + + /** + *
+     * List TensorFlow versions supported by this API.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listTensorFlowVersions( + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListTensorFlowVersionsMethod(), getCallOptions()), request); + } + + /** + *
+     * Gets TensorFlow Version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getTensorFlowVersion( + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetTensorFlowVersionMethod(), getCallOptions()), request); + } + + /** + *
+     * Lists accelerator types supported by this API.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listAcceleratorTypes( + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListAcceleratorTypesMethod(), getCallOptions()), request); + } + + /** + *
+     * Gets AcceleratorType.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getAcceleratorType( + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetAcceleratorTypeMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_NODES = 0; + private static final int METHODID_GET_NODE = 1; + private static final int METHODID_CREATE_NODE = 2; + private static final int METHODID_DELETE_NODE = 3; + private static final int METHODID_REIMAGE_NODE = 4; + private static final int METHODID_STOP_NODE = 5; + private static final int METHODID_START_NODE = 6; + private static final int METHODID_LIST_TENSOR_FLOW_VERSIONS = 7; + private static final int METHODID_GET_TENSOR_FLOW_VERSION = 8; + private static final int METHODID_LIST_ACCELERATOR_TYPES = 9; + private static final int METHODID_GET_ACCELERATOR_TYPE = 10; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final TpuImplBase serviceImpl; + private final int methodId; + + MethodHandlers(TpuImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_NODES: + serviceImpl.listNodes((com.google.cloud.tpu.v1.ListNodesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_NODE: + serviceImpl.getNode((com.google.cloud.tpu.v1.GetNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_NODE: + serviceImpl.createNode((com.google.cloud.tpu.v1.CreateNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_NODE: + serviceImpl.deleteNode((com.google.cloud.tpu.v1.DeleteNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REIMAGE_NODE: + serviceImpl.reimageNode((com.google.cloud.tpu.v1.ReimageNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_STOP_NODE: + serviceImpl.stopNode((com.google.cloud.tpu.v1.StopNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_START_NODE: + serviceImpl.startNode((com.google.cloud.tpu.v1.StartNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_TENSOR_FLOW_VERSIONS: + serviceImpl.listTensorFlowVersions((com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_TENSOR_FLOW_VERSION: + serviceImpl.getTensorFlowVersion((com.google.cloud.tpu.v1.GetTensorFlowVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_ACCELERATOR_TYPES: + serviceImpl.listAcceleratorTypes((com.google.cloud.tpu.v1.ListAcceleratorTypesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_ACCELERATOR_TYPE: + serviceImpl.getAcceleratorType((com.google.cloud.tpu.v1.GetAcceleratorTypeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private static abstract class TpuBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + TpuBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Tpu"); + } + } + + private static final class TpuFileDescriptorSupplier + extends TpuBaseDescriptorSupplier { + TpuFileDescriptorSupplier() {} + } + + private static final class TpuMethodDescriptorSupplier + extends TpuBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + TpuMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (TpuGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new TpuFileDescriptorSupplier()) + .addMethod(getListNodesMethod()) + .addMethod(getGetNodeMethod()) + .addMethod(getCreateNodeMethod()) + .addMethod(getDeleteNodeMethod()) + .addMethod(getReimageNodeMethod()) + .addMethod(getStopNodeMethod()) + .addMethod(getStartNodeMethod()) + .addMethod(getListTensorFlowVersionsMethod()) + .addMethod(getGetTensorFlowVersionMethod()) + .addMethod(getListAcceleratorTypesMethod()) + .addMethod(getGetAcceleratorTypeMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorType.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorType.java new file mode 100644 index 000000000000..0f7e7efa934f --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorType.java @@ -0,0 +1,761 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + *
+ * A accelerator type that a Node can be configured with.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.AcceleratorType} + */ +public final class AcceleratorType extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.AcceleratorType) + AcceleratorTypeOrBuilder { +private static final long serialVersionUID = 0L; + // Use AcceleratorType.newBuilder() to construct. + private AcceleratorType(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AcceleratorType() { + name_ = ""; + type_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AcceleratorType(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AcceleratorType( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_AcceleratorType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_AcceleratorType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.AcceleratorType.class, com.google.cloud.tpu.v1.AcceleratorType.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object type_; + /** + *
+   * the accelerator type.
+   * 
+ * + * string type = 2; + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } + } + /** + *
+   * the accelerator type.
+   * 
+ * + * string type = 2; + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!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.v1.AcceleratorType)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.AcceleratorType other = (com.google.cloud.tpu.v1.AcceleratorType) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getType() + .equals(other.getType())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.AcceleratorType parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.AcceleratorType parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.AcceleratorType parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.AcceleratorType parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.AcceleratorType parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.AcceleratorType parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.AcceleratorType parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.AcceleratorType parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.AcceleratorType parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.AcceleratorType parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.AcceleratorType parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.AcceleratorType parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.tpu.v1.AcceleratorType prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A accelerator type that a Node can be configured with.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.AcceleratorType} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.AcceleratorType) + com.google.cloud.tpu.v1.AcceleratorTypeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_AcceleratorType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_AcceleratorType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.AcceleratorType.class, com.google.cloud.tpu.v1.AcceleratorType.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.AcceleratorType.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + type_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_AcceleratorType_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.AcceleratorType getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.AcceleratorType.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.AcceleratorType build() { + com.google.cloud.tpu.v1.AcceleratorType result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.AcceleratorType buildPartial() { + com.google.cloud.tpu.v1.AcceleratorType result = new com.google.cloud.tpu.v1.AcceleratorType(this); + result.name_ = name_; + result.type_ = type_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.AcceleratorType) { + return mergeFrom((com.google.cloud.tpu.v1.AcceleratorType)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.AcceleratorType other) { + if (other == com.google.cloud.tpu.v1.AcceleratorType.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.AcceleratorType parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.AcceleratorType) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + *
+     * the accelerator type.
+     * 
+ * + * string type = 2; + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * the accelerator type.
+     * 
+ * + * string type = 2; + * @return The bytes for type. + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * the accelerator type.
+     * 
+ * + * string type = 2; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + *
+     * the accelerator type.
+     * 
+ * + * string type = 2; + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + *
+     * the accelerator type.
+     * 
+ * + * string type = 2; + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.AcceleratorType) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.AcceleratorType) + private static final com.google.cloud.tpu.v1.AcceleratorType DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.AcceleratorType(); + } + + public static com.google.cloud.tpu.v1.AcceleratorType getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AcceleratorType parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AcceleratorType(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.AcceleratorType getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorTypeName.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorTypeName.java new file mode 100644 index 000000000000..fbe1ba56034c --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorTypeName.java @@ -0,0 +1,227 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class AcceleratorTypeName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_ACCELERATOR_TYPE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/acceleratorTypes/{accelerator_type}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String acceleratorType; + + @Deprecated + protected AcceleratorTypeName() { + project = null; + location = null; + acceleratorType = null; + } + + private AcceleratorTypeName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + acceleratorType = Preconditions.checkNotNull(builder.getAcceleratorType()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAcceleratorType() { + return acceleratorType; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static AcceleratorTypeName of(String project, String location, String acceleratorType) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAcceleratorType(acceleratorType) + .build(); + } + + public static String format(String project, String location, String acceleratorType) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAcceleratorType(acceleratorType) + .build() + .toString(); + } + + public static AcceleratorTypeName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_ACCELERATOR_TYPE.validatedMatch( + formattedString, "AcceleratorTypeName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("accelerator_type")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (AcceleratorTypeName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_ACCELERATOR_TYPE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (acceleratorType != null) { + fieldMapBuilder.put("accelerator_type", acceleratorType); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_ACCELERATOR_TYPE.instantiate( + "project", project, "location", location, "accelerator_type", acceleratorType); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + AcceleratorTypeName that = ((AcceleratorTypeName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.acceleratorType, that.acceleratorType); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(acceleratorType); + return h; + } + + /** Builder for projects/{project}/locations/{location}/acceleratorTypes/{accelerator_type}. */ + public static class Builder { + private String project; + private String location; + private String acceleratorType; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAcceleratorType() { + return acceleratorType; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setAcceleratorType(String acceleratorType) { + this.acceleratorType = acceleratorType; + return this; + } + + private Builder(AcceleratorTypeName acceleratorTypeName) { + this.project = acceleratorTypeName.project; + this.location = acceleratorTypeName.location; + this.acceleratorType = acceleratorTypeName.acceleratorType; + } + + public AcceleratorTypeName build() { + return new AcceleratorTypeName(this); + } + } +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorTypeOrBuilder.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorTypeOrBuilder.java new file mode 100644 index 000000000000..26cc04022f2b --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/AcceleratorTypeOrBuilder.java @@ -0,0 +1,49 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface AcceleratorTypeOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.AcceleratorType) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * the accelerator type.
+   * 
+ * + * string type = 2; + * @return The type. + */ + java.lang.String getType(); + /** + *
+   * the accelerator type.
+   * 
+ * + * string type = 2; + * @return The bytes for type. + */ + com.google.protobuf.ByteString + getTypeBytes(); +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CloudTpuProto.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CloudTpuProto.java new file mode 100644 index 000000000000..19b329211135 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CloudTpuProto.java @@ -0,0 +1,454 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public final class CloudTpuProto { + private CloudTpuProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_SchedulingConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_SchedulingConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_NetworkEndpoint_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_NetworkEndpoint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_Node_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_Node_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_Node_LabelsEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_Node_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_ListNodesRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_ListNodesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_ListNodesResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_ListNodesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_GetNodeRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_GetNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_CreateNodeRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_CreateNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_DeleteNodeRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_DeleteNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_ReimageNodeRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_ReimageNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_StopNodeRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_StopNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_StartNodeRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_StartNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_TensorFlowVersion_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_TensorFlowVersion_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_GetTensorFlowVersionRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_GetTensorFlowVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_AcceleratorType_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_AcceleratorType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_GetAcceleratorTypeRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_GetAcceleratorTypeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_ListAcceleratorTypesRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_ListAcceleratorTypesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_ListAcceleratorTypesResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_ListAcceleratorTypesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_OperationMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_OperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v1_Symptom_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v1_Symptom_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n#google/cloud/tpu/v1/cloud_tpu.proto\022\023g" + + "oogle.cloud.tpu.v1\032\034google/api/annotatio" + + "ns.proto\032\027google/api/client.proto\032\037googl" + + "e/api/field_behavior.proto\032\031google/api/r" + + "esource.proto\032#google/longrunning/operat" + + "ions.proto\032\037google/protobuf/timestamp.pr" + + "oto\"9\n\020SchedulingConfig\022\023\n\013preemptible\030\001" + + " \001(\010\022\020\n\010reserved\030\002 \001(\010\"3\n\017NetworkEndpoin" + + "t\022\022\n\nip_address\030\001 \001(\t\022\014\n\004port\030\002 \001(\005\"\264\n\n\004" + + "Node\022\024\n\004name\030\001 \001(\tB\006\340A\005\340A\003\022\023\n\013descriptio" + + "n\030\003 \001(\t\022\035\n\020accelerator_type\030\005 \001(\tB\003\340A\002\022\026" + + "\n\nip_address\030\010 \001(\tB\002\030\001\022\020\n\004port\030\016 \001(\tB\002\030\001" + + "\0223\n\005state\030\t \001(\0162\037.google.cloud.tpu.v1.No" + + "de.StateB\003\340A\003\022\037\n\022health_description\030\n \001(" + + "\tB\003\340A\003\022\037\n\022tensorflow_version\030\013 \001(\tB\003\340A\002\022" + + "\017\n\007network\030\014 \001(\t\022\022\n\ncidr_block\030\r \001(\t\022\034\n\017" + + "service_account\030\017 \001(\tB\003\340A\003\0224\n\013create_tim" + + "e\030\020 \001(\0132\032.google.protobuf.TimestampB\003\340A\003" + + "\022@\n\021scheduling_config\030\021 \001(\0132%.google.clo" + + "ud.tpu.v1.SchedulingConfig\022D\n\021network_en" + + "dpoints\030\025 \003(\0132$.google.cloud.tpu.v1.Netw" + + "orkEndpointB\003\340A\003\0220\n\006health\030\026 \001(\0162 .googl" + + "e.cloud.tpu.v1.Node.Health\0225\n\006labels\030\030 \003" + + "(\0132%.google.cloud.tpu.v1.Node.LabelsEntr" + + "y\022\036\n\026use_service_networking\030\033 \001(\010\022>\n\013api" + + "_version\030& \001(\0162$.google.cloud.tpu.v1.Nod" + + "e.ApiVersionB\003\340A\003\0223\n\010symptoms\030\' \003(\0132\034.go" + + "ogle.cloud.tpu.v1.SymptomB\003\340A\003\032-\n\013Labels" + + "Entry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\341\001" + + "\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\014\n\010CREATI" + + "NG\020\001\022\t\n\005READY\020\002\022\016\n\nRESTARTING\020\003\022\r\n\tREIMA" + + "GING\020\004\022\014\n\010DELETING\020\005\022\r\n\tREPAIRING\020\006\022\013\n\007S" + + "TOPPED\020\010\022\014\n\010STOPPING\020\t\022\014\n\010STARTING\020\n\022\r\n\t" + + "PREEMPTED\020\013\022\016\n\nTERMINATED\020\014\022\n\n\006HIDING\020\r\022" + + "\n\n\006HIDDEN\020\016\022\014\n\010UNHIDING\020\017\"\211\001\n\006Health\022\026\n\022" + + "HEALTH_UNSPECIFIED\020\000\022\013\n\007HEALTHY\020\001\022\030\n\024DEP" + + "RECATED_UNHEALTHY\020\002\022\013\n\007TIMEOUT\020\003\022\030\n\024UNHE" + + "ALTHY_TENSORFLOW\020\004\022\031\n\025UNHEALTHY_MAINTENA" + + "NCE\020\005\"O\n\nApiVersion\022\033\n\027API_VERSION_UNSPE" + + "CIFIED\020\000\022\r\n\tV1_ALPHA1\020\001\022\006\n\002V1\020\002\022\r\n\tV2_AL" + + "PHA1\020\003:R\352AO\n\027tpu.googleapis.com/Node\0224pr" + + "ojects/{project}/locations/{location}/no" + + "des/{node}\"j\n\020ListNodesRequest\022/\n\006parent" + + "\030\001 \001(\tB\037\340A\002\372A\031\022\027tpu.googleapis.com/Node\022" + + "\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"k" + + "\n\021ListNodesResponse\022(\n\005nodes\030\001 \003(\0132\031.goo" + + "gle.cloud.tpu.v1.Node\022\027\n\017next_page_token" + + "\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"?\n\016GetNodeRe" + + "quest\022-\n\004name\030\001 \001(\tB\037\340A\002\372A\031\n\027tpu.googlea" + + "pis.com/Node\"\203\001\n\021CreateNodeRequest\022/\n\006pa" + + "rent\030\001 \001(\tB\037\340A\002\372A\031\022\027tpu.googleapis.com/N" + + "ode\022\017\n\007node_id\030\002 \001(\t\022,\n\004node\030\003 \001(\0132\031.goo" + + "gle.cloud.tpu.v1.NodeB\003\340A\002\"B\n\021DeleteNode" + + "Request\022-\n\004name\030\001 \001(\tB\037\340A\002\372A\031\n\027tpu.googl" + + "eapis.com/Node\">\n\022ReimageNodeRequest\022\014\n\004" + + "name\030\001 \001(\t\022\032\n\022tensorflow_version\030\002 \001(\t\"\037" + + "\n\017StopNodeRequest\022\014\n\004name\030\001 \001(\t\" \n\020Start" + + "NodeRequest\022\014\n\004name\030\001 \001(\t\"\257\001\n\021TensorFlow" + + "Version\022\014\n\004name\030\001 \001(\t\022\017\n\007version\030\002 \001(\t:{" + + "\352Ax\n$tpu.googleapis.com/TensorFlowVersio" + + "n\022Pprojects/{project}/locations/{locatio" + + "n}/tensorFlowVersions/{tensor_flow_versi" + + "on}\"Y\n\033GetTensorFlowVersionRequest\022:\n\004na" + + "me\030\001 \001(\tB,\340A\002\372A&\n$tpu.googleapis.com/Ten" + + "sorFlowVersion\"\246\001\n\035ListTensorFlowVersion" + + "sRequest\022<\n\006parent\030\001 \001(\tB,\340A\002\372A&\n$tpu.go" + + "ogleapis.com/TensorFlowVersion\022\021\n\tpage_s" + + "ize\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n\006filter\030" + + "\005 \001(\t\022\020\n\010order_by\030\006 \001(\t\"\223\001\n\036ListTensorFl" + + "owVersionsResponse\022C\n\023tensorflow_version" + + "s\030\001 \003(\0132&.google.cloud.tpu.v1.TensorFlow" + + "Version\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unre" + + "achable\030\003 \003(\t\"\243\001\n\017AcceleratorType\022\014\n\004nam" + + "e\030\001 \001(\t\022\014\n\004type\030\002 \001(\t:t\352Aq\n\"tpu.googleap" + + "is.com/AcceleratorType\022Kprojects/{projec" + + "t}/locations/{location}/acceleratorTypes" + + "/{accelerator_type}\"U\n\031GetAcceleratorTyp" + + "eRequest\0228\n\004name\030\001 \001(\tB*\340A\002\372A$\n\"tpu.goog" + + "leapis.com/AcceleratorType\"\242\001\n\033ListAccel" + + "eratorTypesRequest\022:\n\006parent\030\001 \001(\tB*\340A\002\372" + + "A$\n\"tpu.googleapis.com/AcceleratorType\022\021" + + "\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n" + + "\006filter\030\005 \001(\t\022\020\n\010order_by\030\006 \001(\t\"\215\001\n\034List" + + "AcceleratorTypesResponse\022?\n\021accelerator_" + + "types\030\001 \003(\0132$.google.cloud.tpu.v1.Accele" + + "ratorType\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013un" + + "reachable\030\003 \003(\t\"\326\001\n\021OperationMetadata\022/\n" + + "\013create_time\030\001 \001(\0132\032.google.protobuf.Tim" + + "estamp\022,\n\010end_time\030\002 \001(\0132\032.google.protob" + + "uf.Timestamp\022\016\n\006target\030\003 \001(\t\022\014\n\004verb\030\004 \001" + + "(\t\022\025\n\rstatus_detail\030\005 \001(\t\022\030\n\020cancel_requ" + + "ested\030\006 \001(\010\022\023\n\013api_version\030\007 \001(\t\"\305\002\n\007Sym" + + "ptom\022/\n\013create_time\030\001 \001(\0132\032.google.proto" + + "buf.Timestamp\022>\n\014symptom_type\030\002 \001(\0162(.go" + + "ogle.cloud.tpu.v1.Symptom.SymptomType\022\017\n" + + "\007details\030\003 \001(\t\022\021\n\tworker_id\030\004 \001(\t\"\244\001\n\013Sy" + + "mptomType\022\034\n\030SYMPTOM_TYPE_UNSPECIFIED\020\000\022" + + "\016\n\nLOW_MEMORY\020\001\022\021\n\rOUT_OF_MEMORY\020\002\022\025\n\021EX" + + "ECUTE_TIMED_OUT\020\003\022\023\n\017MESH_BUILD_FAIL\020\004\022\025" + + "\n\021HBM_OUT_OF_MEMORY\020\005\022\021\n\rPROJECT_ABUSE\020\006" + + "2\336\017\n\003Tpu\022\226\001\n\tListNodes\022%.google.cloud.tp" + + "u.v1.ListNodesRequest\032&.google.cloud.tpu" + + ".v1.ListNodesResponse\":\202\323\344\223\002+\022)/v1/{pare" + + "nt=projects/*/locations/*}/nodes\332A\006paren" + + "t\022\203\001\n\007GetNode\022#.google.cloud.tpu.v1.GetN" + + "odeRequest\032\031.google.cloud.tpu.v1.Node\"8\202" + + "\323\344\223\002+\022)/v1/{name=projects/*/locations/*/" + + "nodes/*}\332A\004name\022\276\001\n\nCreateNode\022&.google." + + "cloud.tpu.v1.CreateNodeRequest\032\035.google." + + "longrunning.Operation\"i\202\323\344\223\0021\")/v1/{pare" + + "nt=projects/*/locations/*}/nodes:\004node\332A" + + "\023parent,node,node_id\312A\031\n\004Node\022\021Operation" + + "Metadata\022\251\001\n\nDeleteNode\022&.google.cloud.t" + + "pu.v1.DeleteNodeRequest\032\035.google.longrun" + + "ning.Operation\"T\202\323\344\223\002+*)/v1/{name=projec" + + "ts/*/locations/*/nodes/*}\332A\004name\312A\031\n\004Nod" + + "e\022\021OperationMetadata\022\257\001\n\013ReimageNode\022\'.g" + + "oogle.cloud.tpu.v1.ReimageNodeRequest\032\035." + + "google.longrunning.Operation\"X\202\323\344\223\0026\"1/v" + + "1/{name=projects/*/locations/*/nodes/*}:" + + "reimage:\001*\312A\031\n\004Node\022\021OperationMetadata\022\246" + + "\001\n\010StopNode\022$.google.cloud.tpu.v1.StopNo" + + "deRequest\032\035.google.longrunning.Operation" + + "\"U\202\323\344\223\0023\"./v1/{name=projects/*/locations" + + "/*/nodes/*}:stop:\001*\312A\031\n\004Node\022\021OperationM" + + "etadata\022\251\001\n\tStartNode\022%.google.cloud.tpu" + + ".v1.StartNodeRequest\032\035.google.longrunnin" + + "g.Operation\"V\202\323\344\223\0024\"//v1/{name=projects/" + + "*/locations/*/nodes/*}:start:\001*\312A\031\n\004Node" + + "\022\021OperationMetadata\022\312\001\n\026ListTensorFlowVe" + + "rsions\0222.google.cloud.tpu.v1.ListTensorF" + + "lowVersionsRequest\0323.google.cloud.tpu.v1" + + ".ListTensorFlowVersionsResponse\"G\202\323\344\223\0028\022" + + "6/v1/{parent=projects/*/locations/*}/ten" + + "sorflowVersions\332A\006parent\022\267\001\n\024GetTensorFl" + + "owVersion\0220.google.cloud.tpu.v1.GetTenso" + + "rFlowVersionRequest\032&.google.cloud.tpu.v" + + "1.TensorFlowVersion\"E\202\323\344\223\0028\0226/v1/{name=p" + + "rojects/*/locations/*/tensorflowVersions" + + "/*}\332A\004name\022\302\001\n\024ListAcceleratorTypes\0220.go" + + "ogle.cloud.tpu.v1.ListAcceleratorTypesRe" + + "quest\0321.google.cloud.tpu.v1.ListAccelera" + + "torTypesResponse\"E\202\323\344\223\0026\0224/v1/{parent=pr" + + "ojects/*/locations/*}/acceleratorTypes\332A" + + "\006parent\022\257\001\n\022GetAcceleratorType\022..google." + + "cloud.tpu.v1.GetAcceleratorTypeRequest\032$" + + ".google.cloud.tpu.v1.AcceleratorType\"C\202\323" + + "\344\223\0026\0224/v1/{name=projects/*/locations/*/a" + + "cceleratorTypes/*}\332A\004name\032F\312A\022tpu.google" + + "apis.com\322A.https://www.googleapis.com/au" + + "th/cloud-platformBb\n\027com.google.cloud.tp" + + "u.v1B\rCloudTpuProtoP\001Z6google.golang.org" + + "/genproto/googleapis/cloud/tpu/v1;tpub\006p" + + "roto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_tpu_v1_SchedulingConfig_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_tpu_v1_SchedulingConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_SchedulingConfig_descriptor, + new java.lang.String[] { "Preemptible", "Reserved", }); + internal_static_google_cloud_tpu_v1_NetworkEndpoint_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_tpu_v1_NetworkEndpoint_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_NetworkEndpoint_descriptor, + new java.lang.String[] { "IpAddress", "Port", }); + internal_static_google_cloud_tpu_v1_Node_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_tpu_v1_Node_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_Node_descriptor, + new java.lang.String[] { "Name", "Description", "AcceleratorType", "IpAddress", "Port", "State", "HealthDescription", "TensorflowVersion", "Network", "CidrBlock", "ServiceAccount", "CreateTime", "SchedulingConfig", "NetworkEndpoints", "Health", "Labels", "UseServiceNetworking", "ApiVersion", "Symptoms", }); + internal_static_google_cloud_tpu_v1_Node_LabelsEntry_descriptor = + internal_static_google_cloud_tpu_v1_Node_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_tpu_v1_Node_LabelsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_Node_LabelsEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_google_cloud_tpu_v1_ListNodesRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_tpu_v1_ListNodesRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_ListNodesRequest_descriptor, + new java.lang.String[] { "Parent", "PageSize", "PageToken", }); + internal_static_google_cloud_tpu_v1_ListNodesResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_tpu_v1_ListNodesResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_ListNodesResponse_descriptor, + new java.lang.String[] { "Nodes", "NextPageToken", "Unreachable", }); + internal_static_google_cloud_tpu_v1_GetNodeRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_tpu_v1_GetNodeRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_GetNodeRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_tpu_v1_CreateNodeRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_tpu_v1_CreateNodeRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_CreateNodeRequest_descriptor, + new java.lang.String[] { "Parent", "NodeId", "Node", }); + internal_static_google_cloud_tpu_v1_DeleteNodeRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_tpu_v1_DeleteNodeRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_DeleteNodeRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_tpu_v1_ReimageNodeRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_tpu_v1_ReimageNodeRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_ReimageNodeRequest_descriptor, + new java.lang.String[] { "Name", "TensorflowVersion", }); + internal_static_google_cloud_tpu_v1_StopNodeRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_tpu_v1_StopNodeRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_StopNodeRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_tpu_v1_StartNodeRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_tpu_v1_StartNodeRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_StartNodeRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_tpu_v1_TensorFlowVersion_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_tpu_v1_TensorFlowVersion_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_TensorFlowVersion_descriptor, + new java.lang.String[] { "Name", "Version", }); + internal_static_google_cloud_tpu_v1_GetTensorFlowVersionRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_tpu_v1_GetTensorFlowVersionRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_GetTensorFlowVersionRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsRequest_descriptor, + new java.lang.String[] { "Parent", "PageSize", "PageToken", "Filter", "OrderBy", }); + internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsResponse_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsResponse_descriptor, + new java.lang.String[] { "TensorflowVersions", "NextPageToken", "Unreachable", }); + internal_static_google_cloud_tpu_v1_AcceleratorType_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_tpu_v1_AcceleratorType_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_AcceleratorType_descriptor, + new java.lang.String[] { "Name", "Type", }); + internal_static_google_cloud_tpu_v1_GetAcceleratorTypeRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_tpu_v1_GetAcceleratorTypeRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_GetAcceleratorTypeRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_tpu_v1_ListAcceleratorTypesRequest_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_tpu_v1_ListAcceleratorTypesRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_ListAcceleratorTypesRequest_descriptor, + new java.lang.String[] { "Parent", "PageSize", "PageToken", "Filter", "OrderBy", }); + internal_static_google_cloud_tpu_v1_ListAcceleratorTypesResponse_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_tpu_v1_ListAcceleratorTypesResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_ListAcceleratorTypesResponse_descriptor, + new java.lang.String[] { "AcceleratorTypes", "NextPageToken", "Unreachable", }); + internal_static_google_cloud_tpu_v1_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_tpu_v1_OperationMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_OperationMetadata_descriptor, + new java.lang.String[] { "CreateTime", "EndTime", "Target", "Verb", "StatusDetail", "CancelRequested", "ApiVersion", }); + internal_static_google_cloud_tpu_v1_Symptom_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_tpu_v1_Symptom_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_tpu_v1_Symptom_descriptor, + new java.lang.String[] { "CreateTime", "SymptomType", "Details", "WorkerId", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CreateNodeRequest.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CreateNodeRequest.java new file mode 100644 index 000000000000..d0ee6c9b6967 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CreateNodeRequest.java @@ -0,0 +1,997 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + *
+ * Request for [CreateNode][google.cloud.tpu.v1.Tpu.CreateNode].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.CreateNodeRequest} + */ +public final class CreateNodeRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.CreateNodeRequest) + CreateNodeRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateNodeRequest.newBuilder() to construct. + private CreateNodeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreateNodeRequest() { + parent_ = ""; + nodeId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new CreateNodeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateNodeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nodeId_ = s; + break; + } + case 26: { + com.google.cloud.tpu.v1.Node.Builder subBuilder = null; + if (node_ != null) { + subBuilder = node_.toBuilder(); + } + node_ = input.readMessage(com.google.cloud.tpu.v1.Node.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(node_); + node_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_CreateNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_CreateNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.CreateNodeRequest.class, com.google.cloud.tpu.v1.CreateNodeRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Required. The parent resource name.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * Required. The parent resource name.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NODE_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object nodeId_; + /** + *
+   * The unqualified resource name.
+   * 
+ * + * string node_id = 2; + * @return The nodeId. + */ + @java.lang.Override + public java.lang.String getNodeId() { + java.lang.Object ref = nodeId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nodeId_ = s; + return s; + } + } + /** + *
+   * The unqualified resource name.
+   * 
+ * + * string node_id = 2; + * @return The bytes for nodeId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNodeIdBytes() { + java.lang.Object ref = nodeId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nodeId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NODE_FIELD_NUMBER = 3; + private com.google.cloud.tpu.v1.Node node_; + /** + *
+   * Required. The node.
+   * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the node field is set. + */ + @java.lang.Override + public boolean hasNode() { + return node_ != null; + } + /** + *
+   * Required. The node.
+   * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The node. + */ + @java.lang.Override + public com.google.cloud.tpu.v1.Node getNode() { + return node_ == null ? com.google.cloud.tpu.v1.Node.getDefaultInstance() : node_; + } + /** + *
+   * Required. The node.
+   * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.tpu.v1.NodeOrBuilder getNodeOrBuilder() { + return getNode(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!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.v1.CreateNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.CreateNodeRequest other = (com.google.cloud.tpu.v1.CreateNodeRequest) obj; + + if (!getParent() + .equals(other.getParent())) return false; + if (!getNodeId() + .equals(other.getNodeId())) return false; + if (hasNode() != other.hasNode()) return false; + if (hasNode()) { + if (!getNode() + .equals(other.getNode())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + NODE_ID_FIELD_NUMBER; + hash = (53 * hash) + getNodeId().hashCode(); + if (hasNode()) { + hash = (37 * hash) + NODE_FIELD_NUMBER; + hash = (53 * hash) + getNode().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.CreateNodeRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.CreateNodeRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.CreateNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.CreateNodeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.CreateNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.CreateNodeRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.CreateNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.CreateNodeRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.CreateNodeRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.CreateNodeRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.CreateNodeRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.CreateNodeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.tpu.v1.CreateNodeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request for [CreateNode][google.cloud.tpu.v1.Tpu.CreateNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.CreateNodeRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.CreateNodeRequest) + com.google.cloud.tpu.v1.CreateNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_CreateNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_CreateNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.CreateNodeRequest.class, com.google.cloud.tpu.v1.CreateNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.CreateNodeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + nodeId_ = ""; + + if (nodeBuilder_ == null) { + node_ = null; + } else { + node_ = null; + nodeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_CreateNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.CreateNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.CreateNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.CreateNodeRequest build() { + com.google.cloud.tpu.v1.CreateNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.CreateNodeRequest buildPartial() { + com.google.cloud.tpu.v1.CreateNodeRequest result = new com.google.cloud.tpu.v1.CreateNodeRequest(this); + result.parent_ = parent_; + result.nodeId_ = nodeId_; + if (nodeBuilder_ == null) { + result.node_ = node_; + } else { + result.node_ = nodeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.CreateNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v1.CreateNodeRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.CreateNodeRequest other) { + if (other == com.google.cloud.tpu.v1.CreateNodeRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getNodeId().isEmpty()) { + nodeId_ = other.nodeId_; + onChanged(); + } + if (other.hasNode()) { + mergeNode(other.getNode()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.CreateNodeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.CreateNodeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Required. The parent resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The parent resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The parent resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The parent resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Required. The parent resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object nodeId_ = ""; + /** + *
+     * The unqualified resource name.
+     * 
+ * + * string node_id = 2; + * @return The nodeId. + */ + public java.lang.String getNodeId() { + java.lang.Object ref = nodeId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nodeId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The unqualified resource name.
+     * 
+ * + * string node_id = 2; + * @return The bytes for nodeId. + */ + public com.google.protobuf.ByteString + getNodeIdBytes() { + java.lang.Object ref = nodeId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nodeId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The unqualified resource name.
+     * 
+ * + * string node_id = 2; + * @param value The nodeId to set. + * @return This builder for chaining. + */ + public Builder setNodeId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nodeId_ = value; + onChanged(); + return this; + } + /** + *
+     * The unqualified resource name.
+     * 
+ * + * string node_id = 2; + * @return This builder for chaining. + */ + public Builder clearNodeId() { + + nodeId_ = getDefaultInstance().getNodeId(); + onChanged(); + return this; + } + /** + *
+     * The unqualified resource name.
+     * 
+ * + * string node_id = 2; + * @param value The bytes for nodeId to set. + * @return This builder for chaining. + */ + public Builder setNodeIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nodeId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.tpu.v1.Node node_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v1.Node, com.google.cloud.tpu.v1.Node.Builder, com.google.cloud.tpu.v1.NodeOrBuilder> nodeBuilder_; + /** + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the node field is set. + */ + public boolean hasNode() { + return nodeBuilder_ != null || node_ != null; + } + /** + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The node. + */ + public com.google.cloud.tpu.v1.Node getNode() { + if (nodeBuilder_ == null) { + return node_ == null ? com.google.cloud.tpu.v1.Node.getDefaultInstance() : node_; + } else { + return nodeBuilder_.getMessage(); + } + } + /** + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setNode(com.google.cloud.tpu.v1.Node value) { + if (nodeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + node_ = value; + onChanged(); + } else { + nodeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setNode( + com.google.cloud.tpu.v1.Node.Builder builderForValue) { + if (nodeBuilder_ == null) { + node_ = builderForValue.build(); + onChanged(); + } else { + nodeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeNode(com.google.cloud.tpu.v1.Node value) { + if (nodeBuilder_ == null) { + if (node_ != null) { + node_ = + com.google.cloud.tpu.v1.Node.newBuilder(node_).mergeFrom(value).buildPartial(); + } else { + node_ = value; + } + onChanged(); + } else { + nodeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearNode() { + if (nodeBuilder_ == null) { + node_ = null; + onChanged(); + } else { + node_ = null; + nodeBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.tpu.v1.Node.Builder getNodeBuilder() { + + onChanged(); + return getNodeFieldBuilder().getBuilder(); + } + /** + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.tpu.v1.NodeOrBuilder getNodeOrBuilder() { + if (nodeBuilder_ != null) { + return nodeBuilder_.getMessageOrBuilder(); + } else { + return node_ == null ? + com.google.cloud.tpu.v1.Node.getDefaultInstance() : node_; + } + } + /** + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v1.Node, com.google.cloud.tpu.v1.Node.Builder, com.google.cloud.tpu.v1.NodeOrBuilder> + getNodeFieldBuilder() { + if (nodeBuilder_ == null) { + nodeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v1.Node, com.google.cloud.tpu.v1.Node.Builder, com.google.cloud.tpu.v1.NodeOrBuilder>( + getNode(), + getParentForChildren(), + isClean()); + node_ = null; + } + return nodeBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.CreateNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.CreateNodeRequest) + private static final com.google.cloud.tpu.v1.CreateNodeRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.CreateNodeRequest(); + } + + public static com.google.cloud.tpu.v1.CreateNodeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateNodeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateNodeRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.CreateNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CreateNodeRequestOrBuilder.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CreateNodeRequestOrBuilder.java new file mode 100644 index 000000000000..caad16ada543 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/CreateNodeRequestOrBuilder.java @@ -0,0 +1,76 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface CreateNodeRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.CreateNodeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The parent resource name.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + java.lang.String getParent(); + /** + *
+   * Required. The parent resource name.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The unqualified resource name.
+   * 
+ * + * string node_id = 2; + * @return The nodeId. + */ + java.lang.String getNodeId(); + /** + *
+   * The unqualified resource name.
+   * 
+ * + * string node_id = 2; + * @return The bytes for nodeId. + */ + com.google.protobuf.ByteString + getNodeIdBytes(); + + /** + *
+   * Required. The node.
+   * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the node field is set. + */ + boolean hasNode(); + /** + *
+   * Required. The node.
+   * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The node. + */ + com.google.cloud.tpu.v1.Node getNode(); + /** + *
+   * Required. The node.
+   * 
+ * + * .google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.tpu.v1.NodeOrBuilder getNodeOrBuilder(); +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/DeleteNodeRequest.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/DeleteNodeRequest.java new file mode 100644 index 000000000000..1e0f4c39db83 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/DeleteNodeRequest.java @@ -0,0 +1,595 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + *
+ * Request for [DeleteNode][google.cloud.tpu.v1.Tpu.DeleteNode].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.DeleteNodeRequest} + */ +public final class DeleteNodeRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.DeleteNodeRequest) + DeleteNodeRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DeleteNodeRequest.newBuilder() to construct. + private DeleteNodeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeleteNodeRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeleteNodeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeleteNodeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_DeleteNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_DeleteNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.DeleteNodeRequest.class, com.google.cloud.tpu.v1.DeleteNodeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required. The resource name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Required. The resource name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!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.v1.DeleteNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.DeleteNodeRequest other = (com.google.cloud.tpu.v1.DeleteNodeRequest) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.DeleteNodeRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.DeleteNodeRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.DeleteNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.DeleteNodeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.DeleteNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.DeleteNodeRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.DeleteNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.DeleteNodeRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.DeleteNodeRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.DeleteNodeRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.DeleteNodeRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.DeleteNodeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.tpu.v1.DeleteNodeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request for [DeleteNode][google.cloud.tpu.v1.Tpu.DeleteNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.DeleteNodeRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.DeleteNodeRequest) + com.google.cloud.tpu.v1.DeleteNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_DeleteNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_DeleteNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.DeleteNodeRequest.class, com.google.cloud.tpu.v1.DeleteNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.DeleteNodeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_DeleteNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.DeleteNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.DeleteNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.DeleteNodeRequest build() { + com.google.cloud.tpu.v1.DeleteNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.DeleteNodeRequest buildPartial() { + com.google.cloud.tpu.v1.DeleteNodeRequest result = new com.google.cloud.tpu.v1.DeleteNodeRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.DeleteNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v1.DeleteNodeRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.DeleteNodeRequest other) { + if (other == com.google.cloud.tpu.v1.DeleteNodeRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.DeleteNodeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.DeleteNodeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required. The resource name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The resource name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The resource name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The resource name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required. The resource name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.DeleteNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.DeleteNodeRequest) + private static final com.google.cloud.tpu.v1.DeleteNodeRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.DeleteNodeRequest(); + } + + public static com.google.cloud.tpu.v1.DeleteNodeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteNodeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteNodeRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.DeleteNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/DeleteNodeRequestOrBuilder.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/DeleteNodeRequestOrBuilder.java new file mode 100644 index 000000000000..4d7d791c980d --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/DeleteNodeRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface DeleteNodeRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.DeleteNodeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The resource name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * Required. The resource name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetAcceleratorTypeRequest.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetAcceleratorTypeRequest.java new file mode 100644 index 000000000000..bffe196689ce --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetAcceleratorTypeRequest.java @@ -0,0 +1,595 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + *
+ * Request for [GetAcceleratorType][google.cloud.tpu.v1.Tpu.GetAcceleratorType].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.GetAcceleratorTypeRequest} + */ +public final class GetAcceleratorTypeRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.GetAcceleratorTypeRequest) + GetAcceleratorTypeRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetAcceleratorTypeRequest.newBuilder() to construct. + private GetAcceleratorTypeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetAcceleratorTypeRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetAcceleratorTypeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetAcceleratorTypeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_GetAcceleratorTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_GetAcceleratorTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest.class, com.google.cloud.tpu.v1.GetAcceleratorTypeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required. The resource name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Required. The resource name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!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.v1.GetAcceleratorTypeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest other = (com.google.cloud.tpu.v1.GetAcceleratorTypeRequest) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.GetAcceleratorTypeRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.GetAcceleratorTypeRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.GetAcceleratorTypeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.GetAcceleratorTypeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.GetAcceleratorTypeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.GetAcceleratorTypeRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.GetAcceleratorTypeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.GetAcceleratorTypeRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.GetAcceleratorTypeRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.GetAcceleratorTypeRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.GetAcceleratorTypeRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.GetAcceleratorTypeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.tpu.v1.GetAcceleratorTypeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request for [GetAcceleratorType][google.cloud.tpu.v1.Tpu.GetAcceleratorType].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.GetAcceleratorTypeRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.GetAcceleratorTypeRequest) + com.google.cloud.tpu.v1.GetAcceleratorTypeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_GetAcceleratorTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_GetAcceleratorTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest.class, com.google.cloud.tpu.v1.GetAcceleratorTypeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.GetAcceleratorTypeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_GetAcceleratorTypeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.GetAcceleratorTypeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.GetAcceleratorTypeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.GetAcceleratorTypeRequest build() { + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.GetAcceleratorTypeRequest buildPartial() { + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest result = new com.google.cloud.tpu.v1.GetAcceleratorTypeRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.GetAcceleratorTypeRequest) { + return mergeFrom((com.google.cloud.tpu.v1.GetAcceleratorTypeRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.GetAcceleratorTypeRequest other) { + if (other == com.google.cloud.tpu.v1.GetAcceleratorTypeRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.GetAcceleratorTypeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.GetAcceleratorTypeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required. The resource name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The resource name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The resource name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The resource name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required. The resource name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.GetAcceleratorTypeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.GetAcceleratorTypeRequest) + private static final com.google.cloud.tpu.v1.GetAcceleratorTypeRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.GetAcceleratorTypeRequest(); + } + + public static com.google.cloud.tpu.v1.GetAcceleratorTypeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetAcceleratorTypeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetAcceleratorTypeRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.GetAcceleratorTypeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetAcceleratorTypeRequestOrBuilder.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetAcceleratorTypeRequestOrBuilder.java new file mode 100644 index 000000000000..38110e7d35ab --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetAcceleratorTypeRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface GetAcceleratorTypeRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.GetAcceleratorTypeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The resource name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * Required. The resource name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetNodeRequest.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetNodeRequest.java new file mode 100644 index 000000000000..612fc8a97f5f --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetNodeRequest.java @@ -0,0 +1,595 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + *
+ * Request for [GetNode][google.cloud.tpu.v1.Tpu.GetNode].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.GetNodeRequest} + */ +public final class GetNodeRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.GetNodeRequest) + GetNodeRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetNodeRequest.newBuilder() to construct. + private GetNodeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetNodeRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetNodeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetNodeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_GetNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_GetNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.GetNodeRequest.class, com.google.cloud.tpu.v1.GetNodeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required. The resource name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Required. The resource name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!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.v1.GetNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.GetNodeRequest other = (com.google.cloud.tpu.v1.GetNodeRequest) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.GetNodeRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.GetNodeRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.GetNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.GetNodeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.GetNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.GetNodeRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.GetNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.GetNodeRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.GetNodeRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.GetNodeRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.GetNodeRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.GetNodeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.tpu.v1.GetNodeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request for [GetNode][google.cloud.tpu.v1.Tpu.GetNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.GetNodeRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.GetNodeRequest) + com.google.cloud.tpu.v1.GetNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_GetNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_GetNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.GetNodeRequest.class, com.google.cloud.tpu.v1.GetNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.GetNodeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_GetNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.GetNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.GetNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.GetNodeRequest build() { + com.google.cloud.tpu.v1.GetNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.GetNodeRequest buildPartial() { + com.google.cloud.tpu.v1.GetNodeRequest result = new com.google.cloud.tpu.v1.GetNodeRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.GetNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v1.GetNodeRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.GetNodeRequest other) { + if (other == com.google.cloud.tpu.v1.GetNodeRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.GetNodeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.GetNodeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required. The resource name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The resource name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The resource name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The resource name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required. The resource name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.GetNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.GetNodeRequest) + private static final com.google.cloud.tpu.v1.GetNodeRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.GetNodeRequest(); + } + + public static com.google.cloud.tpu.v1.GetNodeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetNodeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetNodeRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.GetNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetNodeRequestOrBuilder.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetNodeRequestOrBuilder.java new file mode 100644 index 000000000000..1e1c45faf8c2 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetNodeRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface GetNodeRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.GetNodeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The resource name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * Required. The resource name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetTensorFlowVersionRequest.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetTensorFlowVersionRequest.java new file mode 100644 index 000000000000..4aa307e3d0c3 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetTensorFlowVersionRequest.java @@ -0,0 +1,595 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + *
+ * Request for [GetTensorFlowVersion][google.cloud.tpu.v1.Tpu.GetTensorFlowVersion].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.GetTensorFlowVersionRequest} + */ +public final class GetTensorFlowVersionRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.GetTensorFlowVersionRequest) + GetTensorFlowVersionRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetTensorFlowVersionRequest.newBuilder() to construct. + private GetTensorFlowVersionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetTensorFlowVersionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetTensorFlowVersionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetTensorFlowVersionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_GetTensorFlowVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_GetTensorFlowVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest.class, com.google.cloud.tpu.v1.GetTensorFlowVersionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required. The resource name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Required. The resource name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!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.v1.GetTensorFlowVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest other = (com.google.cloud.tpu.v1.GetTensorFlowVersionRequest) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.GetTensorFlowVersionRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.GetTensorFlowVersionRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.GetTensorFlowVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.GetTensorFlowVersionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.GetTensorFlowVersionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.GetTensorFlowVersionRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.GetTensorFlowVersionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.GetTensorFlowVersionRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.GetTensorFlowVersionRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.GetTensorFlowVersionRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.GetTensorFlowVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.GetTensorFlowVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.tpu.v1.GetTensorFlowVersionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request for [GetTensorFlowVersion][google.cloud.tpu.v1.Tpu.GetTensorFlowVersion].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.GetTensorFlowVersionRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.GetTensorFlowVersionRequest) + com.google.cloud.tpu.v1.GetTensorFlowVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_GetTensorFlowVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_GetTensorFlowVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest.class, com.google.cloud.tpu.v1.GetTensorFlowVersionRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.GetTensorFlowVersionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_GetTensorFlowVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.GetTensorFlowVersionRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.GetTensorFlowVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.GetTensorFlowVersionRequest build() { + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.GetTensorFlowVersionRequest buildPartial() { + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest result = new com.google.cloud.tpu.v1.GetTensorFlowVersionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.GetTensorFlowVersionRequest) { + return mergeFrom((com.google.cloud.tpu.v1.GetTensorFlowVersionRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.GetTensorFlowVersionRequest other) { + if (other == com.google.cloud.tpu.v1.GetTensorFlowVersionRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.GetTensorFlowVersionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.GetTensorFlowVersionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required. The resource name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The resource name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The resource name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The resource name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required. The resource name.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.GetTensorFlowVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.GetTensorFlowVersionRequest) + private static final com.google.cloud.tpu.v1.GetTensorFlowVersionRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.GetTensorFlowVersionRequest(); + } + + public static com.google.cloud.tpu.v1.GetTensorFlowVersionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetTensorFlowVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetTensorFlowVersionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.GetTensorFlowVersionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetTensorFlowVersionRequestOrBuilder.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetTensorFlowVersionRequestOrBuilder.java new file mode 100644 index 000000000000..8be72b5bb0a8 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetTensorFlowVersionRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface GetTensorFlowVersionRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.GetTensorFlowVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The resource name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * Required. The resource name.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesRequest.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesRequest.java new file mode 100644 index 000000000000..07c93e9e70f1 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesRequest.java @@ -0,0 +1,1173 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + *
+ * Request for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListAcceleratorTypesRequest} + */ +public final class ListAcceleratorTypesRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.ListAcceleratorTypesRequest) + ListAcceleratorTypesRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListAcceleratorTypesRequest.newBuilder() to construct. + private ListAcceleratorTypesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListAcceleratorTypesRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListAcceleratorTypesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListAcceleratorTypesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: { + + pageSize_ = input.readInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListAcceleratorTypesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListAcceleratorTypesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest.class, com.google.cloud.tpu.v1.ListAcceleratorTypesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Required. The parent resource name.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * Required. The parent resource name.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + *
+   * The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 5; + private volatile java.lang.Object filter_; + /** + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 6; + private volatile java.lang.Object orderBy_; + /** + *
+   * Sort results.
+   * 
+ * + * string order_by = 6; + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + *
+   * Sort results.
+   * 
+ * + * string order_by = 6; + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!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.v1.ListAcceleratorTypesRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest other = (com.google.cloud.tpu.v1.ListAcceleratorTypesRequest) obj; + + if (!getParent() + .equals(other.getParent())) return false; + if (getPageSize() + != other.getPageSize()) return false; + if (!getPageToken() + .equals(other.getPageToken())) return false; + if (!getFilter() + .equals(other.getFilter())) return false; + if (!getOrderBy() + .equals(other.getOrderBy())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.ListAcceleratorTypesRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.ListAcceleratorTypesRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListAcceleratorTypesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.ListAcceleratorTypesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListAcceleratorTypesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.ListAcceleratorTypesRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListAcceleratorTypesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.ListAcceleratorTypesRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListAcceleratorTypesRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.ListAcceleratorTypesRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListAcceleratorTypesRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.ListAcceleratorTypesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.tpu.v1.ListAcceleratorTypesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListAcceleratorTypesRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.ListAcceleratorTypesRequest) + com.google.cloud.tpu.v1.ListAcceleratorTypesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListAcceleratorTypesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListAcceleratorTypesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest.class, com.google.cloud.tpu.v1.ListAcceleratorTypesRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.ListAcceleratorTypesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListAcceleratorTypesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListAcceleratorTypesRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.ListAcceleratorTypesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListAcceleratorTypesRequest build() { + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListAcceleratorTypesRequest buildPartial() { + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest result = new com.google.cloud.tpu.v1.ListAcceleratorTypesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.ListAcceleratorTypesRequest) { + return mergeFrom((com.google.cloud.tpu.v1.ListAcceleratorTypesRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.ListAcceleratorTypesRequest other) { + if (other == com.google.cloud.tpu.v1.ListAcceleratorTypesRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.ListAcceleratorTypesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.ListAcceleratorTypesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Required. The parent resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The parent resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The parent resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The parent resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Required. The parent resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_ ; + /** + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + *
+     * Sort results.
+     * 
+ * + * string order_by = 6; + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Sort results.
+     * 
+ * + * string order_by = 6; + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString + getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Sort results.
+     * 
+ * + * string order_by = 6; + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + *
+     * Sort results.
+     * 
+ * + * string order_by = 6; + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + *
+     * Sort results.
+     * 
+ * + * string order_by = 6; + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.ListAcceleratorTypesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.ListAcceleratorTypesRequest) + private static final com.google.cloud.tpu.v1.ListAcceleratorTypesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.ListAcceleratorTypesRequest(); + } + + public static com.google.cloud.tpu.v1.ListAcceleratorTypesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAcceleratorTypesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAcceleratorTypesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListAcceleratorTypesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesRequestOrBuilder.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesRequestOrBuilder.java new file mode 100644 index 000000000000..9901af4af3f7 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesRequestOrBuilder.java @@ -0,0 +1,99 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface ListAcceleratorTypesRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.ListAcceleratorTypesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The parent resource name.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + java.lang.String getParent(); + /** + *
+   * Required. The parent resource name.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + int getPageSize(); + + /** + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString + getPageTokenBytes(); + + /** + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * @return The filter. + */ + java.lang.String getFilter(); + /** + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * @return The bytes for filter. + */ + com.google.protobuf.ByteString + getFilterBytes(); + + /** + *
+   * Sort results.
+   * 
+ * + * string order_by = 6; + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + *
+   * Sort results.
+   * 
+ * + * string order_by = 6; + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString + getOrderByBytes(); +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesResponse.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesResponse.java new file mode 100644 index 000000000000..2965ca7dcc62 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesResponse.java @@ -0,0 +1,1282 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + *
+ * Response for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListAcceleratorTypesResponse} + */ +public final class ListAcceleratorTypesResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.ListAcceleratorTypesResponse) + ListAcceleratorTypesResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListAcceleratorTypesResponse.newBuilder() to construct. + private ListAcceleratorTypesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListAcceleratorTypesResponse() { + acceleratorTypes_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListAcceleratorTypesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListAcceleratorTypesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + acceleratorTypes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + acceleratorTypes_.add( + input.readMessage(com.google.cloud.tpu.v1.AcceleratorType.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + unreachable_.add(s); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + acceleratorTypes_ = java.util.Collections.unmodifiableList(acceleratorTypes_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListAcceleratorTypesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListAcceleratorTypesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListAcceleratorTypesResponse.class, com.google.cloud.tpu.v1.ListAcceleratorTypesResponse.Builder.class); + } + + public static final int ACCELERATOR_TYPES_FIELD_NUMBER = 1; + private java.util.List acceleratorTypes_; + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + @java.lang.Override + public java.util.List getAcceleratorTypesList() { + return acceleratorTypes_; + } + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + @java.lang.Override + public java.util.List + getAcceleratorTypesOrBuilderList() { + return acceleratorTypes_; + } + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + @java.lang.Override + public int getAcceleratorTypesCount() { + return acceleratorTypes_.size(); + } + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v1.AcceleratorType getAcceleratorTypes(int index) { + return acceleratorTypes_.get(index); + } + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v1.AcceleratorTypeOrBuilder getAcceleratorTypesOrBuilder( + int index) { + return acceleratorTypes_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList unreachable_; + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList + getUnreachableList() { + return unreachable_; + } + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString + getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < acceleratorTypes_.size(); i++) { + output.writeMessage(1, acceleratorTypes_.get(i)); + } + if (!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.v1.ListAcceleratorTypesResponse)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.ListAcceleratorTypesResponse other = (com.google.cloud.tpu.v1.ListAcceleratorTypesResponse) obj; + + if (!getAcceleratorTypesList() + .equals(other.getAcceleratorTypesList())) return false; + if (!getNextPageToken() + .equals(other.getNextPageToken())) return false; + if (!getUnreachableList() + .equals(other.getUnreachableList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAcceleratorTypesCount() > 0) { + hash = (37 * hash) + ACCELERATOR_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getAcceleratorTypesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.ListAcceleratorTypesResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.ListAcceleratorTypesResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListAcceleratorTypesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.ListAcceleratorTypesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListAcceleratorTypesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.ListAcceleratorTypesResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListAcceleratorTypesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.ListAcceleratorTypesResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListAcceleratorTypesResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.ListAcceleratorTypesResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListAcceleratorTypesResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.ListAcceleratorTypesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.tpu.v1.ListAcceleratorTypesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Response for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListAcceleratorTypesResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.ListAcceleratorTypesResponse) + com.google.cloud.tpu.v1.ListAcceleratorTypesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListAcceleratorTypesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListAcceleratorTypesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListAcceleratorTypesResponse.class, com.google.cloud.tpu.v1.ListAcceleratorTypesResponse.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.ListAcceleratorTypesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getAcceleratorTypesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (acceleratorTypesBuilder_ == null) { + acceleratorTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + acceleratorTypesBuilder_.clear(); + } + nextPageToken_ = ""; + + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListAcceleratorTypesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListAcceleratorTypesResponse getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.ListAcceleratorTypesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListAcceleratorTypesResponse build() { + com.google.cloud.tpu.v1.ListAcceleratorTypesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListAcceleratorTypesResponse buildPartial() { + com.google.cloud.tpu.v1.ListAcceleratorTypesResponse result = new com.google.cloud.tpu.v1.ListAcceleratorTypesResponse(this); + int from_bitField0_ = bitField0_; + if (acceleratorTypesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + acceleratorTypes_ = java.util.Collections.unmodifiableList(acceleratorTypes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.acceleratorTypes_ = acceleratorTypes_; + } else { + result.acceleratorTypes_ = acceleratorTypesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + if (((bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.unreachable_ = unreachable_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.ListAcceleratorTypesResponse) { + return mergeFrom((com.google.cloud.tpu.v1.ListAcceleratorTypesResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.ListAcceleratorTypesResponse other) { + if (other == com.google.cloud.tpu.v1.ListAcceleratorTypesResponse.getDefaultInstance()) return this; + if (acceleratorTypesBuilder_ == null) { + if (!other.acceleratorTypes_.isEmpty()) { + if (acceleratorTypes_.isEmpty()) { + acceleratorTypes_ = other.acceleratorTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAcceleratorTypesIsMutable(); + acceleratorTypes_.addAll(other.acceleratorTypes_); + } + onChanged(); + } + } else { + if (!other.acceleratorTypes_.isEmpty()) { + if (acceleratorTypesBuilder_.isEmpty()) { + acceleratorTypesBuilder_.dispose(); + acceleratorTypesBuilder_ = null; + acceleratorTypes_ = other.acceleratorTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + acceleratorTypesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getAcceleratorTypesFieldBuilder() : null; + } else { + acceleratorTypesBuilder_.addAllMessages(other.acceleratorTypes_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.ListAcceleratorTypesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.ListAcceleratorTypesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List acceleratorTypes_ = + java.util.Collections.emptyList(); + private void ensureAcceleratorTypesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + acceleratorTypes_ = new java.util.ArrayList(acceleratorTypes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.AcceleratorType, com.google.cloud.tpu.v1.AcceleratorType.Builder, com.google.cloud.tpu.v1.AcceleratorTypeOrBuilder> acceleratorTypesBuilder_; + + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public java.util.List getAcceleratorTypesList() { + if (acceleratorTypesBuilder_ == null) { + return java.util.Collections.unmodifiableList(acceleratorTypes_); + } else { + return acceleratorTypesBuilder_.getMessageList(); + } + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public int getAcceleratorTypesCount() { + if (acceleratorTypesBuilder_ == null) { + return acceleratorTypes_.size(); + } else { + return acceleratorTypesBuilder_.getCount(); + } + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public com.google.cloud.tpu.v1.AcceleratorType getAcceleratorTypes(int index) { + if (acceleratorTypesBuilder_ == null) { + return acceleratorTypes_.get(index); + } else { + return acceleratorTypesBuilder_.getMessage(index); + } + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public Builder setAcceleratorTypes( + int index, com.google.cloud.tpu.v1.AcceleratorType value) { + if (acceleratorTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAcceleratorTypesIsMutable(); + acceleratorTypes_.set(index, value); + onChanged(); + } else { + acceleratorTypesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public Builder setAcceleratorTypes( + int index, com.google.cloud.tpu.v1.AcceleratorType.Builder builderForValue) { + if (acceleratorTypesBuilder_ == null) { + ensureAcceleratorTypesIsMutable(); + acceleratorTypes_.set(index, builderForValue.build()); + onChanged(); + } else { + acceleratorTypesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public Builder addAcceleratorTypes(com.google.cloud.tpu.v1.AcceleratorType value) { + if (acceleratorTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAcceleratorTypesIsMutable(); + acceleratorTypes_.add(value); + onChanged(); + } else { + acceleratorTypesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public Builder addAcceleratorTypes( + int index, com.google.cloud.tpu.v1.AcceleratorType value) { + if (acceleratorTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAcceleratorTypesIsMutable(); + acceleratorTypes_.add(index, value); + onChanged(); + } else { + acceleratorTypesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public Builder addAcceleratorTypes( + com.google.cloud.tpu.v1.AcceleratorType.Builder builderForValue) { + if (acceleratorTypesBuilder_ == null) { + ensureAcceleratorTypesIsMutable(); + acceleratorTypes_.add(builderForValue.build()); + onChanged(); + } else { + acceleratorTypesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public Builder addAcceleratorTypes( + int index, com.google.cloud.tpu.v1.AcceleratorType.Builder builderForValue) { + if (acceleratorTypesBuilder_ == null) { + ensureAcceleratorTypesIsMutable(); + acceleratorTypes_.add(index, builderForValue.build()); + onChanged(); + } else { + acceleratorTypesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public Builder addAllAcceleratorTypes( + java.lang.Iterable values) { + if (acceleratorTypesBuilder_ == null) { + ensureAcceleratorTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, acceleratorTypes_); + onChanged(); + } else { + acceleratorTypesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public Builder clearAcceleratorTypes() { + if (acceleratorTypesBuilder_ == null) { + acceleratorTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + acceleratorTypesBuilder_.clear(); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public Builder removeAcceleratorTypes(int index) { + if (acceleratorTypesBuilder_ == null) { + ensureAcceleratorTypesIsMutable(); + acceleratorTypes_.remove(index); + onChanged(); + } else { + acceleratorTypesBuilder_.remove(index); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public com.google.cloud.tpu.v1.AcceleratorType.Builder getAcceleratorTypesBuilder( + int index) { + return getAcceleratorTypesFieldBuilder().getBuilder(index); + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public com.google.cloud.tpu.v1.AcceleratorTypeOrBuilder getAcceleratorTypesOrBuilder( + int index) { + if (acceleratorTypesBuilder_ == null) { + return acceleratorTypes_.get(index); } else { + return acceleratorTypesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public java.util.List + getAcceleratorTypesOrBuilderList() { + if (acceleratorTypesBuilder_ != null) { + return acceleratorTypesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(acceleratorTypes_); + } + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public com.google.cloud.tpu.v1.AcceleratorType.Builder addAcceleratorTypesBuilder() { + return getAcceleratorTypesFieldBuilder().addBuilder( + com.google.cloud.tpu.v1.AcceleratorType.getDefaultInstance()); + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public com.google.cloud.tpu.v1.AcceleratorType.Builder addAcceleratorTypesBuilder( + int index) { + return getAcceleratorTypesFieldBuilder().addBuilder( + index, com.google.cloud.tpu.v1.AcceleratorType.getDefaultInstance()); + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + public java.util.List + getAcceleratorTypesBuilderList() { + return getAcceleratorTypesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.AcceleratorType, com.google.cloud.tpu.v1.AcceleratorType.Builder, com.google.cloud.tpu.v1.AcceleratorTypeOrBuilder> + getAcceleratorTypesFieldBuilder() { + if (acceleratorTypesBuilder_ == null) { + acceleratorTypesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.AcceleratorType, com.google.cloud.tpu.v1.AcceleratorType.Builder, com.google.cloud.tpu.v1.AcceleratorTypeOrBuilder>( + acceleratorTypes_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + acceleratorTypes_ = null; + } + return acceleratorTypesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000002; + } + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList + getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString + getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable( + java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, unreachable_); + onChanged(); + return this; + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.ListAcceleratorTypesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.ListAcceleratorTypesResponse) + private static final com.google.cloud.tpu.v1.ListAcceleratorTypesResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.ListAcceleratorTypesResponse(); + } + + public static com.google.cloud.tpu.v1.ListAcceleratorTypesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAcceleratorTypesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAcceleratorTypesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListAcceleratorTypesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesResponseOrBuilder.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesResponseOrBuilder.java new file mode 100644 index 000000000000..ee4a968d747b --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesResponseOrBuilder.java @@ -0,0 +1,114 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface ListAcceleratorTypesResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.ListAcceleratorTypesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + java.util.List + getAcceleratorTypesList(); + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + com.google.cloud.tpu.v1.AcceleratorType getAcceleratorTypes(int index); + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + int getAcceleratorTypesCount(); + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + java.util.List + getAcceleratorTypesOrBuilderList(); + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.AcceleratorType accelerator_types = 1; + */ + com.google.cloud.tpu.v1.AcceleratorTypeOrBuilder getAcceleratorTypesOrBuilder( + int index); + + /** + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); + + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @return A list containing the unreachable. + */ + java.util.List + getUnreachableList(); + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString + getUnreachableBytes(int index); +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesRequest.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesRequest.java new file mode 100644 index 000000000000..6e5f22511335 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesRequest.java @@ -0,0 +1,841 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + *
+ * Request for [ListNodes][google.cloud.tpu.v1.Tpu.ListNodes].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListNodesRequest} + */ +public final class ListNodesRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.ListNodesRequest) + ListNodesRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListNodesRequest.newBuilder() to construct. + private ListNodesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListNodesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListNodesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListNodesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: { + + pageSize_ = input.readInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListNodesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListNodesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListNodesRequest.class, com.google.cloud.tpu.v1.ListNodesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Required. The parent resource name.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * Required. The parent resource name.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + *
+   * The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!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.v1.ListNodesRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.ListNodesRequest other = (com.google.cloud.tpu.v1.ListNodesRequest) obj; + + if (!getParent() + .equals(other.getParent())) return false; + if (getPageSize() + != other.getPageSize()) return false; + if (!getPageToken() + .equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.ListNodesRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.ListNodesRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListNodesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.ListNodesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListNodesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.ListNodesRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListNodesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.ListNodesRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListNodesRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.ListNodesRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListNodesRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.ListNodesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.tpu.v1.ListNodesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request for [ListNodes][google.cloud.tpu.v1.Tpu.ListNodes].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListNodesRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.ListNodesRequest) + com.google.cloud.tpu.v1.ListNodesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListNodesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListNodesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListNodesRequest.class, com.google.cloud.tpu.v1.ListNodesRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.ListNodesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListNodesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListNodesRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.ListNodesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListNodesRequest build() { + com.google.cloud.tpu.v1.ListNodesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListNodesRequest buildPartial() { + com.google.cloud.tpu.v1.ListNodesRequest result = new com.google.cloud.tpu.v1.ListNodesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.ListNodesRequest) { + return mergeFrom((com.google.cloud.tpu.v1.ListNodesRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.ListNodesRequest other) { + if (other == com.google.cloud.tpu.v1.ListNodesRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.ListNodesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.ListNodesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Required. The parent resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The parent resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The parent resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The parent resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Required. The parent resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_ ; + /** + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.ListNodesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.ListNodesRequest) + private static final com.google.cloud.tpu.v1.ListNodesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.ListNodesRequest(); + } + + public static com.google.cloud.tpu.v1.ListNodesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListNodesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListNodesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListNodesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesRequestOrBuilder.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesRequestOrBuilder.java new file mode 100644 index 000000000000..78168640de9e --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesRequestOrBuilder.java @@ -0,0 +1,59 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface ListNodesRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.ListNodesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The parent resource name.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + java.lang.String getParent(); + /** + *
+   * Required. The parent resource name.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + int getPageSize(); + + /** + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesResponse.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesResponse.java new file mode 100644 index 000000000000..65680157ce17 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesResponse.java @@ -0,0 +1,1282 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + *
+ * Response for [ListNodes][google.cloud.tpu.v1.Tpu.ListNodes].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListNodesResponse} + */ +public final class ListNodesResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.ListNodesResponse) + ListNodesResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListNodesResponse.newBuilder() to construct. + private ListNodesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListNodesResponse() { + nodes_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListNodesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListNodesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + nodes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + nodes_.add( + input.readMessage(com.google.cloud.tpu.v1.Node.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + unreachable_.add(s); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + nodes_ = java.util.Collections.unmodifiableList(nodes_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListNodesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListNodesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListNodesResponse.class, com.google.cloud.tpu.v1.ListNodesResponse.Builder.class); + } + + public static final int NODES_FIELD_NUMBER = 1; + private java.util.List nodes_; + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + @java.lang.Override + public java.util.List getNodesList() { + return nodes_; + } + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + @java.lang.Override + public java.util.List + getNodesOrBuilderList() { + return nodes_; + } + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + @java.lang.Override + public int getNodesCount() { + return nodes_.size(); + } + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v1.Node getNodes(int index) { + return nodes_.get(index); + } + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v1.NodeOrBuilder getNodesOrBuilder( + int index) { + return nodes_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList unreachable_; + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList + getUnreachableList() { + return unreachable_; + } + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString + getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < nodes_.size(); i++) { + output.writeMessage(1, nodes_.get(i)); + } + if (!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.v1.ListNodesResponse)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.ListNodesResponse other = (com.google.cloud.tpu.v1.ListNodesResponse) obj; + + if (!getNodesList() + .equals(other.getNodesList())) return false; + if (!getNextPageToken() + .equals(other.getNextPageToken())) return false; + if (!getUnreachableList() + .equals(other.getUnreachableList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getNodesCount() > 0) { + hash = (37 * hash) + NODES_FIELD_NUMBER; + hash = (53 * hash) + getNodesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.ListNodesResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.ListNodesResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListNodesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.ListNodesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListNodesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.ListNodesResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListNodesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.ListNodesResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListNodesResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.ListNodesResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListNodesResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.ListNodesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.tpu.v1.ListNodesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Response for [ListNodes][google.cloud.tpu.v1.Tpu.ListNodes].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListNodesResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.ListNodesResponse) + com.google.cloud.tpu.v1.ListNodesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListNodesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListNodesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListNodesResponse.class, com.google.cloud.tpu.v1.ListNodesResponse.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.ListNodesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getNodesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + nodesBuilder_.clear(); + } + nextPageToken_ = ""; + + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListNodesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListNodesResponse getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.ListNodesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListNodesResponse build() { + com.google.cloud.tpu.v1.ListNodesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListNodesResponse buildPartial() { + com.google.cloud.tpu.v1.ListNodesResponse result = new com.google.cloud.tpu.v1.ListNodesResponse(this); + int from_bitField0_ = bitField0_; + if (nodesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + nodes_ = java.util.Collections.unmodifiableList(nodes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.nodes_ = nodes_; + } else { + result.nodes_ = nodesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + if (((bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.unreachable_ = unreachable_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.ListNodesResponse) { + return mergeFrom((com.google.cloud.tpu.v1.ListNodesResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.ListNodesResponse other) { + if (other == com.google.cloud.tpu.v1.ListNodesResponse.getDefaultInstance()) return this; + if (nodesBuilder_ == null) { + if (!other.nodes_.isEmpty()) { + if (nodes_.isEmpty()) { + nodes_ = other.nodes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNodesIsMutable(); + nodes_.addAll(other.nodes_); + } + onChanged(); + } + } else { + if (!other.nodes_.isEmpty()) { + if (nodesBuilder_.isEmpty()) { + nodesBuilder_.dispose(); + nodesBuilder_ = null; + nodes_ = other.nodes_; + bitField0_ = (bitField0_ & ~0x00000001); + nodesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getNodesFieldBuilder() : null; + } else { + nodesBuilder_.addAllMessages(other.nodes_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.ListNodesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.ListNodesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List nodes_ = + java.util.Collections.emptyList(); + private void ensureNodesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + nodes_ = new java.util.ArrayList(nodes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.Node, com.google.cloud.tpu.v1.Node.Builder, com.google.cloud.tpu.v1.NodeOrBuilder> nodesBuilder_; + + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public java.util.List getNodesList() { + if (nodesBuilder_ == null) { + return java.util.Collections.unmodifiableList(nodes_); + } else { + return nodesBuilder_.getMessageList(); + } + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public int getNodesCount() { + if (nodesBuilder_ == null) { + return nodes_.size(); + } else { + return nodesBuilder_.getCount(); + } + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public com.google.cloud.tpu.v1.Node getNodes(int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessage(index); + } + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public Builder setNodes( + int index, com.google.cloud.tpu.v1.Node value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.set(index, value); + onChanged(); + } else { + nodesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public Builder setNodes( + int index, com.google.cloud.tpu.v1.Node.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.set(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public Builder addNodes(com.google.cloud.tpu.v1.Node value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(value); + onChanged(); + } else { + nodesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public Builder addNodes( + int index, com.google.cloud.tpu.v1.Node value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(index, value); + onChanged(); + } else { + nodesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public Builder addNodes( + com.google.cloud.tpu.v1.Node.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public Builder addNodes( + int index, com.google.cloud.tpu.v1.Node.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public Builder addAllNodes( + java.lang.Iterable values) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, nodes_); + onChanged(); + } else { + nodesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public Builder clearNodes() { + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + nodesBuilder_.clear(); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public Builder removeNodes(int index) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.remove(index); + onChanged(); + } else { + nodesBuilder_.remove(index); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public com.google.cloud.tpu.v1.Node.Builder getNodesBuilder( + int index) { + return getNodesFieldBuilder().getBuilder(index); + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public com.google.cloud.tpu.v1.NodeOrBuilder getNodesOrBuilder( + int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); } else { + return nodesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public java.util.List + getNodesOrBuilderList() { + if (nodesBuilder_ != null) { + return nodesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nodes_); + } + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public com.google.cloud.tpu.v1.Node.Builder addNodesBuilder() { + return getNodesFieldBuilder().addBuilder( + com.google.cloud.tpu.v1.Node.getDefaultInstance()); + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public com.google.cloud.tpu.v1.Node.Builder addNodesBuilder( + int index) { + return getNodesFieldBuilder().addBuilder( + index, com.google.cloud.tpu.v1.Node.getDefaultInstance()); + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + public java.util.List + getNodesBuilderList() { + return getNodesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.Node, com.google.cloud.tpu.v1.Node.Builder, com.google.cloud.tpu.v1.NodeOrBuilder> + getNodesFieldBuilder() { + if (nodesBuilder_ == null) { + nodesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.Node, com.google.cloud.tpu.v1.Node.Builder, com.google.cloud.tpu.v1.NodeOrBuilder>( + nodes_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + nodes_ = null; + } + return nodesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000002; + } + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList + getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString + getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable( + java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, unreachable_); + onChanged(); + return this; + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.ListNodesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.ListNodesResponse) + private static final com.google.cloud.tpu.v1.ListNodesResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.ListNodesResponse(); + } + + public static com.google.cloud.tpu.v1.ListNodesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListNodesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListNodesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListNodesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesResponseOrBuilder.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesResponseOrBuilder.java new file mode 100644 index 000000000000..95c9ef55efc5 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListNodesResponseOrBuilder.java @@ -0,0 +1,114 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface ListNodesResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.ListNodesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + java.util.List + getNodesList(); + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + com.google.cloud.tpu.v1.Node getNodes(int index); + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + int getNodesCount(); + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + java.util.List + getNodesOrBuilderList(); + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Node nodes = 1; + */ + com.google.cloud.tpu.v1.NodeOrBuilder getNodesOrBuilder( + int index); + + /** + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); + + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @return A list containing the unreachable. + */ + java.util.List + getUnreachableList(); + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString + getUnreachableBytes(int index); +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsRequest.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsRequest.java new file mode 100644 index 000000000000..cbf85e7103fe --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsRequest.java @@ -0,0 +1,1173 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + *
+ * Request for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListTensorFlowVersionsRequest} + */ +public final class ListTensorFlowVersionsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.ListTensorFlowVersionsRequest) + ListTensorFlowVersionsRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListTensorFlowVersionsRequest.newBuilder() to construct. + private ListTensorFlowVersionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListTensorFlowVersionsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListTensorFlowVersionsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListTensorFlowVersionsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: { + + pageSize_ = input.readInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest.class, com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Required. The parent resource name.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * Required. The parent resource name.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + *
+   * The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 5; + private volatile java.lang.Object filter_; + /** + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 6; + private volatile java.lang.Object orderBy_; + /** + *
+   * Sort results.
+   * 
+ * + * string order_by = 6; + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + *
+   * Sort results.
+   * 
+ * + * string order_by = 6; + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!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.v1.ListTensorFlowVersionsRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest other = (com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest) obj; + + if (!getParent() + .equals(other.getParent())) return false; + if (getPageSize() + != other.getPageSize()) return false; + if (!getPageToken() + .equals(other.getPageToken())) return false; + if (!getFilter() + .equals(other.getFilter())) return false; + if (!getOrderBy() + .equals(other.getOrderBy())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListTensorFlowVersionsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.ListTensorFlowVersionsRequest) + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest.class, com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest build() { + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest buildPartial() { + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest result = new com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest) { + return mergeFrom((com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest other) { + if (other == com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Required. The parent resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The parent resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The parent resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The parent resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Required. The parent resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_ ; + /** + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + *
+     * Sort results.
+     * 
+ * + * string order_by = 6; + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Sort results.
+     * 
+ * + * string order_by = 6; + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString + getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Sort results.
+     * 
+ * + * string order_by = 6; + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + *
+     * Sort results.
+     * 
+ * + * string order_by = 6; + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + *
+     * Sort results.
+     * 
+ * + * string order_by = 6; + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.ListTensorFlowVersionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.ListTensorFlowVersionsRequest) + private static final com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest(); + } + + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTensorFlowVersionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListTensorFlowVersionsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsRequestOrBuilder.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsRequestOrBuilder.java new file mode 100644 index 000000000000..b69e0e0286a2 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsRequestOrBuilder.java @@ -0,0 +1,99 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface ListTensorFlowVersionsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.ListTensorFlowVersionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The parent resource name.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + java.lang.String getParent(); + /** + *
+   * Required. The parent resource name.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + int getPageSize(); + + /** + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString + getPageTokenBytes(); + + /** + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * @return The filter. + */ + java.lang.String getFilter(); + /** + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * @return The bytes for filter. + */ + com.google.protobuf.ByteString + getFilterBytes(); + + /** + *
+   * Sort results.
+   * 
+ * + * string order_by = 6; + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + *
+   * Sort results.
+   * 
+ * + * string order_by = 6; + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString + getOrderByBytes(); +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsResponse.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsResponse.java new file mode 100644 index 000000000000..ad15c4792f37 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsResponse.java @@ -0,0 +1,1282 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + *
+ * Response for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListTensorFlowVersionsResponse} + */ +public final class ListTensorFlowVersionsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.ListTensorFlowVersionsResponse) + ListTensorFlowVersionsResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListTensorFlowVersionsResponse.newBuilder() to construct. + private ListTensorFlowVersionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListTensorFlowVersionsResponse() { + tensorflowVersions_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListTensorFlowVersionsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListTensorFlowVersionsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + tensorflowVersions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + tensorflowVersions_.add( + input.readMessage(com.google.cloud.tpu.v1.TensorFlowVersion.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + unreachable_.add(s); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + tensorflowVersions_ = java.util.Collections.unmodifiableList(tensorflowVersions_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse.class, com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse.Builder.class); + } + + public static final int TENSORFLOW_VERSIONS_FIELD_NUMBER = 1; + private java.util.List tensorflowVersions_; + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + @java.lang.Override + public java.util.List getTensorflowVersionsList() { + return tensorflowVersions_; + } + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + @java.lang.Override + public java.util.List + getTensorflowVersionsOrBuilderList() { + return tensorflowVersions_; + } + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + @java.lang.Override + public int getTensorflowVersionsCount() { + return tensorflowVersions_.size(); + } + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v1.TensorFlowVersion getTensorflowVersions(int index) { + return tensorflowVersions_.get(index); + } + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v1.TensorFlowVersionOrBuilder getTensorflowVersionsOrBuilder( + int index) { + return tensorflowVersions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList unreachable_; + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList + getUnreachableList() { + return unreachable_; + } + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString + getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < tensorflowVersions_.size(); i++) { + output.writeMessage(1, tensorflowVersions_.get(i)); + } + if (!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 < tensorflowVersions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, tensorflowVersions_.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.v1.ListTensorFlowVersionsResponse)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse other = (com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse) obj; + + if (!getTensorflowVersionsList() + .equals(other.getTensorflowVersionsList())) return false; + if (!getNextPageToken() + .equals(other.getNextPageToken())) return false; + if (!getUnreachableList() + .equals(other.getUnreachableList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getTensorflowVersionsCount() > 0) { + hash = (37 * hash) + TENSORFLOW_VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getTensorflowVersionsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Response for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ListTensorFlowVersionsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.ListTensorFlowVersionsResponse) + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse.class, com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getTensorflowVersionsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (tensorflowVersionsBuilder_ == null) { + tensorflowVersions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + tensorflowVersionsBuilder_.clear(); + } + nextPageToken_ = ""; + + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ListTensorFlowVersionsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse build() { + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse buildPartial() { + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse result = new com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse(this); + int from_bitField0_ = bitField0_; + if (tensorflowVersionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + tensorflowVersions_ = java.util.Collections.unmodifiableList(tensorflowVersions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.tensorflowVersions_ = tensorflowVersions_; + } else { + result.tensorflowVersions_ = tensorflowVersionsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + if (((bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.unreachable_ = unreachable_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse) { + return mergeFrom((com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse other) { + if (other == com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse.getDefaultInstance()) return this; + if (tensorflowVersionsBuilder_ == null) { + if (!other.tensorflowVersions_.isEmpty()) { + if (tensorflowVersions_.isEmpty()) { + tensorflowVersions_ = other.tensorflowVersions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTensorflowVersionsIsMutable(); + tensorflowVersions_.addAll(other.tensorflowVersions_); + } + onChanged(); + } + } else { + if (!other.tensorflowVersions_.isEmpty()) { + if (tensorflowVersionsBuilder_.isEmpty()) { + tensorflowVersionsBuilder_.dispose(); + tensorflowVersionsBuilder_ = null; + tensorflowVersions_ = other.tensorflowVersions_; + bitField0_ = (bitField0_ & ~0x00000001); + tensorflowVersionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getTensorflowVersionsFieldBuilder() : null; + } else { + tensorflowVersionsBuilder_.addAllMessages(other.tensorflowVersions_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List tensorflowVersions_ = + java.util.Collections.emptyList(); + private void ensureTensorflowVersionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + tensorflowVersions_ = new java.util.ArrayList(tensorflowVersions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.TensorFlowVersion, com.google.cloud.tpu.v1.TensorFlowVersion.Builder, com.google.cloud.tpu.v1.TensorFlowVersionOrBuilder> tensorflowVersionsBuilder_; + + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public java.util.List getTensorflowVersionsList() { + if (tensorflowVersionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(tensorflowVersions_); + } else { + return tensorflowVersionsBuilder_.getMessageList(); + } + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public int getTensorflowVersionsCount() { + if (tensorflowVersionsBuilder_ == null) { + return tensorflowVersions_.size(); + } else { + return tensorflowVersionsBuilder_.getCount(); + } + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public com.google.cloud.tpu.v1.TensorFlowVersion getTensorflowVersions(int index) { + if (tensorflowVersionsBuilder_ == null) { + return tensorflowVersions_.get(index); + } else { + return tensorflowVersionsBuilder_.getMessage(index); + } + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public Builder setTensorflowVersions( + int index, com.google.cloud.tpu.v1.TensorFlowVersion value) { + if (tensorflowVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorflowVersionsIsMutable(); + tensorflowVersions_.set(index, value); + onChanged(); + } else { + tensorflowVersionsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public Builder setTensorflowVersions( + int index, com.google.cloud.tpu.v1.TensorFlowVersion.Builder builderForValue) { + if (tensorflowVersionsBuilder_ == null) { + ensureTensorflowVersionsIsMutable(); + tensorflowVersions_.set(index, builderForValue.build()); + onChanged(); + } else { + tensorflowVersionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public Builder addTensorflowVersions(com.google.cloud.tpu.v1.TensorFlowVersion value) { + if (tensorflowVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorflowVersionsIsMutable(); + tensorflowVersions_.add(value); + onChanged(); + } else { + tensorflowVersionsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public Builder addTensorflowVersions( + int index, com.google.cloud.tpu.v1.TensorFlowVersion value) { + if (tensorflowVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorflowVersionsIsMutable(); + tensorflowVersions_.add(index, value); + onChanged(); + } else { + tensorflowVersionsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public Builder addTensorflowVersions( + com.google.cloud.tpu.v1.TensorFlowVersion.Builder builderForValue) { + if (tensorflowVersionsBuilder_ == null) { + ensureTensorflowVersionsIsMutable(); + tensorflowVersions_.add(builderForValue.build()); + onChanged(); + } else { + tensorflowVersionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public Builder addTensorflowVersions( + int index, com.google.cloud.tpu.v1.TensorFlowVersion.Builder builderForValue) { + if (tensorflowVersionsBuilder_ == null) { + ensureTensorflowVersionsIsMutable(); + tensorflowVersions_.add(index, builderForValue.build()); + onChanged(); + } else { + tensorflowVersionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public Builder addAllTensorflowVersions( + java.lang.Iterable values) { + if (tensorflowVersionsBuilder_ == null) { + ensureTensorflowVersionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, tensorflowVersions_); + onChanged(); + } else { + tensorflowVersionsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public Builder clearTensorflowVersions() { + if (tensorflowVersionsBuilder_ == null) { + tensorflowVersions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + tensorflowVersionsBuilder_.clear(); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public Builder removeTensorflowVersions(int index) { + if (tensorflowVersionsBuilder_ == null) { + ensureTensorflowVersionsIsMutable(); + tensorflowVersions_.remove(index); + onChanged(); + } else { + tensorflowVersionsBuilder_.remove(index); + } + return this; + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public com.google.cloud.tpu.v1.TensorFlowVersion.Builder getTensorflowVersionsBuilder( + int index) { + return getTensorflowVersionsFieldBuilder().getBuilder(index); + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public com.google.cloud.tpu.v1.TensorFlowVersionOrBuilder getTensorflowVersionsOrBuilder( + int index) { + if (tensorflowVersionsBuilder_ == null) { + return tensorflowVersions_.get(index); } else { + return tensorflowVersionsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public java.util.List + getTensorflowVersionsOrBuilderList() { + if (tensorflowVersionsBuilder_ != null) { + return tensorflowVersionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tensorflowVersions_); + } + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public com.google.cloud.tpu.v1.TensorFlowVersion.Builder addTensorflowVersionsBuilder() { + return getTensorflowVersionsFieldBuilder().addBuilder( + com.google.cloud.tpu.v1.TensorFlowVersion.getDefaultInstance()); + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public com.google.cloud.tpu.v1.TensorFlowVersion.Builder addTensorflowVersionsBuilder( + int index) { + return getTensorflowVersionsFieldBuilder().addBuilder( + index, com.google.cloud.tpu.v1.TensorFlowVersion.getDefaultInstance()); + } + /** + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + public java.util.List + getTensorflowVersionsBuilderList() { + return getTensorflowVersionsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.TensorFlowVersion, com.google.cloud.tpu.v1.TensorFlowVersion.Builder, com.google.cloud.tpu.v1.TensorFlowVersionOrBuilder> + getTensorflowVersionsFieldBuilder() { + if (tensorflowVersionsBuilder_ == null) { + tensorflowVersionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.TensorFlowVersion, com.google.cloud.tpu.v1.TensorFlowVersion.Builder, com.google.cloud.tpu.v1.TensorFlowVersionOrBuilder>( + tensorflowVersions_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + tensorflowVersions_ = null; + } + return tensorflowVersionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * The next page token or empty if none.
+     * 
+ * + * string next_page_token = 2; + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000002; + } + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList + getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString + getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable( + java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, unreachable_); + onChanged(); + return this; + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.ListTensorFlowVersionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.ListTensorFlowVersionsResponse) + private static final com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse(); + } + + public static com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTensorFlowVersionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListTensorFlowVersionsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsResponseOrBuilder.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsResponseOrBuilder.java new file mode 100644 index 000000000000..1d97d8a83f45 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsResponseOrBuilder.java @@ -0,0 +1,114 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface ListTensorFlowVersionsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.ListTensorFlowVersionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + java.util.List + getTensorflowVersionsList(); + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + com.google.cloud.tpu.v1.TensorFlowVersion getTensorflowVersions(int index); + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + int getTensorflowVersionsCount(); + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + java.util.List + getTensorflowVersionsOrBuilderList(); + /** + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v1.TensorFlowVersion tensorflow_versions = 1; + */ + com.google.cloud.tpu.v1.TensorFlowVersionOrBuilder getTensorflowVersionsOrBuilder( + int index); + + /** + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + *
+   * The next page token or empty if none.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); + + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @return A list containing the unreachable. + */ + java.util.List + getUnreachableList(); + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString + getUnreachableBytes(int index); +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/LocationName.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/LocationName.java new file mode 100644 index 000000000000..429cc441d64f --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NetworkEndpoint.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NetworkEndpoint.java new file mode 100644 index 000000000000..def730101a40 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NetworkEndpoint.java @@ -0,0 +1,675 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + *
+ * A network endpoint over which a TPU worker can be reached.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.NetworkEndpoint} + */ +public final class NetworkEndpoint extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.NetworkEndpoint) + NetworkEndpointOrBuilder { +private static final long serialVersionUID = 0L; + // Use NetworkEndpoint.newBuilder() to construct. + private NetworkEndpoint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private NetworkEndpoint() { + ipAddress_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new NetworkEndpoint(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private NetworkEndpoint( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + ipAddress_ = s; + break; + } + case 16: { + + port_ = input.readInt32(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_NetworkEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_NetworkEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.NetworkEndpoint.class, com.google.cloud.tpu.v1.NetworkEndpoint.Builder.class); + } + + public static final int IP_ADDRESS_FIELD_NUMBER = 1; + private volatile java.lang.Object ipAddress_; + /** + *
+   * The IP address of this network endpoint.
+   * 
+ * + * string ip_address = 1; + * @return The ipAddress. + */ + @java.lang.Override + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } + } + /** + *
+   * The IP address of this network endpoint.
+   * 
+ * + * string ip_address = 1; + * @return The bytes for ipAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PORT_FIELD_NUMBER = 2; + private int port_; + /** + *
+   * The port of this network endpoint.
+   * 
+ * + * int32 port = 2; + * @return The port. + */ + @java.lang.Override + public int getPort() { + return port_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipAddress_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ipAddress_); + } + if (port_ != 0) { + output.writeInt32(2, port_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!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_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.tpu.v1.NetworkEndpoint)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.NetworkEndpoint other = (com.google.cloud.tpu.v1.NetworkEndpoint) obj; + + if (!getIpAddress() + .equals(other.getIpAddress())) return false; + if (getPort() + != other.getPort()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().hashCode(); + hash = (37 * hash) + PORT_FIELD_NUMBER; + hash = (53 * hash) + getPort(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.NetworkEndpoint parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.NetworkEndpoint parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.NetworkEndpoint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.NetworkEndpoint parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.NetworkEndpoint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.NetworkEndpoint parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.NetworkEndpoint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.NetworkEndpoint parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.NetworkEndpoint parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.NetworkEndpoint parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.NetworkEndpoint parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.NetworkEndpoint parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.tpu.v1.NetworkEndpoint prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A network endpoint over which a TPU worker can be reached.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.NetworkEndpoint} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.NetworkEndpoint) + com.google.cloud.tpu.v1.NetworkEndpointOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_NetworkEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_NetworkEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.NetworkEndpoint.class, com.google.cloud.tpu.v1.NetworkEndpoint.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.NetworkEndpoint.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + ipAddress_ = ""; + + port_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_NetworkEndpoint_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.NetworkEndpoint getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.NetworkEndpoint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.NetworkEndpoint build() { + com.google.cloud.tpu.v1.NetworkEndpoint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.NetworkEndpoint buildPartial() { + com.google.cloud.tpu.v1.NetworkEndpoint result = new com.google.cloud.tpu.v1.NetworkEndpoint(this); + result.ipAddress_ = ipAddress_; + result.port_ = port_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.NetworkEndpoint) { + return mergeFrom((com.google.cloud.tpu.v1.NetworkEndpoint)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.NetworkEndpoint other) { + if (other == com.google.cloud.tpu.v1.NetworkEndpoint.getDefaultInstance()) return this; + if (!other.getIpAddress().isEmpty()) { + ipAddress_ = other.ipAddress_; + onChanged(); + } + if (other.getPort() != 0) { + setPort(other.getPort()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.NetworkEndpoint parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.NetworkEndpoint) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object ipAddress_ = ""; + /** + *
+     * The IP address of this network endpoint.
+     * 
+ * + * string ip_address = 1; + * @return The ipAddress. + */ + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The IP address of this network endpoint.
+     * 
+ * + * string ip_address = 1; + * @return The bytes for ipAddress. + */ + public com.google.protobuf.ByteString + getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The IP address of this network endpoint.
+     * 
+ * + * string ip_address = 1; + * @param value The ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddress( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ipAddress_ = value; + onChanged(); + return this; + } + /** + *
+     * The IP address of this network endpoint.
+     * 
+ * + * string ip_address = 1; + * @return This builder for chaining. + */ + public Builder clearIpAddress() { + + ipAddress_ = getDefaultInstance().getIpAddress(); + onChanged(); + return this; + } + /** + *
+     * The IP address of this network endpoint.
+     * 
+ * + * string ip_address = 1; + * @param value The bytes for ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ipAddress_ = value; + onChanged(); + return this; + } + + private int port_ ; + /** + *
+     * The port of this network endpoint.
+     * 
+ * + * int32 port = 2; + * @return The port. + */ + @java.lang.Override + public int getPort() { + return port_; + } + /** + *
+     * The port of this network endpoint.
+     * 
+ * + * int32 port = 2; + * @param value The port to set. + * @return This builder for chaining. + */ + public Builder setPort(int value) { + + port_ = value; + onChanged(); + return this; + } + /** + *
+     * The port of this network endpoint.
+     * 
+ * + * int32 port = 2; + * @return This builder for chaining. + */ + public Builder clearPort() { + + port_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.NetworkEndpoint) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.NetworkEndpoint) + private static final com.google.cloud.tpu.v1.NetworkEndpoint DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.NetworkEndpoint(); + } + + public static com.google.cloud.tpu.v1.NetworkEndpoint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NetworkEndpoint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new NetworkEndpoint(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.NetworkEndpoint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NetworkEndpointOrBuilder.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NetworkEndpointOrBuilder.java new file mode 100644 index 000000000000..b77928c7db20 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NetworkEndpointOrBuilder.java @@ -0,0 +1,39 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface NetworkEndpointOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.NetworkEndpoint) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The IP address of this network endpoint.
+   * 
+ * + * string ip_address = 1; + * @return The ipAddress. + */ + java.lang.String getIpAddress(); + /** + *
+   * The IP address of this network endpoint.
+   * 
+ * + * string ip_address = 1; + * @return The bytes for ipAddress. + */ + com.google.protobuf.ByteString + getIpAddressBytes(); + + /** + *
+   * The port of this network endpoint.
+   * 
+ * + * int32 port = 2; + * @return The port. + */ + int getPort(); +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/Node.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/Node.java new file mode 100644 index 000000000000..df3873a8784f --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/Node.java @@ -0,0 +1,5143 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + *
+ * A TPU instance.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.Node} + */ +public final class Node extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.Node) + NodeOrBuilder { +private static final long serialVersionUID = 0L; + // Use Node.newBuilder() to construct. + private Node(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Node() { + name_ = ""; + description_ = ""; + acceleratorType_ = ""; + ipAddress_ = ""; + port_ = ""; + state_ = 0; + healthDescription_ = ""; + tensorflowVersion_ = ""; + network_ = ""; + cidrBlock_ = ""; + serviceAccount_ = ""; + networkEndpoints_ = java.util.Collections.emptyList(); + health_ = 0; + apiVersion_ = 0; + symptoms_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Node(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Node( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + acceleratorType_ = s; + break; + } + case 66: { + java.lang.String s = input.readStringRequireUtf8(); + + ipAddress_ = s; + break; + } + case 72: { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 82: { + java.lang.String s = input.readStringRequireUtf8(); + + healthDescription_ = s; + break; + } + case 90: { + java.lang.String s = input.readStringRequireUtf8(); + + tensorflowVersion_ = s; + break; + } + case 98: { + java.lang.String s = input.readStringRequireUtf8(); + + network_ = s; + break; + } + case 106: { + java.lang.String s = input.readStringRequireUtf8(); + + cidrBlock_ = s; + break; + } + case 114: { + java.lang.String s = input.readStringRequireUtf8(); + + port_ = s; + break; + } + case 122: { + java.lang.String s = input.readStringRequireUtf8(); + + serviceAccount_ = s; + break; + } + case 130: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 138: { + com.google.cloud.tpu.v1.SchedulingConfig.Builder subBuilder = null; + if (schedulingConfig_ != null) { + subBuilder = schedulingConfig_.toBuilder(); + } + schedulingConfig_ = input.readMessage(com.google.cloud.tpu.v1.SchedulingConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(schedulingConfig_); + schedulingConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 170: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + networkEndpoints_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + networkEndpoints_.add( + input.readMessage(com.google.cloud.tpu.v1.NetworkEndpoint.parser(), extensionRegistry)); + break; + } + case 176: { + int rawValue = input.readEnum(); + + health_ = rawValue; + break; + } + case 194: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + labels_ = com.google.protobuf.MapField.newMapField( + LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry + labels__ = input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put( + labels__.getKey(), labels__.getValue()); + break; + } + case 216: { + + useServiceNetworking_ = input.readBool(); + break; + } + case 304: { + int rawValue = input.readEnum(); + + apiVersion_ = rawValue; + break; + } + case 314: { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + symptoms_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + symptoms_.add( + input.readMessage(com.google.cloud.tpu.v1.Symptom.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + networkEndpoints_ = java.util.Collections.unmodifiableList(networkEndpoints_); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + symptoms_ = java.util.Collections.unmodifiableList(symptoms_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_Node_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 24: + return internalGetLabels(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_Node_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.Node.class, com.google.cloud.tpu.v1.Node.Builder.class); + } + + /** + *
+   * Represents the different states of a TPU node during its lifecycle.
+   * 
+ * + * Protobuf enum {@code google.cloud.tpu.v1.Node.State} + */ + public enum State + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * TPU node state is not known/set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + *
+     * TPU node is being created.
+     * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + *
+     * TPU node has been created and is fully usable.
+     * 
+ * + * READY = 2; + */ + READY(2), + /** + *
+     * TPU node is restarting.
+     * 
+ * + * RESTARTING = 3; + */ + RESTARTING(3), + /** + *
+     * TPU node is undergoing reimaging.
+     * 
+ * + * REIMAGING = 4; + */ + REIMAGING(4), + /** + *
+     * TPU node is being deleted.
+     * 
+ * + * DELETING = 5; + */ + DELETING(5), + /** + *
+     * TPU node is being repaired and may be unusable. Details can be
+     * found in the `help_description` field.
+     * 
+ * + * REPAIRING = 6; + */ + REPAIRING(6), + /** + *
+     * TPU node is stopped.
+     * 
+ * + * STOPPED = 8; + */ + STOPPED(8), + /** + *
+     * TPU node is currently stopping.
+     * 
+ * + * STOPPING = 9; + */ + STOPPING(9), + /** + *
+     * TPU node is currently starting.
+     * 
+ * + * STARTING = 10; + */ + STARTING(10), + /** + *
+     * TPU node has been preempted. Only applies to Preemptible TPU Nodes.
+     * 
+ * + * PREEMPTED = 11; + */ + PREEMPTED(11), + /** + *
+     * TPU node has been terminated due to maintenance or has reached the end of
+     * its life cycle (for preemptible nodes).
+     * 
+ * + * TERMINATED = 12; + */ + TERMINATED(12), + /** + *
+     * TPU node is currently hiding.
+     * 
+ * + * HIDING = 13; + */ + HIDING(13), + /** + *
+     * TPU node has been hidden.
+     * 
+ * + * HIDDEN = 14; + */ + HIDDEN(14), + /** + *
+     * TPU node is currently unhiding.
+     * 
+ * + * UNHIDING = 15; + */ + UNHIDING(15), + UNRECOGNIZED(-1), + ; + + /** + *
+     * TPU node state is not known/set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + *
+     * TPU node is being created.
+     * 
+ * + * CREATING = 1; + */ + public static final int CREATING_VALUE = 1; + /** + *
+     * TPU node has been created and is fully usable.
+     * 
+ * + * READY = 2; + */ + public static final int READY_VALUE = 2; + /** + *
+     * TPU node is restarting.
+     * 
+ * + * RESTARTING = 3; + */ + public static final int RESTARTING_VALUE = 3; + /** + *
+     * TPU node is undergoing reimaging.
+     * 
+ * + * REIMAGING = 4; + */ + public static final int REIMAGING_VALUE = 4; + /** + *
+     * TPU node is being deleted.
+     * 
+ * + * DELETING = 5; + */ + public static final int DELETING_VALUE = 5; + /** + *
+     * TPU node is being repaired and may be unusable. Details can be
+     * found in the `help_description` field.
+     * 
+ * + * REPAIRING = 6; + */ + public static final int REPAIRING_VALUE = 6; + /** + *
+     * TPU node is stopped.
+     * 
+ * + * STOPPED = 8; + */ + public static final int STOPPED_VALUE = 8; + /** + *
+     * TPU node is currently stopping.
+     * 
+ * + * STOPPING = 9; + */ + public static final int STOPPING_VALUE = 9; + /** + *
+     * TPU node is currently starting.
+     * 
+ * + * STARTING = 10; + */ + public static final int STARTING_VALUE = 10; + /** + *
+     * TPU node has been preempted. Only applies to Preemptible TPU Nodes.
+     * 
+ * + * PREEMPTED = 11; + */ + public static final int PREEMPTED_VALUE = 11; + /** + *
+     * TPU node has been terminated due to maintenance or has reached the end of
+     * its life cycle (for preemptible nodes).
+     * 
+ * + * TERMINATED = 12; + */ + public static final int TERMINATED_VALUE = 12; + /** + *
+     * TPU node is currently hiding.
+     * 
+ * + * HIDING = 13; + */ + public static final int HIDING_VALUE = 13; + /** + *
+     * TPU node has been hidden.
+     * 
+ * + * HIDDEN = 14; + */ + public static final int HIDDEN_VALUE = 14; + /** + *
+     * TPU node is currently unhiding.
+     * 
+ * + * UNHIDING = 15; + */ + public static final int UNHIDING_VALUE = 15; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: return STATE_UNSPECIFIED; + case 1: return CREATING; + case 2: return READY; + case 3: return RESTARTING; + case 4: return REIMAGING; + case 5: return DELETING; + case 6: return REPAIRING; + case 8: return STOPPED; + case 9: return STOPPING; + case 10: return STARTING; + case 11: return PREEMPTED; + case 12: return TERMINATED; + case 13: return HIDING; + case 14: return HIDDEN; + case 15: return UNHIDING; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + State> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.tpu.v1.Node.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.tpu.v1.Node.State) + } + + /** + *
+   * Health defines the status of a TPU node as reported by
+   * Health Monitor.
+   * 
+ * + * Protobuf enum {@code google.cloud.tpu.v1.Node.Health} + */ + public enum Health + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Health status is unknown: not initialized or failed to retrieve.
+     * 
+ * + * HEALTH_UNSPECIFIED = 0; + */ + HEALTH_UNSPECIFIED(0), + /** + *
+     * The resource is healthy.
+     * 
+ * + * HEALTHY = 1; + */ + HEALTHY(1), + /** + *
+     * The resource is unhealthy.
+     * 
+ * + * DEPRECATED_UNHEALTHY = 2; + */ + DEPRECATED_UNHEALTHY(2), + /** + *
+     * The resource is unresponsive.
+     * 
+ * + * TIMEOUT = 3; + */ + TIMEOUT(3), + /** + *
+     * The in-guest ML stack is unhealthy.
+     * 
+ * + * UNHEALTHY_TENSORFLOW = 4; + */ + UNHEALTHY_TENSORFLOW(4), + /** + *
+     * The node is under maintenance/priority boost caused rescheduling and
+     * will resume running once rescheduled.
+     * 
+ * + * UNHEALTHY_MAINTENANCE = 5; + */ + UNHEALTHY_MAINTENANCE(5), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Health status is unknown: not initialized or failed to retrieve.
+     * 
+ * + * HEALTH_UNSPECIFIED = 0; + */ + public static final int HEALTH_UNSPECIFIED_VALUE = 0; + /** + *
+     * The resource is healthy.
+     * 
+ * + * HEALTHY = 1; + */ + public static final int HEALTHY_VALUE = 1; + /** + *
+     * The resource is unhealthy.
+     * 
+ * + * DEPRECATED_UNHEALTHY = 2; + */ + public static final int DEPRECATED_UNHEALTHY_VALUE = 2; + /** + *
+     * The resource is unresponsive.
+     * 
+ * + * TIMEOUT = 3; + */ + public static final int TIMEOUT_VALUE = 3; + /** + *
+     * The in-guest ML stack is unhealthy.
+     * 
+ * + * UNHEALTHY_TENSORFLOW = 4; + */ + public static final int UNHEALTHY_TENSORFLOW_VALUE = 4; + /** + *
+     * The node is under maintenance/priority boost caused rescheduling and
+     * will resume running once rescheduled.
+     * 
+ * + * UNHEALTHY_MAINTENANCE = 5; + */ + public static final int UNHEALTHY_MAINTENANCE_VALUE = 5; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Health valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Health forNumber(int value) { + switch (value) { + case 0: return HEALTH_UNSPECIFIED; + case 1: return HEALTHY; + case 2: return DEPRECATED_UNHEALTHY; + case 3: return TIMEOUT; + case 4: return UNHEALTHY_TENSORFLOW; + case 5: return UNHEALTHY_MAINTENANCE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Health> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Health findValueByNumber(int number) { + return Health.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.tpu.v1.Node.getDescriptor().getEnumTypes().get(1); + } + + private static final Health[] VALUES = values(); + + public static Health valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Health(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.tpu.v1.Node.Health) + } + + /** + *
+   * TPU API Version.
+   * 
+ * + * Protobuf enum {@code google.cloud.tpu.v1.Node.ApiVersion} + */ + public enum ApiVersion + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * API version is unknown.
+     * 
+ * + * API_VERSION_UNSPECIFIED = 0; + */ + API_VERSION_UNSPECIFIED(0), + /** + *
+     * TPU API V1Alpha1 version.
+     * 
+ * + * V1_ALPHA1 = 1; + */ + V1_ALPHA1(1), + /** + *
+     * TPU API V1 version.
+     * 
+ * + * V1 = 2; + */ + V1(2), + /** + *
+     * TPU API V2Alpha1 version.
+     * 
+ * + * V2_ALPHA1 = 3; + */ + V2_ALPHA1(3), + UNRECOGNIZED(-1), + ; + + /** + *
+     * API version is unknown.
+     * 
+ * + * API_VERSION_UNSPECIFIED = 0; + */ + public static final int API_VERSION_UNSPECIFIED_VALUE = 0; + /** + *
+     * TPU API V1Alpha1 version.
+     * 
+ * + * V1_ALPHA1 = 1; + */ + public static final int V1_ALPHA1_VALUE = 1; + /** + *
+     * TPU API V1 version.
+     * 
+ * + * V1 = 2; + */ + public static final int V1_VALUE = 2; + /** + *
+     * TPU API V2Alpha1 version.
+     * 
+ * + * V2_ALPHA1 = 3; + */ + public static final int V2_ALPHA1_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ApiVersion valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ApiVersion forNumber(int value) { + switch (value) { + case 0: return API_VERSION_UNSPECIFIED; + case 1: return V1_ALPHA1; + case 2: return V1; + case 3: return V2_ALPHA1; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ApiVersion> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ApiVersion findValueByNumber(int number) { + return ApiVersion.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.tpu.v1.Node.getDescriptor().getEnumTypes().get(2); + } + + private static final ApiVersion[] VALUES = values(); + + public static ApiVersion valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ApiVersion(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.tpu.v1.Node.ApiVersion) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Output only. Immutable. The name of the TPU
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Output only. Immutable. The name of the TPU
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + *
+   * The user-supplied description of the TPU. Maximum of 512 characters.
+   * 
+ * + * string description = 3; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + *
+   * The user-supplied description of the TPU. Maximum of 512 characters.
+   * 
+ * + * string description = 3; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACCELERATOR_TYPE_FIELD_NUMBER = 5; + private volatile java.lang.Object acceleratorType_; + /** + *
+   * Required. The type of hardware accelerators associated with this node.
+   * 
+ * + * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return The acceleratorType. + */ + @java.lang.Override + public java.lang.String getAcceleratorType() { + java.lang.Object ref = acceleratorType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + acceleratorType_ = s; + return s; + } + } + /** + *
+   * Required. The type of hardware accelerators associated with this node.
+   * 
+ * + * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for acceleratorType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAcceleratorTypeBytes() { + java.lang.Object ref = acceleratorType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + acceleratorType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IP_ADDRESS_FIELD_NUMBER = 8; + private volatile java.lang.Object ipAddress_; + /** + *
+   * Output only. DEPRECATED! Use network_endpoints instead.
+   * The network address for the TPU Node as visible to Compute Engine
+   * instances.
+   * 
+ * + * string ip_address = 8 [deprecated = true]; + * @deprecated google.cloud.tpu.v1.Node.ip_address is deprecated. + * See google/cloud/tpu/v1/cloud_tpu.proto;l=275 + * @return The ipAddress. + */ + @java.lang.Override + @java.lang.Deprecated public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } + } + /** + *
+   * Output only. DEPRECATED! Use network_endpoints instead.
+   * The network address for the TPU Node as visible to Compute Engine
+   * instances.
+   * 
+ * + * string ip_address = 8 [deprecated = true]; + * @deprecated google.cloud.tpu.v1.Node.ip_address is deprecated. + * See google/cloud/tpu/v1/cloud_tpu.proto;l=275 + * @return The bytes for ipAddress. + */ + @java.lang.Override + @java.lang.Deprecated public com.google.protobuf.ByteString + getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PORT_FIELD_NUMBER = 14; + private volatile java.lang.Object port_; + /** + *
+   * Output only. DEPRECATED! Use network_endpoints instead.
+   * The network port for the TPU Node as visible to Compute Engine instances.
+   * 
+ * + * string port = 14 [deprecated = true]; + * @deprecated google.cloud.tpu.v1.Node.port is deprecated. + * See google/cloud/tpu/v1/cloud_tpu.proto;l=279 + * @return The port. + */ + @java.lang.Override + @java.lang.Deprecated public java.lang.String getPort() { + java.lang.Object ref = port_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + port_ = s; + return s; + } + } + /** + *
+   * Output only. DEPRECATED! Use network_endpoints instead.
+   * The network port for the TPU Node as visible to Compute Engine instances.
+   * 
+ * + * string port = 14 [deprecated = true]; + * @deprecated google.cloud.tpu.v1.Node.port is deprecated. + * See google/cloud/tpu/v1/cloud_tpu.proto;l=279 + * @return The bytes for port. + */ + @java.lang.Override + @java.lang.Deprecated public com.google.protobuf.ByteString + getPortBytes() { + java.lang.Object ref = port_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + port_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 9; + private int state_; + /** + *
+   * Output only. The current state for the TPU Node.
+   * 
+ * + * .google.cloud.tpu.v1.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override public int getStateValue() { + return state_; + } + /** + *
+   * Output only. The current state for the TPU Node.
+   * 
+ * + * .google.cloud.tpu.v1.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The state. + */ + @java.lang.Override public com.google.cloud.tpu.v1.Node.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v1.Node.State result = com.google.cloud.tpu.v1.Node.State.valueOf(state_); + return result == null ? com.google.cloud.tpu.v1.Node.State.UNRECOGNIZED : result; + } + + public static final int HEALTH_DESCRIPTION_FIELD_NUMBER = 10; + private volatile java.lang.Object healthDescription_; + /** + *
+   * Output only. If this field is populated, it contains a description of why the TPU Node
+   * is unhealthy.
+   * 
+ * + * string health_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The healthDescription. + */ + @java.lang.Override + public java.lang.String getHealthDescription() { + java.lang.Object ref = healthDescription_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + healthDescription_ = s; + return s; + } + } + /** + *
+   * Output only. If this field is populated, it contains a description of why the TPU Node
+   * is unhealthy.
+   * 
+ * + * string health_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for healthDescription. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getHealthDescriptionBytes() { + java.lang.Object ref = healthDescription_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + healthDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TENSORFLOW_VERSION_FIELD_NUMBER = 11; + private volatile java.lang.Object tensorflowVersion_; + /** + *
+   * Required. The version of Tensorflow running in the Node.
+   * 
+ * + * string tensorflow_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * @return The tensorflowVersion. + */ + @java.lang.Override + public java.lang.String getTensorflowVersion() { + java.lang.Object ref = tensorflowVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tensorflowVersion_ = s; + return s; + } + } + /** + *
+   * Required. The version of Tensorflow running in the Node.
+   * 
+ * + * string tensorflow_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for tensorflowVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTensorflowVersionBytes() { + java.lang.Object ref = tensorflowVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tensorflowVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NETWORK_FIELD_NUMBER = 12; + private volatile java.lang.Object network_; + /** + *
+   * The name of a network they wish to peer the TPU node to. It must be a
+   * preexisting Compute Engine network inside of the project on which this API
+   * has been activated. If none is provided, "default" will be used.
+   * 
+ * + * string network = 12; + * @return The network. + */ + @java.lang.Override + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } + } + /** + *
+   * The name of a network they wish to peer the TPU node to. It must be a
+   * preexisting Compute Engine network inside of the project on which this API
+   * has been activated. If none is provided, "default" will be used.
+   * 
+ * + * string network = 12; + * @return The bytes for network. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CIDR_BLOCK_FIELD_NUMBER = 13; + private volatile java.lang.Object cidrBlock_; + /** + *
+   * The CIDR block that the TPU node will use when selecting an IP address.
+   * This CIDR block must be a /29 block; the Compute Engine networks API
+   * forbids a smaller block, and using a larger block would be wasteful (a
+   * node can only consume one IP address). Errors will occur if the CIDR block
+   * has already been used for a currently existing TPU node, the CIDR block
+   * conflicts with any subnetworks in the user's provided network, or the
+   * provided network is peered with another network that is using that CIDR
+   * block.
+   * 
+ * + * string cidr_block = 13; + * @return The cidrBlock. + */ + @java.lang.Override + public java.lang.String getCidrBlock() { + java.lang.Object ref = cidrBlock_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cidrBlock_ = s; + return s; + } + } + /** + *
+   * The CIDR block that the TPU node will use when selecting an IP address.
+   * This CIDR block must be a /29 block; the Compute Engine networks API
+   * forbids a smaller block, and using a larger block would be wasteful (a
+   * node can only consume one IP address). Errors will occur if the CIDR block
+   * has already been used for a currently existing TPU node, the CIDR block
+   * conflicts with any subnetworks in the user's provided network, or the
+   * provided network is peered with another network that is using that CIDR
+   * block.
+   * 
+ * + * string cidr_block = 13; + * @return The bytes for cidrBlock. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCidrBlockBytes() { + java.lang.Object ref = cidrBlock_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cidrBlock_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ACCOUNT_FIELD_NUMBER = 15; + private volatile java.lang.Object serviceAccount_; + /** + *
+   * Output only. The service account used to run the tensor flow services within the node.
+   * To share resources, including Google Cloud Storage data, with the
+   * Tensorflow job running in the Node, this account must have permissions to
+   * that data.
+   * 
+ * + * string service_account = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The serviceAccount. + */ + @java.lang.Override + public java.lang.String getServiceAccount() { + java.lang.Object ref = serviceAccount_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccount_ = s; + return s; + } + } + /** + *
+   * Output only. The service account used to run the tensor flow services within the node.
+   * To share resources, including Google Cloud Storage data, with the
+   * Tensorflow job running in the Node, this account must have permissions to
+   * that data.
+   * 
+ * + * string service_account = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for serviceAccount. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getServiceAccountBytes() { + java.lang.Object ref = serviceAccount_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + serviceAccount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 16; + private com.google.protobuf.Timestamp createTime_; + /** + *
+   * Output only. The time when the node was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + *
+   * Output only. The time when the node was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + *
+   * Output only. The time when the node was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int SCHEDULING_CONFIG_FIELD_NUMBER = 17; + private com.google.cloud.tpu.v1.SchedulingConfig schedulingConfig_; + /** + *
+   * The scheduling options for this node.
+   * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + * @return Whether the schedulingConfig field is set. + */ + @java.lang.Override + public boolean hasSchedulingConfig() { + return schedulingConfig_ != null; + } + /** + *
+   * The scheduling options for this node.
+   * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + * @return The schedulingConfig. + */ + @java.lang.Override + public com.google.cloud.tpu.v1.SchedulingConfig getSchedulingConfig() { + return schedulingConfig_ == null ? com.google.cloud.tpu.v1.SchedulingConfig.getDefaultInstance() : schedulingConfig_; + } + /** + *
+   * The scheduling options for this node.
+   * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + */ + @java.lang.Override + public com.google.cloud.tpu.v1.SchedulingConfigOrBuilder getSchedulingConfigOrBuilder() { + return getSchedulingConfig(); + } + + public static final int NETWORK_ENDPOINTS_FIELD_NUMBER = 21; + private java.util.List networkEndpoints_; + /** + *
+   * Output only. The network endpoints where TPU workers can be accessed and
+   * sent work. It is recommended that Tensorflow clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + @java.lang.Override + public java.util.List getNetworkEndpointsList() { + return networkEndpoints_; + } + /** + *
+   * Output only. The network endpoints where TPU workers can be accessed and
+   * sent work. It is recommended that Tensorflow clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + @java.lang.Override + public java.util.List + getNetworkEndpointsOrBuilderList() { + return networkEndpoints_; + } + /** + *
+   * Output only. The network endpoints where TPU workers can be accessed and
+   * sent work. It is recommended that Tensorflow clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + @java.lang.Override + public int getNetworkEndpointsCount() { + return networkEndpoints_.size(); + } + /** + *
+   * Output only. The network endpoints where TPU workers can be accessed and
+   * sent work. It is recommended that Tensorflow clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + @java.lang.Override + public com.google.cloud.tpu.v1.NetworkEndpoint getNetworkEndpoints(int index) { + return networkEndpoints_.get(index); + } + /** + *
+   * Output only. The network endpoints where TPU workers can be accessed and
+   * sent work. It is recommended that Tensorflow clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + @java.lang.Override + public com.google.cloud.tpu.v1.NetworkEndpointOrBuilder getNetworkEndpointsOrBuilder( + int index) { + return networkEndpoints_.get(index); + } + + public static final int HEALTH_FIELD_NUMBER = 22; + private int health_; + /** + *
+   * The health status of the TPU node.
+   * 
+ * + * .google.cloud.tpu.v1.Node.Health health = 22; + * @return The enum numeric value on the wire for health. + */ + @java.lang.Override public int getHealthValue() { + return health_; + } + /** + *
+   * The health status of the TPU node.
+   * 
+ * + * .google.cloud.tpu.v1.Node.Health health = 22; + * @return The health. + */ + @java.lang.Override public com.google.cloud.tpu.v1.Node.Health getHealth() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v1.Node.Health result = com.google.cloud.tpu.v1.Node.Health.valueOf(health_); + return result == null ? com.google.cloud.tpu.v1.Node.Health.UNRECOGNIZED : result; + } + + public static final int LABELS_FIELD_NUMBER = 24; + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_Node_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> 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 NullPointerException("map key"); } + return internalGetLabels().getMap().containsKey(key); + } + /** + * Use {@link #getLabelsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + *
+   * 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 NullPointerException("map key"); } + 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 NullPointerException("map key"); } + java.util.Map map = + internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int USE_SERVICE_NETWORKING_FIELD_NUMBER = 27; + private boolean useServiceNetworking_; + /** + *
+   * Whether the VPC peering for the node is set up through Service Networking
+   * API. The VPC Peering should be set up before provisioning the node.
+   * If this field is set, cidr_block field should not be specified. If the
+   * network, that you want to peer the TPU Node to, is Shared VPC networks,
+   * the node must be created with this this field enabled.
+   * 
+ * + * bool use_service_networking = 27; + * @return The useServiceNetworking. + */ + @java.lang.Override + public boolean getUseServiceNetworking() { + return useServiceNetworking_; + } + + public static final int API_VERSION_FIELD_NUMBER = 38; + private int apiVersion_; + /** + *
+   * Output only. The API version that created this Node.
+   * 
+ * + * .google.cloud.tpu.v1.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The enum numeric value on the wire for apiVersion. + */ + @java.lang.Override public int getApiVersionValue() { + return apiVersion_; + } + /** + *
+   * Output only. The API version that created this Node.
+   * 
+ * + * .google.cloud.tpu.v1.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The apiVersion. + */ + @java.lang.Override public com.google.cloud.tpu.v1.Node.ApiVersion getApiVersion() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v1.Node.ApiVersion result = com.google.cloud.tpu.v1.Node.ApiVersion.valueOf(apiVersion_); + return result == null ? com.google.cloud.tpu.v1.Node.ApiVersion.UNRECOGNIZED : result; + } + + public static final int SYMPTOMS_FIELD_NUMBER = 39; + private java.util.List symptoms_; + /** + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + @java.lang.Override + public java.util.List getSymptomsList() { + return symptoms_; + } + /** + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + @java.lang.Override + public java.util.List + getSymptomsOrBuilderList() { + return symptoms_; + } + /** + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + @java.lang.Override + public int getSymptomsCount() { + return symptoms_.size(); + } + /** + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + @java.lang.Override + public com.google.cloud.tpu.v1.Symptom getSymptoms(int index) { + return symptoms_.get(index); + } + /** + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + @java.lang.Override + public com.google.cloud.tpu.v1.SymptomOrBuilder getSymptomsOrBuilder( + int index) { + return symptoms_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipAddress_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, ipAddress_); + } + if (state_ != com.google.cloud.tpu.v1.Node.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(9, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(healthDescription_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, healthDescription_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tensorflowVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, tensorflowVersion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, network_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cidrBlock_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, cidrBlock_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(port_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, port_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccount_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, serviceAccount_); + } + if (createTime_ != null) { + output.writeMessage(16, getCreateTime()); + } + if (schedulingConfig_ != null) { + output.writeMessage(17, getSchedulingConfig()); + } + for (int i = 0; i < networkEndpoints_.size(); i++) { + output.writeMessage(21, networkEndpoints_.get(i)); + } + if (health_ != com.google.cloud.tpu.v1.Node.Health.HEALTH_UNSPECIFIED.getNumber()) { + output.writeEnum(22, health_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetLabels(), + LabelsDefaultEntryHolder.defaultEntry, + 24); + if (useServiceNetworking_ != false) { + output.writeBool(27, useServiceNetworking_); + } + if (apiVersion_ != com.google.cloud.tpu.v1.Node.ApiVersion.API_VERSION_UNSPECIFIED.getNumber()) { + output.writeEnum(38, apiVersion_); + } + for (int i = 0; i < symptoms_.size(); i++) { + output.writeMessage(39, symptoms_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipAddress_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, ipAddress_); + } + if (state_ != com.google.cloud.tpu.v1.Node.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(9, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(healthDescription_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, healthDescription_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tensorflowVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, tensorflowVersion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, network_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cidrBlock_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, cidrBlock_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(port_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, port_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccount_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, serviceAccount_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(16, getCreateTime()); + } + if (schedulingConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(17, getSchedulingConfig()); + } + for (int i = 0; i < networkEndpoints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(21, networkEndpoints_.get(i)); + } + if (health_ != com.google.cloud.tpu.v1.Node.Health.HEALTH_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(22, health_); + } + for (java.util.Map.Entry entry + : internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry + labels__ = LabelsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(24, labels__); + } + if (useServiceNetworking_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(27, useServiceNetworking_); + } + if (apiVersion_ != com.google.cloud.tpu.v1.Node.ApiVersion.API_VERSION_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(38, apiVersion_); + } + for (int i = 0; i < symptoms_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(39, symptoms_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.tpu.v1.Node)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.Node other = (com.google.cloud.tpu.v1.Node) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getDescription() + .equals(other.getDescription())) return false; + if (!getAcceleratorType() + .equals(other.getAcceleratorType())) return false; + if (!getIpAddress() + .equals(other.getIpAddress())) return false; + if (!getPort() + .equals(other.getPort())) return false; + if (state_ != other.state_) return false; + if (!getHealthDescription() + .equals(other.getHealthDescription())) return false; + if (!getTensorflowVersion() + .equals(other.getTensorflowVersion())) return false; + if (!getNetwork() + .equals(other.getNetwork())) return false; + if (!getCidrBlock() + .equals(other.getCidrBlock())) return false; + if (!getServiceAccount() + .equals(other.getServiceAccount())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime() + .equals(other.getCreateTime())) return false; + } + if (hasSchedulingConfig() != other.hasSchedulingConfig()) return false; + if (hasSchedulingConfig()) { + if (!getSchedulingConfig() + .equals(other.getSchedulingConfig())) return false; + } + if (!getNetworkEndpointsList() + .equals(other.getNetworkEndpointsList())) return false; + if (health_ != other.health_) return false; + if (!internalGetLabels().equals( + other.internalGetLabels())) return false; + if (getUseServiceNetworking() + != other.getUseServiceNetworking()) return false; + if (apiVersion_ != other.apiVersion_) return false; + if (!getSymptomsList() + .equals(other.getSymptomsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + ACCELERATOR_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getAcceleratorType().hashCode(); + hash = (37 * hash) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().hashCode(); + hash = (37 * hash) + PORT_FIELD_NUMBER; + hash = (53 * hash) + getPort().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + HEALTH_DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getHealthDescription().hashCode(); + hash = (37 * hash) + TENSORFLOW_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getTensorflowVersion().hashCode(); + hash = (37 * hash) + NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getNetwork().hashCode(); + hash = (37 * hash) + CIDR_BLOCK_FIELD_NUMBER; + hash = (53 * hash) + getCidrBlock().hashCode(); + hash = (37 * hash) + SERVICE_ACCOUNT_FIELD_NUMBER; + hash = (53 * hash) + getServiceAccount().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasSchedulingConfig()) { + hash = (37 * hash) + SCHEDULING_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getSchedulingConfig().hashCode(); + } + if (getNetworkEndpointsCount() > 0) { + hash = (37 * hash) + NETWORK_ENDPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getNetworkEndpointsList().hashCode(); + } + hash = (37 * hash) + HEALTH_FIELD_NUMBER; + hash = (53 * hash) + health_; + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + USE_SERVICE_NETWORKING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getUseServiceNetworking()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + apiVersion_; + if (getSymptomsCount() > 0) { + hash = (37 * hash) + SYMPTOMS_FIELD_NUMBER; + hash = (53 * hash) + getSymptomsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.Node parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.Node parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.Node parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.Node parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.Node parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.Node parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.Node parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.Node parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.Node parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.Node parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.Node parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.Node parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.tpu.v1.Node prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A TPU instance.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.Node} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.Node) + com.google.cloud.tpu.v1.NodeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_Node_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 24: + return internalGetLabels(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 24: + return internalGetMutableLabels(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_Node_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.Node.class, com.google.cloud.tpu.v1.Node.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.Node.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getNetworkEndpointsFieldBuilder(); + getSymptomsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + description_ = ""; + + acceleratorType_ = ""; + + ipAddress_ = ""; + + port_ = ""; + + state_ = 0; + + healthDescription_ = ""; + + tensorflowVersion_ = ""; + + network_ = ""; + + cidrBlock_ = ""; + + serviceAccount_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (schedulingConfigBuilder_ == null) { + schedulingConfig_ = null; + } else { + schedulingConfig_ = null; + schedulingConfigBuilder_ = null; + } + if (networkEndpointsBuilder_ == null) { + networkEndpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + networkEndpointsBuilder_.clear(); + } + health_ = 0; + + internalGetMutableLabels().clear(); + useServiceNetworking_ = false; + + apiVersion_ = 0; + + if (symptomsBuilder_ == null) { + symptoms_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + symptomsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_Node_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.Node getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.Node.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.Node build() { + com.google.cloud.tpu.v1.Node result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.Node buildPartial() { + com.google.cloud.tpu.v1.Node result = new com.google.cloud.tpu.v1.Node(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.description_ = description_; + result.acceleratorType_ = acceleratorType_; + result.ipAddress_ = ipAddress_; + result.port_ = port_; + result.state_ = state_; + result.healthDescription_ = healthDescription_; + result.tensorflowVersion_ = tensorflowVersion_; + result.network_ = network_; + result.cidrBlock_ = cidrBlock_; + result.serviceAccount_ = serviceAccount_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (schedulingConfigBuilder_ == null) { + result.schedulingConfig_ = schedulingConfig_; + } else { + result.schedulingConfig_ = schedulingConfigBuilder_.build(); + } + if (networkEndpointsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + networkEndpoints_ = java.util.Collections.unmodifiableList(networkEndpoints_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.networkEndpoints_ = networkEndpoints_; + } else { + result.networkEndpoints_ = networkEndpointsBuilder_.build(); + } + result.health_ = health_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.useServiceNetworking_ = useServiceNetworking_; + result.apiVersion_ = apiVersion_; + if (symptomsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + symptoms_ = java.util.Collections.unmodifiableList(symptoms_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.symptoms_ = symptoms_; + } else { + result.symptoms_ = symptomsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.Node) { + return mergeFrom((com.google.cloud.tpu.v1.Node)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.Node other) { + if (other == com.google.cloud.tpu.v1.Node.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (!other.getAcceleratorType().isEmpty()) { + acceleratorType_ = other.acceleratorType_; + onChanged(); + } + if (!other.getIpAddress().isEmpty()) { + ipAddress_ = other.ipAddress_; + onChanged(); + } + if (!other.getPort().isEmpty()) { + port_ = other.port_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getHealthDescription().isEmpty()) { + healthDescription_ = other.healthDescription_; + onChanged(); + } + if (!other.getTensorflowVersion().isEmpty()) { + tensorflowVersion_ = other.tensorflowVersion_; + onChanged(); + } + if (!other.getNetwork().isEmpty()) { + network_ = other.network_; + onChanged(); + } + if (!other.getCidrBlock().isEmpty()) { + cidrBlock_ = other.cidrBlock_; + onChanged(); + } + if (!other.getServiceAccount().isEmpty()) { + serviceAccount_ = other.serviceAccount_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasSchedulingConfig()) { + mergeSchedulingConfig(other.getSchedulingConfig()); + } + if (networkEndpointsBuilder_ == null) { + if (!other.networkEndpoints_.isEmpty()) { + if (networkEndpoints_.isEmpty()) { + networkEndpoints_ = other.networkEndpoints_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNetworkEndpointsIsMutable(); + networkEndpoints_.addAll(other.networkEndpoints_); + } + onChanged(); + } + } else { + if (!other.networkEndpoints_.isEmpty()) { + if (networkEndpointsBuilder_.isEmpty()) { + networkEndpointsBuilder_.dispose(); + networkEndpointsBuilder_ = null; + networkEndpoints_ = other.networkEndpoints_; + bitField0_ = (bitField0_ & ~0x00000001); + networkEndpointsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getNetworkEndpointsFieldBuilder() : null; + } else { + networkEndpointsBuilder_.addAllMessages(other.networkEndpoints_); + } + } + } + if (other.health_ != 0) { + setHealthValue(other.getHealthValue()); + } + internalGetMutableLabels().mergeFrom( + other.internalGetLabels()); + if (other.getUseServiceNetworking() != false) { + setUseServiceNetworking(other.getUseServiceNetworking()); + } + if (other.apiVersion_ != 0) { + setApiVersionValue(other.getApiVersionValue()); + } + if (symptomsBuilder_ == null) { + if (!other.symptoms_.isEmpty()) { + if (symptoms_.isEmpty()) { + symptoms_ = other.symptoms_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureSymptomsIsMutable(); + symptoms_.addAll(other.symptoms_); + } + onChanged(); + } + } else { + if (!other.symptoms_.isEmpty()) { + if (symptomsBuilder_.isEmpty()) { + symptomsBuilder_.dispose(); + symptomsBuilder_ = null; + symptoms_ = other.symptoms_; + bitField0_ = (bitField0_ & ~0x00000004); + symptomsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSymptomsFieldBuilder() : null; + } else { + symptomsBuilder_.addAllMessages(other.symptoms_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.Node parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.Node) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
+     * Output only. Immutable. The name of the TPU
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. Immutable. The name of the TPU
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. Immutable. The name of the TPU
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. Immutable. The name of the TPU
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Output only. Immutable. The name of the TPU
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
+     * The user-supplied description of the TPU. Maximum of 512 characters.
+     * 
+ * + * string description = 3; + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The user-supplied description of the TPU. Maximum of 512 characters.
+     * 
+ * + * string description = 3; + * @return The bytes for description. + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The user-supplied description of the TPU. Maximum of 512 characters.
+     * 
+ * + * string description = 3; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + *
+     * The user-supplied description of the TPU. Maximum of 512 characters.
+     * 
+ * + * string description = 3; + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + *
+     * The user-supplied description of the TPU. Maximum of 512 characters.
+     * 
+ * + * string description = 3; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.lang.Object acceleratorType_ = ""; + /** + *
+     * Required. The type of hardware accelerators associated with this node.
+     * 
+ * + * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return The acceleratorType. + */ + public java.lang.String getAcceleratorType() { + java.lang.Object ref = acceleratorType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + acceleratorType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The type of hardware accelerators associated with this node.
+     * 
+ * + * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for acceleratorType. + */ + public com.google.protobuf.ByteString + getAcceleratorTypeBytes() { + java.lang.Object ref = acceleratorType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + acceleratorType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The type of hardware accelerators associated with this node.
+     * 
+ * + * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param value The acceleratorType to set. + * @return This builder for chaining. + */ + public Builder setAcceleratorType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + acceleratorType_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The type of hardware accelerators associated with this node.
+     * 
+ * + * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return This builder for chaining. + */ + public Builder clearAcceleratorType() { + + acceleratorType_ = getDefaultInstance().getAcceleratorType(); + onChanged(); + return this; + } + /** + *
+     * Required. The type of hardware accelerators associated with this node.
+     * 
+ * + * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param value The bytes for acceleratorType to set. + * @return This builder for chaining. + */ + public Builder setAcceleratorTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + acceleratorType_ = value; + onChanged(); + return this; + } + + private java.lang.Object ipAddress_ = ""; + /** + *
+     * Output only. DEPRECATED! Use network_endpoints instead.
+     * The network address for the TPU Node as visible to Compute Engine
+     * instances.
+     * 
+ * + * string ip_address = 8 [deprecated = true]; + * @deprecated google.cloud.tpu.v1.Node.ip_address is deprecated. + * See google/cloud/tpu/v1/cloud_tpu.proto;l=275 + * @return The ipAddress. + */ + @java.lang.Deprecated public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. DEPRECATED! Use network_endpoints instead.
+     * The network address for the TPU Node as visible to Compute Engine
+     * instances.
+     * 
+ * + * string ip_address = 8 [deprecated = true]; + * @deprecated google.cloud.tpu.v1.Node.ip_address is deprecated. + * See google/cloud/tpu/v1/cloud_tpu.proto;l=275 + * @return The bytes for ipAddress. + */ + @java.lang.Deprecated public com.google.protobuf.ByteString + getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. DEPRECATED! Use network_endpoints instead.
+     * The network address for the TPU Node as visible to Compute Engine
+     * instances.
+     * 
+ * + * string ip_address = 8 [deprecated = true]; + * @deprecated google.cloud.tpu.v1.Node.ip_address is deprecated. + * See google/cloud/tpu/v1/cloud_tpu.proto;l=275 + * @param value The ipAddress to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setIpAddress( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ipAddress_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. DEPRECATED! Use network_endpoints instead.
+     * The network address for the TPU Node as visible to Compute Engine
+     * instances.
+     * 
+ * + * string ip_address = 8 [deprecated = true]; + * @deprecated google.cloud.tpu.v1.Node.ip_address is deprecated. + * See google/cloud/tpu/v1/cloud_tpu.proto;l=275 + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder clearIpAddress() { + + ipAddress_ = getDefaultInstance().getIpAddress(); + onChanged(); + return this; + } + /** + *
+     * Output only. DEPRECATED! Use network_endpoints instead.
+     * The network address for the TPU Node as visible to Compute Engine
+     * instances.
+     * 
+ * + * string ip_address = 8 [deprecated = true]; + * @deprecated google.cloud.tpu.v1.Node.ip_address is deprecated. + * See google/cloud/tpu/v1/cloud_tpu.proto;l=275 + * @param value The bytes for ipAddress to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setIpAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ipAddress_ = value; + onChanged(); + return this; + } + + private java.lang.Object port_ = ""; + /** + *
+     * Output only. DEPRECATED! Use network_endpoints instead.
+     * The network port for the TPU Node as visible to Compute Engine instances.
+     * 
+ * + * string port = 14 [deprecated = true]; + * @deprecated google.cloud.tpu.v1.Node.port is deprecated. + * See google/cloud/tpu/v1/cloud_tpu.proto;l=279 + * @return The port. + */ + @java.lang.Deprecated public java.lang.String getPort() { + java.lang.Object ref = port_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + port_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. DEPRECATED! Use network_endpoints instead.
+     * The network port for the TPU Node as visible to Compute Engine instances.
+     * 
+ * + * string port = 14 [deprecated = true]; + * @deprecated google.cloud.tpu.v1.Node.port is deprecated. + * See google/cloud/tpu/v1/cloud_tpu.proto;l=279 + * @return The bytes for port. + */ + @java.lang.Deprecated public com.google.protobuf.ByteString + getPortBytes() { + java.lang.Object ref = port_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + port_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. DEPRECATED! Use network_endpoints instead.
+     * The network port for the TPU Node as visible to Compute Engine instances.
+     * 
+ * + * string port = 14 [deprecated = true]; + * @deprecated google.cloud.tpu.v1.Node.port is deprecated. + * See google/cloud/tpu/v1/cloud_tpu.proto;l=279 + * @param value The port to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setPort( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + port_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. DEPRECATED! Use network_endpoints instead.
+     * The network port for the TPU Node as visible to Compute Engine instances.
+     * 
+ * + * string port = 14 [deprecated = true]; + * @deprecated google.cloud.tpu.v1.Node.port is deprecated. + * See google/cloud/tpu/v1/cloud_tpu.proto;l=279 + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder clearPort() { + + port_ = getDefaultInstance().getPort(); + onChanged(); + return this; + } + /** + *
+     * Output only. DEPRECATED! Use network_endpoints instead.
+     * The network port for the TPU Node as visible to Compute Engine instances.
+     * 
+ * + * string port = 14 [deprecated = true]; + * @deprecated google.cloud.tpu.v1.Node.port is deprecated. + * See google/cloud/tpu/v1/cloud_tpu.proto;l=279 + * @param value The bytes for port to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setPortBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + port_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + *
+     * Output only. The current state for the TPU Node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override public int getStateValue() { + return state_; + } + /** + *
+     * Output only. The current state for the TPU Node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The current state for the TPU Node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The state. + */ + @java.lang.Override + public com.google.cloud.tpu.v1.Node.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v1.Node.State result = com.google.cloud.tpu.v1.Node.State.valueOf(state_); + return result == null ? com.google.cloud.tpu.v1.Node.State.UNRECOGNIZED : result; + } + /** + *
+     * Output only. The current state for the TPU Node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.tpu.v1.Node.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Output only. The current state for the TPU Node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object healthDescription_ = ""; + /** + *
+     * Output only. If this field is populated, it contains a description of why the TPU Node
+     * is unhealthy.
+     * 
+ * + * string health_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The healthDescription. + */ + public java.lang.String getHealthDescription() { + java.lang.Object ref = healthDescription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + healthDescription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. If this field is populated, it contains a description of why the TPU Node
+     * is unhealthy.
+     * 
+ * + * string health_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for healthDescription. + */ + public com.google.protobuf.ByteString + getHealthDescriptionBytes() { + java.lang.Object ref = healthDescription_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + healthDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. If this field is populated, it contains a description of why the TPU Node
+     * is unhealthy.
+     * 
+ * + * string health_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The healthDescription to set. + * @return This builder for chaining. + */ + public Builder setHealthDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + healthDescription_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. If this field is populated, it contains a description of why the TPU Node
+     * is unhealthy.
+     * 
+ * + * string health_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return This builder for chaining. + */ + public Builder clearHealthDescription() { + + healthDescription_ = getDefaultInstance().getHealthDescription(); + onChanged(); + return this; + } + /** + *
+     * Output only. If this field is populated, it contains a description of why the TPU Node
+     * is unhealthy.
+     * 
+ * + * string health_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The bytes for healthDescription to set. + * @return This builder for chaining. + */ + public Builder setHealthDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + healthDescription_ = value; + onChanged(); + return this; + } + + private java.lang.Object tensorflowVersion_ = ""; + /** + *
+     * Required. The version of Tensorflow running in the Node.
+     * 
+ * + * string tensorflow_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * @return The tensorflowVersion. + */ + public java.lang.String getTensorflowVersion() { + java.lang.Object ref = tensorflowVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tensorflowVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The version of Tensorflow running in the Node.
+     * 
+ * + * string tensorflow_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for tensorflowVersion. + */ + public com.google.protobuf.ByteString + getTensorflowVersionBytes() { + java.lang.Object ref = tensorflowVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tensorflowVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The version of Tensorflow running in the Node.
+     * 
+ * + * string tensorflow_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * @param value The tensorflowVersion to set. + * @return This builder for chaining. + */ + public Builder setTensorflowVersion( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + tensorflowVersion_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The version of Tensorflow running in the Node.
+     * 
+ * + * string tensorflow_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * @return This builder for chaining. + */ + public Builder clearTensorflowVersion() { + + tensorflowVersion_ = getDefaultInstance().getTensorflowVersion(); + onChanged(); + return this; + } + /** + *
+     * Required. The version of Tensorflow running in the Node.
+     * 
+ * + * string tensorflow_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * @param value The bytes for tensorflowVersion to set. + * @return This builder for chaining. + */ + public Builder setTensorflowVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + tensorflowVersion_ = value; + onChanged(); + return this; + } + + private java.lang.Object network_ = ""; + /** + *
+     * The name of a network they wish to peer the TPU node to. It must be a
+     * preexisting Compute Engine network inside of the project on which this API
+     * has been activated. If none is provided, "default" will be used.
+     * 
+ * + * string network = 12; + * @return The network. + */ + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of a network they wish to peer the TPU node to. It must be a
+     * preexisting Compute Engine network inside of the project on which this API
+     * has been activated. If none is provided, "default" will be used.
+     * 
+ * + * string network = 12; + * @return The bytes for network. + */ + public com.google.protobuf.ByteString + getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of a network they wish to peer the TPU node to. It must be a
+     * preexisting Compute Engine network inside of the project on which this API
+     * has been activated. If none is provided, "default" will be used.
+     * 
+ * + * string network = 12; + * @param value The network to set. + * @return This builder for chaining. + */ + public Builder setNetwork( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + network_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of a network they wish to peer the TPU node to. It must be a
+     * preexisting Compute Engine network inside of the project on which this API
+     * has been activated. If none is provided, "default" will be used.
+     * 
+ * + * string network = 12; + * @return This builder for chaining. + */ + public Builder clearNetwork() { + + network_ = getDefaultInstance().getNetwork(); + onChanged(); + return this; + } + /** + *
+     * The name of a network they wish to peer the TPU node to. It must be a
+     * preexisting Compute Engine network inside of the project on which this API
+     * has been activated. If none is provided, "default" will be used.
+     * 
+ * + * string network = 12; + * @param value The bytes for network to set. + * @return This builder for chaining. + */ + public Builder setNetworkBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + network_ = value; + onChanged(); + return this; + } + + private java.lang.Object cidrBlock_ = ""; + /** + *
+     * The CIDR block that the TPU node will use when selecting an IP address.
+     * This CIDR block must be a /29 block; the Compute Engine networks API
+     * forbids a smaller block, and using a larger block would be wasteful (a
+     * node can only consume one IP address). Errors will occur if the CIDR block
+     * has already been used for a currently existing TPU node, the CIDR block
+     * conflicts with any subnetworks in the user's provided network, or the
+     * provided network is peered with another network that is using that CIDR
+     * block.
+     * 
+ * + * string cidr_block = 13; + * @return The cidrBlock. + */ + public java.lang.String getCidrBlock() { + java.lang.Object ref = cidrBlock_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cidrBlock_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The CIDR block that the TPU node will use when selecting an IP address.
+     * This CIDR block must be a /29 block; the Compute Engine networks API
+     * forbids a smaller block, and using a larger block would be wasteful (a
+     * node can only consume one IP address). Errors will occur if the CIDR block
+     * has already been used for a currently existing TPU node, the CIDR block
+     * conflicts with any subnetworks in the user's provided network, or the
+     * provided network is peered with another network that is using that CIDR
+     * block.
+     * 
+ * + * string cidr_block = 13; + * @return The bytes for cidrBlock. + */ + public com.google.protobuf.ByteString + getCidrBlockBytes() { + java.lang.Object ref = cidrBlock_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cidrBlock_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The CIDR block that the TPU node will use when selecting an IP address.
+     * This CIDR block must be a /29 block; the Compute Engine networks API
+     * forbids a smaller block, and using a larger block would be wasteful (a
+     * node can only consume one IP address). Errors will occur if the CIDR block
+     * has already been used for a currently existing TPU node, the CIDR block
+     * conflicts with any subnetworks in the user's provided network, or the
+     * provided network is peered with another network that is using that CIDR
+     * block.
+     * 
+ * + * string cidr_block = 13; + * @param value The cidrBlock to set. + * @return This builder for chaining. + */ + public Builder setCidrBlock( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + cidrBlock_ = value; + onChanged(); + return this; + } + /** + *
+     * The CIDR block that the TPU node will use when selecting an IP address.
+     * This CIDR block must be a /29 block; the Compute Engine networks API
+     * forbids a smaller block, and using a larger block would be wasteful (a
+     * node can only consume one IP address). Errors will occur if the CIDR block
+     * has already been used for a currently existing TPU node, the CIDR block
+     * conflicts with any subnetworks in the user's provided network, or the
+     * provided network is peered with another network that is using that CIDR
+     * block.
+     * 
+ * + * string cidr_block = 13; + * @return This builder for chaining. + */ + public Builder clearCidrBlock() { + + cidrBlock_ = getDefaultInstance().getCidrBlock(); + onChanged(); + return this; + } + /** + *
+     * The CIDR block that the TPU node will use when selecting an IP address.
+     * This CIDR block must be a /29 block; the Compute Engine networks API
+     * forbids a smaller block, and using a larger block would be wasteful (a
+     * node can only consume one IP address). Errors will occur if the CIDR block
+     * has already been used for a currently existing TPU node, the CIDR block
+     * conflicts with any subnetworks in the user's provided network, or the
+     * provided network is peered with another network that is using that CIDR
+     * block.
+     * 
+ * + * string cidr_block = 13; + * @param value The bytes for cidrBlock to set. + * @return This builder for chaining. + */ + public Builder setCidrBlockBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + cidrBlock_ = value; + onChanged(); + return this; + } + + private java.lang.Object serviceAccount_ = ""; + /** + *
+     * Output only. The service account used to run the tensor flow services within the node.
+     * To share resources, including Google Cloud Storage data, with the
+     * Tensorflow job running in the Node, this account must have permissions to
+     * that data.
+     * 
+ * + * string service_account = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The serviceAccount. + */ + public java.lang.String getServiceAccount() { + java.lang.Object ref = serviceAccount_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccount_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. The service account used to run the tensor flow services within the node.
+     * To share resources, including Google Cloud Storage data, with the
+     * Tensorflow job running in the Node, this account must have permissions to
+     * that data.
+     * 
+ * + * string service_account = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for serviceAccount. + */ + public com.google.protobuf.ByteString + getServiceAccountBytes() { + java.lang.Object ref = serviceAccount_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + serviceAccount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. The service account used to run the tensor flow services within the node.
+     * To share resources, including Google Cloud Storage data, with the
+     * Tensorflow job running in the Node, this account must have permissions to
+     * that data.
+     * 
+ * + * string service_account = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The serviceAccount to set. + * @return This builder for chaining. + */ + public Builder setServiceAccount( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceAccount_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The service account used to run the tensor flow services within the node.
+     * To share resources, including Google Cloud Storage data, with the
+     * Tensorflow job running in the Node, this account must have permissions to
+     * that data.
+     * 
+ * + * string service_account = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return This builder for chaining. + */ + public Builder clearServiceAccount() { + + serviceAccount_ = getDefaultInstance().getServiceAccount(); + onChanged(); + return this; + } + /** + *
+     * Output only. The service account used to run the tensor flow services within the node.
+     * To share resources, including Google Cloud Storage data, with the
+     * Tensorflow job running in the Node, this account must have permissions to
+     * that data.
+     * 
+ * + * string service_account = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The bytes for serviceAccount to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceAccount_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_; + /** + *
+     * Output only. The time when the node was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + *
+     * Output only. The time when the node was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + *
+     * Output only. The time when the node was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Output only. The time when the node was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder setCreateTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Output only. The time when the node was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Output only. The time when the node was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Output only. The time when the node was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Output only. The time when the node was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + } + /** + *
+     * Output only. The time when the node was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), + getParentForChildren(), + isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.cloud.tpu.v1.SchedulingConfig schedulingConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v1.SchedulingConfig, com.google.cloud.tpu.v1.SchedulingConfig.Builder, com.google.cloud.tpu.v1.SchedulingConfigOrBuilder> schedulingConfigBuilder_; + /** + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + * @return Whether the schedulingConfig field is set. + */ + public boolean hasSchedulingConfig() { + return schedulingConfigBuilder_ != null || schedulingConfig_ != null; + } + /** + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + * @return The schedulingConfig. + */ + public com.google.cloud.tpu.v1.SchedulingConfig getSchedulingConfig() { + if (schedulingConfigBuilder_ == null) { + return schedulingConfig_ == null ? com.google.cloud.tpu.v1.SchedulingConfig.getDefaultInstance() : schedulingConfig_; + } else { + return schedulingConfigBuilder_.getMessage(); + } + } + /** + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + */ + public Builder setSchedulingConfig(com.google.cloud.tpu.v1.SchedulingConfig value) { + if (schedulingConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + schedulingConfig_ = value; + onChanged(); + } else { + schedulingConfigBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + */ + public Builder setSchedulingConfig( + com.google.cloud.tpu.v1.SchedulingConfig.Builder builderForValue) { + if (schedulingConfigBuilder_ == null) { + schedulingConfig_ = builderForValue.build(); + onChanged(); + } else { + schedulingConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + */ + public Builder mergeSchedulingConfig(com.google.cloud.tpu.v1.SchedulingConfig value) { + if (schedulingConfigBuilder_ == null) { + if (schedulingConfig_ != null) { + schedulingConfig_ = + com.google.cloud.tpu.v1.SchedulingConfig.newBuilder(schedulingConfig_).mergeFrom(value).buildPartial(); + } else { + schedulingConfig_ = value; + } + onChanged(); + } else { + schedulingConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + */ + public Builder clearSchedulingConfig() { + if (schedulingConfigBuilder_ == null) { + schedulingConfig_ = null; + onChanged(); + } else { + schedulingConfig_ = null; + schedulingConfigBuilder_ = null; + } + + return this; + } + /** + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + */ + public com.google.cloud.tpu.v1.SchedulingConfig.Builder getSchedulingConfigBuilder() { + + onChanged(); + return getSchedulingConfigFieldBuilder().getBuilder(); + } + /** + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + */ + public com.google.cloud.tpu.v1.SchedulingConfigOrBuilder getSchedulingConfigOrBuilder() { + if (schedulingConfigBuilder_ != null) { + return schedulingConfigBuilder_.getMessageOrBuilder(); + } else { + return schedulingConfig_ == null ? + com.google.cloud.tpu.v1.SchedulingConfig.getDefaultInstance() : schedulingConfig_; + } + } + /** + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v1.SchedulingConfig, com.google.cloud.tpu.v1.SchedulingConfig.Builder, com.google.cloud.tpu.v1.SchedulingConfigOrBuilder> + getSchedulingConfigFieldBuilder() { + if (schedulingConfigBuilder_ == null) { + schedulingConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v1.SchedulingConfig, com.google.cloud.tpu.v1.SchedulingConfig.Builder, com.google.cloud.tpu.v1.SchedulingConfigOrBuilder>( + getSchedulingConfig(), + getParentForChildren(), + isClean()); + schedulingConfig_ = null; + } + return schedulingConfigBuilder_; + } + + private java.util.List networkEndpoints_ = + java.util.Collections.emptyList(); + private void ensureNetworkEndpointsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + networkEndpoints_ = new java.util.ArrayList(networkEndpoints_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.NetworkEndpoint, com.google.cloud.tpu.v1.NetworkEndpoint.Builder, com.google.cloud.tpu.v1.NetworkEndpointOrBuilder> networkEndpointsBuilder_; + + /** + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public java.util.List getNetworkEndpointsList() { + if (networkEndpointsBuilder_ == null) { + return java.util.Collections.unmodifiableList(networkEndpoints_); + } else { + return networkEndpointsBuilder_.getMessageList(); + } + } + /** + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public int getNetworkEndpointsCount() { + if (networkEndpointsBuilder_ == null) { + return networkEndpoints_.size(); + } else { + return networkEndpointsBuilder_.getCount(); + } + } + /** + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.cloud.tpu.v1.NetworkEndpoint getNetworkEndpoints(int index) { + if (networkEndpointsBuilder_ == null) { + return networkEndpoints_.get(index); + } else { + return networkEndpointsBuilder_.getMessage(index); + } + } + /** + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder setNetworkEndpoints( + int index, com.google.cloud.tpu.v1.NetworkEndpoint value) { + if (networkEndpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNetworkEndpointsIsMutable(); + networkEndpoints_.set(index, value); + onChanged(); + } else { + networkEndpointsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder setNetworkEndpoints( + int index, com.google.cloud.tpu.v1.NetworkEndpoint.Builder builderForValue) { + if (networkEndpointsBuilder_ == null) { + ensureNetworkEndpointsIsMutable(); + networkEndpoints_.set(index, builderForValue.build()); + onChanged(); + } else { + networkEndpointsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder addNetworkEndpoints(com.google.cloud.tpu.v1.NetworkEndpoint value) { + if (networkEndpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNetworkEndpointsIsMutable(); + networkEndpoints_.add(value); + onChanged(); + } else { + networkEndpointsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder addNetworkEndpoints( + int index, com.google.cloud.tpu.v1.NetworkEndpoint value) { + if (networkEndpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNetworkEndpointsIsMutable(); + networkEndpoints_.add(index, value); + onChanged(); + } else { + networkEndpointsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder addNetworkEndpoints( + com.google.cloud.tpu.v1.NetworkEndpoint.Builder builderForValue) { + if (networkEndpointsBuilder_ == null) { + ensureNetworkEndpointsIsMutable(); + networkEndpoints_.add(builderForValue.build()); + onChanged(); + } else { + networkEndpointsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder addNetworkEndpoints( + int index, com.google.cloud.tpu.v1.NetworkEndpoint.Builder builderForValue) { + if (networkEndpointsBuilder_ == null) { + ensureNetworkEndpointsIsMutable(); + networkEndpoints_.add(index, builderForValue.build()); + onChanged(); + } else { + networkEndpointsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder addAllNetworkEndpoints( + java.lang.Iterable values) { + if (networkEndpointsBuilder_ == null) { + ensureNetworkEndpointsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, networkEndpoints_); + onChanged(); + } else { + networkEndpointsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder clearNetworkEndpoints() { + if (networkEndpointsBuilder_ == null) { + networkEndpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + networkEndpointsBuilder_.clear(); + } + return this; + } + /** + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder removeNetworkEndpoints(int index) { + if (networkEndpointsBuilder_ == null) { + ensureNetworkEndpointsIsMutable(); + networkEndpoints_.remove(index); + onChanged(); + } else { + networkEndpointsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.cloud.tpu.v1.NetworkEndpoint.Builder getNetworkEndpointsBuilder( + int index) { + return getNetworkEndpointsFieldBuilder().getBuilder(index); + } + /** + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.cloud.tpu.v1.NetworkEndpointOrBuilder getNetworkEndpointsOrBuilder( + int index) { + if (networkEndpointsBuilder_ == null) { + return networkEndpoints_.get(index); } else { + return networkEndpointsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public java.util.List + getNetworkEndpointsOrBuilderList() { + if (networkEndpointsBuilder_ != null) { + return networkEndpointsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(networkEndpoints_); + } + } + /** + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.cloud.tpu.v1.NetworkEndpoint.Builder addNetworkEndpointsBuilder() { + return getNetworkEndpointsFieldBuilder().addBuilder( + com.google.cloud.tpu.v1.NetworkEndpoint.getDefaultInstance()); + } + /** + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.cloud.tpu.v1.NetworkEndpoint.Builder addNetworkEndpointsBuilder( + int index) { + return getNetworkEndpointsFieldBuilder().addBuilder( + index, com.google.cloud.tpu.v1.NetworkEndpoint.getDefaultInstance()); + } + /** + *
+     * Output only. The network endpoints where TPU workers can be accessed and
+     * sent work. It is recommended that Tensorflow clients of the node reach out
+     * to the 0th entry in this map first.
+     * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public java.util.List + getNetworkEndpointsBuilderList() { + return getNetworkEndpointsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.NetworkEndpoint, com.google.cloud.tpu.v1.NetworkEndpoint.Builder, com.google.cloud.tpu.v1.NetworkEndpointOrBuilder> + getNetworkEndpointsFieldBuilder() { + if (networkEndpointsBuilder_ == null) { + networkEndpointsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.NetworkEndpoint, com.google.cloud.tpu.v1.NetworkEndpoint.Builder, com.google.cloud.tpu.v1.NetworkEndpointOrBuilder>( + networkEndpoints_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + networkEndpoints_ = null; + } + return networkEndpointsBuilder_; + } + + private int health_ = 0; + /** + *
+     * The health status of the TPU node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.Health health = 22; + * @return The enum numeric value on the wire for health. + */ + @java.lang.Override public int getHealthValue() { + return health_; + } + /** + *
+     * The health status of the TPU node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.Health health = 22; + * @param value The enum numeric value on the wire for health to set. + * @return This builder for chaining. + */ + public Builder setHealthValue(int value) { + + health_ = value; + onChanged(); + return this; + } + /** + *
+     * The health status of the TPU node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.Health health = 22; + * @return The health. + */ + @java.lang.Override + public com.google.cloud.tpu.v1.Node.Health getHealth() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v1.Node.Health result = com.google.cloud.tpu.v1.Node.Health.valueOf(health_); + return result == null ? com.google.cloud.tpu.v1.Node.Health.UNRECOGNIZED : result; + } + /** + *
+     * The health status of the TPU node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.Health health = 22; + * @param value The health to set. + * @return This builder for chaining. + */ + public Builder setHealth(com.google.cloud.tpu.v1.Node.Health value) { + if (value == null) { + throw new NullPointerException(); + } + + health_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The health status of the TPU node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.Health health = 22; + * @return This builder for chaining. + */ + public Builder clearHealth() { + + health_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> 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 NullPointerException("map key"); } + return internalGetLabels().getMap().containsKey(key); + } + /** + * Use {@link #getLabelsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + *
+     * 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 NullPointerException("map key"); } + 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 NullPointerException("map key"); } + java.util.Map map = + internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap() + .clear(); + return this; + } + /** + *
+     * Resource labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 24; + */ + + public Builder removeLabels( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableLabels().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + *
+     * 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 NullPointerException("map key"); } + if (value == null) { + throw new NullPointerException("map value"); +} + + internalGetMutableLabels().getMutableMap() + .put(key, value); + return this; + } + /** + *
+     * Resource labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 24; + */ + + public Builder putAllLabels( + java.util.Map values) { + internalGetMutableLabels().getMutableMap() + .putAll(values); + return this; + } + + private boolean useServiceNetworking_ ; + /** + *
+     * Whether the VPC peering for the node is set up through Service Networking
+     * API. The VPC Peering should be set up before provisioning the node.
+     * If this field is set, cidr_block field should not be specified. If the
+     * network, that you want to peer the TPU Node to, is Shared VPC networks,
+     * the node must be created with this this field enabled.
+     * 
+ * + * bool use_service_networking = 27; + * @return The useServiceNetworking. + */ + @java.lang.Override + public boolean getUseServiceNetworking() { + return useServiceNetworking_; + } + /** + *
+     * Whether the VPC peering for the node is set up through Service Networking
+     * API. The VPC Peering should be set up before provisioning the node.
+     * If this field is set, cidr_block field should not be specified. If the
+     * network, that you want to peer the TPU Node to, is Shared VPC networks,
+     * the node must be created with this this field enabled.
+     * 
+ * + * bool use_service_networking = 27; + * @param value The useServiceNetworking to set. + * @return This builder for chaining. + */ + public Builder setUseServiceNetworking(boolean value) { + + useServiceNetworking_ = value; + onChanged(); + return this; + } + /** + *
+     * Whether the VPC peering for the node is set up through Service Networking
+     * API. The VPC Peering should be set up before provisioning the node.
+     * If this field is set, cidr_block field should not be specified. If the
+     * network, that you want to peer the TPU Node to, is Shared VPC networks,
+     * the node must be created with this this field enabled.
+     * 
+ * + * bool use_service_networking = 27; + * @return This builder for chaining. + */ + public Builder clearUseServiceNetworking() { + + useServiceNetworking_ = false; + onChanged(); + return this; + } + + private int apiVersion_ = 0; + /** + *
+     * Output only. The API version that created this Node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The enum numeric value on the wire for apiVersion. + */ + @java.lang.Override public int getApiVersionValue() { + return apiVersion_; + } + /** + *
+     * Output only. The API version that created this Node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The enum numeric value on the wire for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionValue(int value) { + + apiVersion_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The API version that created this Node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The apiVersion. + */ + @java.lang.Override + public com.google.cloud.tpu.v1.Node.ApiVersion getApiVersion() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v1.Node.ApiVersion result = com.google.cloud.tpu.v1.Node.ApiVersion.valueOf(apiVersion_); + return result == null ? com.google.cloud.tpu.v1.Node.ApiVersion.UNRECOGNIZED : result; + } + /** + *
+     * Output only. The API version that created this Node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(com.google.cloud.tpu.v1.Node.ApiVersion value) { + if (value == null) { + throw new NullPointerException(); + } + + apiVersion_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Output only. The API version that created this Node.
+     * 
+ * + * .google.cloud.tpu.v1.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + + apiVersion_ = 0; + onChanged(); + return this; + } + + private java.util.List symptoms_ = + java.util.Collections.emptyList(); + private void ensureSymptomsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + symptoms_ = new java.util.ArrayList(symptoms_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.Symptom, com.google.cloud.tpu.v1.Symptom.Builder, com.google.cloud.tpu.v1.SymptomOrBuilder> symptomsBuilder_; + + /** + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public java.util.List getSymptomsList() { + if (symptomsBuilder_ == null) { + return java.util.Collections.unmodifiableList(symptoms_); + } else { + return symptomsBuilder_.getMessageList(); + } + } + /** + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public int getSymptomsCount() { + if (symptomsBuilder_ == null) { + return symptoms_.size(); + } else { + return symptomsBuilder_.getCount(); + } + } + /** + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.cloud.tpu.v1.Symptom getSymptoms(int index) { + if (symptomsBuilder_ == null) { + return symptoms_.get(index); + } else { + return symptomsBuilder_.getMessage(index); + } + } + /** + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder setSymptoms( + int index, com.google.cloud.tpu.v1.Symptom value) { + if (symptomsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSymptomsIsMutable(); + symptoms_.set(index, value); + onChanged(); + } else { + symptomsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder setSymptoms( + int index, com.google.cloud.tpu.v1.Symptom.Builder builderForValue) { + if (symptomsBuilder_ == null) { + ensureSymptomsIsMutable(); + symptoms_.set(index, builderForValue.build()); + onChanged(); + } else { + symptomsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder addSymptoms(com.google.cloud.tpu.v1.Symptom value) { + if (symptomsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSymptomsIsMutable(); + symptoms_.add(value); + onChanged(); + } else { + symptomsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder addSymptoms( + int index, com.google.cloud.tpu.v1.Symptom value) { + if (symptomsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSymptomsIsMutable(); + symptoms_.add(index, value); + onChanged(); + } else { + symptomsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder addSymptoms( + com.google.cloud.tpu.v1.Symptom.Builder builderForValue) { + if (symptomsBuilder_ == null) { + ensureSymptomsIsMutable(); + symptoms_.add(builderForValue.build()); + onChanged(); + } else { + symptomsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder addSymptoms( + int index, com.google.cloud.tpu.v1.Symptom.Builder builderForValue) { + if (symptomsBuilder_ == null) { + ensureSymptomsIsMutable(); + symptoms_.add(index, builderForValue.build()); + onChanged(); + } else { + symptomsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder addAllSymptoms( + java.lang.Iterable values) { + if (symptomsBuilder_ == null) { + ensureSymptomsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, symptoms_); + onChanged(); + } else { + symptomsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder clearSymptoms() { + if (symptomsBuilder_ == null) { + symptoms_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + symptomsBuilder_.clear(); + } + return this; + } + /** + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder removeSymptoms(int index) { + if (symptomsBuilder_ == null) { + ensureSymptomsIsMutable(); + symptoms_.remove(index); + onChanged(); + } else { + symptomsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.cloud.tpu.v1.Symptom.Builder getSymptomsBuilder( + int index) { + return getSymptomsFieldBuilder().getBuilder(index); + } + /** + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.cloud.tpu.v1.SymptomOrBuilder getSymptomsOrBuilder( + int index) { + if (symptomsBuilder_ == null) { + return symptoms_.get(index); } else { + return symptomsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public java.util.List + getSymptomsOrBuilderList() { + if (symptomsBuilder_ != null) { + return symptomsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(symptoms_); + } + } + /** + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.cloud.tpu.v1.Symptom.Builder addSymptomsBuilder() { + return getSymptomsFieldBuilder().addBuilder( + com.google.cloud.tpu.v1.Symptom.getDefaultInstance()); + } + /** + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.cloud.tpu.v1.Symptom.Builder addSymptomsBuilder( + int index) { + return getSymptomsFieldBuilder().addBuilder( + index, com.google.cloud.tpu.v1.Symptom.getDefaultInstance()); + } + /** + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public java.util.List + getSymptomsBuilderList() { + return getSymptomsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.Symptom, com.google.cloud.tpu.v1.Symptom.Builder, com.google.cloud.tpu.v1.SymptomOrBuilder> + getSymptomsFieldBuilder() { + if (symptomsBuilder_ == null) { + symptomsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v1.Symptom, com.google.cloud.tpu.v1.Symptom.Builder, com.google.cloud.tpu.v1.SymptomOrBuilder>( + symptoms_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + symptoms_ = null; + } + return symptomsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.Node) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.Node) + private static final com.google.cloud.tpu.v1.Node DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.Node(); + } + + public static com.google.cloud.tpu.v1.Node getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Node parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Node(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.Node getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NodeName.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NodeName.java new file mode 100644 index 000000000000..4a182e58c95c --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NodeName.java @@ -0,0 +1,217 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class NodeName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_NODE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}/nodes/{node}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String node; + + @Deprecated + protected NodeName() { + project = null; + location = null; + node = null; + } + + private NodeName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + node = Preconditions.checkNotNull(builder.getNode()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getNode() { + return node; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static NodeName of(String project, String location, String node) { + return newBuilder().setProject(project).setLocation(location).setNode(node).build(); + } + + public static String format(String project, String location, String node) { + return newBuilder().setProject(project).setLocation(location).setNode(node).build().toString(); + } + + public static NodeName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_NODE.validatedMatch( + formattedString, "NodeName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("node")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (NodeName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_NODE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (node != null) { + fieldMapBuilder.put("node", node); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_NODE.instantiate( + "project", project, "location", location, "node", node); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + NodeName that = ((NodeName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.node, that.node); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(node); + return h; + } + + /** Builder for projects/{project}/locations/{location}/nodes/{node}. */ + public static class Builder { + private String project; + private String location; + private String node; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getNode() { + return node; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setNode(String node) { + this.node = node; + return this; + } + + private Builder(NodeName nodeName) { + this.project = nodeName.project; + this.location = nodeName.location; + this.node = nodeName.node; + } + + public NodeName build() { + return new NodeName(this); + } + } +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NodeOrBuilder.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NodeOrBuilder.java new file mode 100644 index 000000000000..7bca19d16a1b --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/NodeOrBuilder.java @@ -0,0 +1,528 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface NodeOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.Node) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Output only. Immutable. The name of the TPU
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * Output only. Immutable. The name of the TPU
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * The user-supplied description of the TPU. Maximum of 512 characters.
+   * 
+ * + * string description = 3; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
+   * The user-supplied description of the TPU. Maximum of 512 characters.
+   * 
+ * + * string description = 3; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+   * Required. The type of hardware accelerators associated with this node.
+   * 
+ * + * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return The acceleratorType. + */ + java.lang.String getAcceleratorType(); + /** + *
+   * Required. The type of hardware accelerators associated with this node.
+   * 
+ * + * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for acceleratorType. + */ + com.google.protobuf.ByteString + getAcceleratorTypeBytes(); + + /** + *
+   * Output only. DEPRECATED! Use network_endpoints instead.
+   * The network address for the TPU Node as visible to Compute Engine
+   * instances.
+   * 
+ * + * string ip_address = 8 [deprecated = true]; + * @deprecated google.cloud.tpu.v1.Node.ip_address is deprecated. + * See google/cloud/tpu/v1/cloud_tpu.proto;l=275 + * @return The ipAddress. + */ + @java.lang.Deprecated java.lang.String getIpAddress(); + /** + *
+   * Output only. DEPRECATED! Use network_endpoints instead.
+   * The network address for the TPU Node as visible to Compute Engine
+   * instances.
+   * 
+ * + * string ip_address = 8 [deprecated = true]; + * @deprecated google.cloud.tpu.v1.Node.ip_address is deprecated. + * See google/cloud/tpu/v1/cloud_tpu.proto;l=275 + * @return The bytes for ipAddress. + */ + @java.lang.Deprecated com.google.protobuf.ByteString + getIpAddressBytes(); + + /** + *
+   * Output only. DEPRECATED! Use network_endpoints instead.
+   * The network port for the TPU Node as visible to Compute Engine instances.
+   * 
+ * + * string port = 14 [deprecated = true]; + * @deprecated google.cloud.tpu.v1.Node.port is deprecated. + * See google/cloud/tpu/v1/cloud_tpu.proto;l=279 + * @return The port. + */ + @java.lang.Deprecated java.lang.String getPort(); + /** + *
+   * Output only. DEPRECATED! Use network_endpoints instead.
+   * The network port for the TPU Node as visible to Compute Engine instances.
+   * 
+ * + * string port = 14 [deprecated = true]; + * @deprecated google.cloud.tpu.v1.Node.port is deprecated. + * See google/cloud/tpu/v1/cloud_tpu.proto;l=279 + * @return The bytes for port. + */ + @java.lang.Deprecated com.google.protobuf.ByteString + getPortBytes(); + + /** + *
+   * Output only. The current state for the TPU Node.
+   * 
+ * + * .google.cloud.tpu.v1.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + *
+   * Output only. The current state for the TPU Node.
+   * 
+ * + * .google.cloud.tpu.v1.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The state. + */ + com.google.cloud.tpu.v1.Node.State getState(); + + /** + *
+   * Output only. If this field is populated, it contains a description of why the TPU Node
+   * is unhealthy.
+   * 
+ * + * string health_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The healthDescription. + */ + java.lang.String getHealthDescription(); + /** + *
+   * Output only. If this field is populated, it contains a description of why the TPU Node
+   * is unhealthy.
+   * 
+ * + * string health_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for healthDescription. + */ + com.google.protobuf.ByteString + getHealthDescriptionBytes(); + + /** + *
+   * Required. The version of Tensorflow running in the Node.
+   * 
+ * + * string tensorflow_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * @return The tensorflowVersion. + */ + java.lang.String getTensorflowVersion(); + /** + *
+   * Required. The version of Tensorflow running in the Node.
+   * 
+ * + * string tensorflow_version = 11 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for tensorflowVersion. + */ + com.google.protobuf.ByteString + getTensorflowVersionBytes(); + + /** + *
+   * The name of a network they wish to peer the TPU node to. It must be a
+   * preexisting Compute Engine network inside of the project on which this API
+   * has been activated. If none is provided, "default" will be used.
+   * 
+ * + * string network = 12; + * @return The network. + */ + java.lang.String getNetwork(); + /** + *
+   * The name of a network they wish to peer the TPU node to. It must be a
+   * preexisting Compute Engine network inside of the project on which this API
+   * has been activated. If none is provided, "default" will be used.
+   * 
+ * + * string network = 12; + * @return The bytes for network. + */ + com.google.protobuf.ByteString + getNetworkBytes(); + + /** + *
+   * The CIDR block that the TPU node will use when selecting an IP address.
+   * This CIDR block must be a /29 block; the Compute Engine networks API
+   * forbids a smaller block, and using a larger block would be wasteful (a
+   * node can only consume one IP address). Errors will occur if the CIDR block
+   * has already been used for a currently existing TPU node, the CIDR block
+   * conflicts with any subnetworks in the user's provided network, or the
+   * provided network is peered with another network that is using that CIDR
+   * block.
+   * 
+ * + * string cidr_block = 13; + * @return The cidrBlock. + */ + java.lang.String getCidrBlock(); + /** + *
+   * The CIDR block that the TPU node will use when selecting an IP address.
+   * This CIDR block must be a /29 block; the Compute Engine networks API
+   * forbids a smaller block, and using a larger block would be wasteful (a
+   * node can only consume one IP address). Errors will occur if the CIDR block
+   * has already been used for a currently existing TPU node, the CIDR block
+   * conflicts with any subnetworks in the user's provided network, or the
+   * provided network is peered with another network that is using that CIDR
+   * block.
+   * 
+ * + * string cidr_block = 13; + * @return The bytes for cidrBlock. + */ + com.google.protobuf.ByteString + getCidrBlockBytes(); + + /** + *
+   * Output only. The service account used to run the tensor flow services within the node.
+   * To share resources, including Google Cloud Storage data, with the
+   * Tensorflow job running in the Node, this account must have permissions to
+   * that data.
+   * 
+ * + * string service_account = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The serviceAccount. + */ + java.lang.String getServiceAccount(); + /** + *
+   * Output only. The service account used to run the tensor flow services within the node.
+   * To share resources, including Google Cloud Storage data, with the
+   * Tensorflow job running in the Node, this account must have permissions to
+   * that data.
+   * 
+ * + * string service_account = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for serviceAccount. + */ + com.google.protobuf.ByteString + getServiceAccountBytes(); + + /** + *
+   * Output only. The time when the node was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + *
+   * Output only. The time when the node was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + *
+   * Output only. The time when the node was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + *
+   * The scheduling options for this node.
+   * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + * @return Whether the schedulingConfig field is set. + */ + boolean hasSchedulingConfig(); + /** + *
+   * The scheduling options for this node.
+   * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + * @return The schedulingConfig. + */ + com.google.cloud.tpu.v1.SchedulingConfig getSchedulingConfig(); + /** + *
+   * The scheduling options for this node.
+   * 
+ * + * .google.cloud.tpu.v1.SchedulingConfig scheduling_config = 17; + */ + com.google.cloud.tpu.v1.SchedulingConfigOrBuilder getSchedulingConfigOrBuilder(); + + /** + *
+   * Output only. The network endpoints where TPU workers can be accessed and
+   * sent work. It is recommended that Tensorflow clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + java.util.List + getNetworkEndpointsList(); + /** + *
+   * Output only. The network endpoints where TPU workers can be accessed and
+   * sent work. It is recommended that Tensorflow clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + com.google.cloud.tpu.v1.NetworkEndpoint getNetworkEndpoints(int index); + /** + *
+   * Output only. The network endpoints where TPU workers can be accessed and
+   * sent work. It is recommended that Tensorflow clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + int getNetworkEndpointsCount(); + /** + *
+   * Output only. The network endpoints where TPU workers can be accessed and
+   * sent work. It is recommended that Tensorflow clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + java.util.List + getNetworkEndpointsOrBuilderList(); + /** + *
+   * Output only. The network endpoints where TPU workers can be accessed and
+   * sent work. It is recommended that Tensorflow clients of the node reach out
+   * to the 0th entry in this map first.
+   * 
+ * + * repeated .google.cloud.tpu.v1.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + com.google.cloud.tpu.v1.NetworkEndpointOrBuilder getNetworkEndpointsOrBuilder( + int index); + + /** + *
+   * The health status of the TPU node.
+   * 
+ * + * .google.cloud.tpu.v1.Node.Health health = 22; + * @return The enum numeric value on the wire for health. + */ + int getHealthValue(); + /** + *
+   * The health status of the TPU node.
+   * 
+ * + * .google.cloud.tpu.v1.Node.Health health = 22; + * @return The health. + */ + com.google.cloud.tpu.v1.Node.Health getHealth(); + + /** + *
+   * Resource labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 24; + */ + int getLabelsCount(); + /** + *
+   * Resource labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 24; + */ + boolean containsLabels( + java.lang.String key); + /** + * Use {@link #getLabelsMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getLabels(); + /** + *
+   * Resource labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 24; + */ + java.util.Map + getLabelsMap(); + /** + *
+   * Resource labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 24; + */ + + /* nullable */ +java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue); + /** + *
+   * Resource labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 24; + */ + + java.lang.String getLabelsOrThrow( + java.lang.String key); + + /** + *
+   * Whether the VPC peering for the node is set up through Service Networking
+   * API. The VPC Peering should be set up before provisioning the node.
+   * If this field is set, cidr_block field should not be specified. If the
+   * network, that you want to peer the TPU Node to, is Shared VPC networks,
+   * the node must be created with this this field enabled.
+   * 
+ * + * bool use_service_networking = 27; + * @return The useServiceNetworking. + */ + boolean getUseServiceNetworking(); + + /** + *
+   * Output only. The API version that created this Node.
+   * 
+ * + * .google.cloud.tpu.v1.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The enum numeric value on the wire for apiVersion. + */ + int getApiVersionValue(); + /** + *
+   * Output only. The API version that created this Node.
+   * 
+ * + * .google.cloud.tpu.v1.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The apiVersion. + */ + com.google.cloud.tpu.v1.Node.ApiVersion getApiVersion(); + + /** + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + java.util.List + getSymptomsList(); + /** + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + com.google.cloud.tpu.v1.Symptom getSymptoms(int index); + /** + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + int getSymptomsCount(); + /** + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + java.util.List + getSymptomsOrBuilderList(); + /** + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * repeated .google.cloud.tpu.v1.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + com.google.cloud.tpu.v1.SymptomOrBuilder getSymptomsOrBuilder( + int index); +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/OperationMetadata.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/OperationMetadata.java new file mode 100644 index 000000000000..83d81e40d712 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/OperationMetadata.java @@ -0,0 +1,1653 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + *
+ * Metadata describing an [Operation][google.longrunning.Operation]
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.OperationMetadata} + */ +public final class OperationMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.OperationMetadata) + OperationMetadataOrBuilder { +private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusDetail_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private OperationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + target_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + verb_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + statusDetail_ = s; + break; + } + case 48: { + + cancelRequested_ = input.readBool(); + break; + } + case 58: { + java.lang.String s = input.readStringRequireUtf8(); + + apiVersion_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.OperationMetadata.class, com.google.cloud.tpu.v1.OperationMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int TARGET_FIELD_NUMBER = 3; + private volatile java.lang.Object target_; + /** + *
+   * Target of the operation - for example
+   * projects/project-1/connectivityTests/test-1
+   * 
+ * + * string target = 3; + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } + } + /** + *
+   * Target of the operation - for example
+   * projects/project-1/connectivityTests/test-1
+   * 
+ * + * string target = 3; + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + private volatile java.lang.Object verb_; + /** + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } + } + /** + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_DETAIL_FIELD_NUMBER = 5; + private volatile java.lang.Object statusDetail_; + /** + *
+   * Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5; + * @return The statusDetail. + */ + @java.lang.Override + public java.lang.String getStatusDetail() { + java.lang.Object ref = statusDetail_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusDetail_ = s; + return s; + } + } + /** + *
+   * Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5; + * @return The bytes for statusDetail. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStatusDetailBytes() { + java.lang.Object ref = statusDetail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + statusDetail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CANCEL_REQUESTED_FIELD_NUMBER = 6; + private boolean cancelRequested_; + /** + *
+   * Specifies if cancellation was requested for the operation.
+   * 
+ * + * bool cancel_requested = 6; + * @return The cancelRequested. + */ + @java.lang.Override + public boolean getCancelRequested() { + return cancelRequested_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + private volatile java.lang.Object apiVersion_; + /** + *
+   * API version.
+   * 
+ * + * string api_version = 7; + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } + } + /** + *
+   * API version.
+   * 
+ * + * string api_version = 7; + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (!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.v1.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.OperationMetadata other = (com.google.cloud.tpu.v1.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime() + .equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime() + .equals(other.getEndTime())) return false; + } + if (!getTarget() + .equals(other.getTarget())) return false; + if (!getVerb() + .equals(other.getVerb())) return false; + if (!getStatusDetail() + .equals(other.getStatusDetail())) return false; + if (getCancelRequested() + != other.getCancelRequested()) return false; + if (!getApiVersion() + .equals(other.getApiVersion())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getStatusDetail().hashCode(); + hash = (37 * hash) + CANCEL_REQUESTED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getCancelRequested()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.OperationMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.OperationMetadata parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.OperationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.OperationMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.OperationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.OperationMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.OperationMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.OperationMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.tpu.v1.OperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Metadata describing an [Operation][google.longrunning.Operation]
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.OperationMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.OperationMetadata) + com.google.cloud.tpu.v1.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.OperationMetadata.class, com.google.cloud.tpu.v1.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.OperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + target_ = ""; + + verb_ = ""; + + statusDetail_ = ""; + + cancelRequested_ = false; + + apiVersion_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.OperationMetadata build() { + com.google.cloud.tpu.v1.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.OperationMetadata buildPartial() { + com.google.cloud.tpu.v1.OperationMetadata result = new com.google.cloud.tpu.v1.OperationMetadata(this); + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.target_ = target_; + result.verb_ = verb_; + result.statusDetail_ = statusDetail_; + result.cancelRequested_ = cancelRequested_; + result.apiVersion_ = apiVersion_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.OperationMetadata) { + return mergeFrom((com.google.cloud.tpu.v1.OperationMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.OperationMetadata other) { + if (other == com.google.cloud.tpu.v1.OperationMetadata.getDefaultInstance()) return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + onChanged(); + } + if (!other.getStatusDetail().isEmpty()) { + statusDetail_ = other.statusDetail_; + onChanged(); + } + if (other.getCancelRequested() != false) { + setCancelRequested(other.getCancelRequested()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.OperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.OperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_; + /** + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + } + /** + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), + getParentForChildren(), + isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> endTimeBuilder_; + /** + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getEndTime(), + getParentForChildren(), + isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + /** + *
+     * Target of the operation - for example
+     * projects/project-1/connectivityTests/test-1
+     * 
+ * + * string target = 3; + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Target of the operation - for example
+     * projects/project-1/connectivityTests/test-1
+     * 
+ * + * string target = 3; + * @return The bytes for target. + */ + public com.google.protobuf.ByteString + getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Target of the operation - for example
+     * projects/project-1/connectivityTests/test-1
+     * 
+ * + * string target = 3; + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + target_ = value; + onChanged(); + return this; + } + /** + *
+     * Target of the operation - for example
+     * projects/project-1/connectivityTests/test-1
+     * 
+ * + * string target = 3; + * @return This builder for chaining. + */ + public Builder clearTarget() { + + target_ = getDefaultInstance().getTarget(); + onChanged(); + return this; + } + /** + *
+     * Target of the operation - for example
+     * projects/project-1/connectivityTests/test-1
+     * 
+ * + * string target = 3; + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + target_ = value; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString + getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + verb_ = value; + onChanged(); + return this; + } + /** + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * @return This builder for chaining. + */ + public Builder clearVerb() { + + verb_ = getDefaultInstance().getVerb(); + onChanged(); + return this; + } + /** + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + verb_ = value; + onChanged(); + return this; + } + + private java.lang.Object statusDetail_ = ""; + /** + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * @return The statusDetail. + */ + public java.lang.String getStatusDetail() { + java.lang.Object ref = statusDetail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusDetail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * @return The bytes for statusDetail. + */ + public com.google.protobuf.ByteString + getStatusDetailBytes() { + java.lang.Object ref = statusDetail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + statusDetail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * @param value The statusDetail to set. + * @return This builder for chaining. + */ + public Builder setStatusDetail( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + statusDetail_ = value; + onChanged(); + return this; + } + /** + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * @return This builder for chaining. + */ + public Builder clearStatusDetail() { + + statusDetail_ = getDefaultInstance().getStatusDetail(); + onChanged(); + return this; + } + /** + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * @param value The bytes for statusDetail to set. + * @return This builder for chaining. + */ + public Builder setStatusDetailBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + statusDetail_ = value; + onChanged(); + return this; + } + + private boolean cancelRequested_ ; + /** + *
+     * Specifies if cancellation was requested for the operation.
+     * 
+ * + * bool cancel_requested = 6; + * @return The cancelRequested. + */ + @java.lang.Override + public boolean getCancelRequested() { + return cancelRequested_; + } + /** + *
+     * Specifies if cancellation was requested for the operation.
+     * 
+ * + * bool cancel_requested = 6; + * @param value The cancelRequested to set. + * @return This builder for chaining. + */ + public Builder setCancelRequested(boolean value) { + + cancelRequested_ = value; + onChanged(); + return this; + } + /** + *
+     * Specifies if cancellation was requested for the operation.
+     * 
+ * + * bool cancel_requested = 6; + * @return This builder for chaining. + */ + public Builder clearCancelRequested() { + + cancelRequested_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + *
+     * API version.
+     * 
+ * + * string api_version = 7; + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * API version.
+     * 
+ * + * string api_version = 7; + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString + getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * API version.
+     * 
+ * + * string api_version = 7; + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + apiVersion_ = value; + onChanged(); + return this; + } + /** + *
+     * API version.
+     * 
+ * + * string api_version = 7; + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + + apiVersion_ = getDefaultInstance().getApiVersion(); + onChanged(); + return this; + } + /** + *
+     * API version.
+     * 
+ * + * string api_version = 7; + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + apiVersion_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.OperationMetadata) + private static final com.google.cloud.tpu.v1.OperationMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.OperationMetadata(); + } + + public static com.google.cloud.tpu.v1.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OperationMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/OperationMetadataOrBuilder.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..b88331fd15d0 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/OperationMetadataOrBuilder.java @@ -0,0 +1,155 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface OperationMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + *
+   * Target of the operation - for example
+   * projects/project-1/connectivityTests/test-1
+   * 
+ * + * string target = 3; + * @return The target. + */ + java.lang.String getTarget(); + /** + *
+   * Target of the operation - for example
+   * projects/project-1/connectivityTests/test-1
+   * 
+ * + * string target = 3; + * @return The bytes for target. + */ + com.google.protobuf.ByteString + getTargetBytes(); + + /** + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * @return The verb. + */ + java.lang.String getVerb(); + /** + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * @return The bytes for verb. + */ + com.google.protobuf.ByteString + getVerbBytes(); + + /** + *
+   * Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5; + * @return The statusDetail. + */ + java.lang.String getStatusDetail(); + /** + *
+   * Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5; + * @return The bytes for statusDetail. + */ + com.google.protobuf.ByteString + getStatusDetailBytes(); + + /** + *
+   * Specifies if cancellation was requested for the operation.
+   * 
+ * + * bool cancel_requested = 6; + * @return The cancelRequested. + */ + boolean getCancelRequested(); + + /** + *
+   * API version.
+   * 
+ * + * string api_version = 7; + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + /** + *
+   * API version.
+   * 
+ * + * string api_version = 7; + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString + getApiVersionBytes(); +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ReimageNodeRequest.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ReimageNodeRequest.java new file mode 100644 index 000000000000..c45062afbf1d --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ReimageNodeRequest.java @@ -0,0 +1,761 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + *
+ * Request for [ReimageNode][google.cloud.tpu.v1.Tpu.ReimageNode].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ReimageNodeRequest} + */ +public final class ReimageNodeRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.ReimageNodeRequest) + ReimageNodeRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ReimageNodeRequest.newBuilder() to construct. + private ReimageNodeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ReimageNodeRequest() { + name_ = ""; + tensorflowVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ReimageNodeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ReimageNodeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + tensorflowVersion_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ReimageNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ReimageNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ReimageNodeRequest.class, com.google.cloud.tpu.v1.ReimageNodeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TENSORFLOW_VERSION_FIELD_NUMBER = 2; + private volatile java.lang.Object tensorflowVersion_; + /** + *
+   * The version for reimage to create.
+   * 
+ * + * string tensorflow_version = 2; + * @return The tensorflowVersion. + */ + @java.lang.Override + public java.lang.String getTensorflowVersion() { + java.lang.Object ref = tensorflowVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tensorflowVersion_ = s; + return s; + } + } + /** + *
+   * The version for reimage to create.
+   * 
+ * + * string tensorflow_version = 2; + * @return The bytes for tensorflowVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTensorflowVersionBytes() { + java.lang.Object ref = tensorflowVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tensorflowVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tensorflowVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, tensorflowVersion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tensorflowVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, tensorflowVersion_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.tpu.v1.ReimageNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.ReimageNodeRequest other = (com.google.cloud.tpu.v1.ReimageNodeRequest) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getTensorflowVersion() + .equals(other.getTensorflowVersion())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + TENSORFLOW_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getTensorflowVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.ReimageNodeRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.ReimageNodeRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ReimageNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.ReimageNodeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ReimageNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.ReimageNodeRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ReimageNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.ReimageNodeRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ReimageNodeRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.ReimageNodeRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.ReimageNodeRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.ReimageNodeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.tpu.v1.ReimageNodeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request for [ReimageNode][google.cloud.tpu.v1.Tpu.ReimageNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.ReimageNodeRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.ReimageNodeRequest) + com.google.cloud.tpu.v1.ReimageNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ReimageNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ReimageNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.ReimageNodeRequest.class, com.google.cloud.tpu.v1.ReimageNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.ReimageNodeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + tensorflowVersion_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_ReimageNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ReimageNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.ReimageNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ReimageNodeRequest build() { + com.google.cloud.tpu.v1.ReimageNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ReimageNodeRequest buildPartial() { + com.google.cloud.tpu.v1.ReimageNodeRequest result = new com.google.cloud.tpu.v1.ReimageNodeRequest(this); + result.name_ = name_; + result.tensorflowVersion_ = tensorflowVersion_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.ReimageNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v1.ReimageNodeRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.ReimageNodeRequest other) { + if (other == com.google.cloud.tpu.v1.ReimageNodeRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getTensorflowVersion().isEmpty()) { + tensorflowVersion_ = other.tensorflowVersion_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.ReimageNodeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.ReimageNodeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object tensorflowVersion_ = ""; + /** + *
+     * The version for reimage to create.
+     * 
+ * + * string tensorflow_version = 2; + * @return The tensorflowVersion. + */ + public java.lang.String getTensorflowVersion() { + java.lang.Object ref = tensorflowVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tensorflowVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The version for reimage to create.
+     * 
+ * + * string tensorflow_version = 2; + * @return The bytes for tensorflowVersion. + */ + public com.google.protobuf.ByteString + getTensorflowVersionBytes() { + java.lang.Object ref = tensorflowVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tensorflowVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The version for reimage to create.
+     * 
+ * + * string tensorflow_version = 2; + * @param value The tensorflowVersion to set. + * @return This builder for chaining. + */ + public Builder setTensorflowVersion( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + tensorflowVersion_ = value; + onChanged(); + return this; + } + /** + *
+     * The version for reimage to create.
+     * 
+ * + * string tensorflow_version = 2; + * @return This builder for chaining. + */ + public Builder clearTensorflowVersion() { + + tensorflowVersion_ = getDefaultInstance().getTensorflowVersion(); + onChanged(); + return this; + } + /** + *
+     * The version for reimage to create.
+     * 
+ * + * string tensorflow_version = 2; + * @param value The bytes for tensorflowVersion to set. + * @return This builder for chaining. + */ + public Builder setTensorflowVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + tensorflowVersion_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.ReimageNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.ReimageNodeRequest) + private static final com.google.cloud.tpu.v1.ReimageNodeRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.ReimageNodeRequest(); + } + + public static com.google.cloud.tpu.v1.ReimageNodeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReimageNodeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReimageNodeRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.ReimageNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ReimageNodeRequestOrBuilder.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ReimageNodeRequestOrBuilder.java new file mode 100644 index 000000000000..3d0b1bfc7df5 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ReimageNodeRequestOrBuilder.java @@ -0,0 +1,49 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface ReimageNodeRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.ReimageNodeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * The version for reimage to create.
+   * 
+ * + * string tensorflow_version = 2; + * @return The tensorflowVersion. + */ + java.lang.String getTensorflowVersion(); + /** + *
+   * The version for reimage to create.
+   * 
+ * + * string tensorflow_version = 2; + * @return The bytes for tensorflowVersion. + */ + com.google.protobuf.ByteString + getTensorflowVersionBytes(); +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SchedulingConfig.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SchedulingConfig.java new file mode 100644 index 000000000000..00d16e866c3f --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SchedulingConfig.java @@ -0,0 +1,591 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + *
+ * Sets the scheduling options for this node.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.SchedulingConfig} + */ +public final class SchedulingConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.SchedulingConfig) + SchedulingConfigOrBuilder { +private static final long serialVersionUID = 0L; + // Use SchedulingConfig.newBuilder() to construct. + private SchedulingConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SchedulingConfig() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SchedulingConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SchedulingConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + preemptible_ = input.readBool(); + break; + } + case 16: { + + reserved_ = input.readBool(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_SchedulingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_SchedulingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.SchedulingConfig.class, com.google.cloud.tpu.v1.SchedulingConfig.Builder.class); + } + + public static final int PREEMPTIBLE_FIELD_NUMBER = 1; + private boolean preemptible_; + /** + *
+   * Defines whether the node is preemptible.
+   * 
+ * + * bool preemptible = 1; + * @return The preemptible. + */ + @java.lang.Override + public boolean getPreemptible() { + return preemptible_; + } + + public static final int RESERVED_FIELD_NUMBER = 2; + private boolean reserved_; + /** + *
+   * Whether the node is created under a reservation.
+   * 
+ * + * bool reserved = 2; + * @return The reserved. + */ + @java.lang.Override + public boolean getReserved() { + return reserved_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (preemptible_ != false) { + output.writeBool(1, preemptible_); + } + if (reserved_ != false) { + output.writeBool(2, reserved_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (preemptible_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, preemptible_); + } + if (reserved_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, reserved_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.tpu.v1.SchedulingConfig)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.SchedulingConfig other = (com.google.cloud.tpu.v1.SchedulingConfig) obj; + + if (getPreemptible() + != other.getPreemptible()) return false; + if (getReserved() + != other.getReserved()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PREEMPTIBLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getPreemptible()); + hash = (37 * hash) + RESERVED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getReserved()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.SchedulingConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.SchedulingConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.SchedulingConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.SchedulingConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.SchedulingConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.SchedulingConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.SchedulingConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.SchedulingConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.SchedulingConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.SchedulingConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.SchedulingConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.SchedulingConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.tpu.v1.SchedulingConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Sets the scheduling options for this node.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.SchedulingConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.SchedulingConfig) + com.google.cloud.tpu.v1.SchedulingConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_SchedulingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_SchedulingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.SchedulingConfig.class, com.google.cloud.tpu.v1.SchedulingConfig.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.SchedulingConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + preemptible_ = false; + + reserved_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_SchedulingConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.SchedulingConfig getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.SchedulingConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.SchedulingConfig build() { + com.google.cloud.tpu.v1.SchedulingConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.SchedulingConfig buildPartial() { + com.google.cloud.tpu.v1.SchedulingConfig result = new com.google.cloud.tpu.v1.SchedulingConfig(this); + result.preemptible_ = preemptible_; + result.reserved_ = reserved_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.SchedulingConfig) { + return mergeFrom((com.google.cloud.tpu.v1.SchedulingConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.SchedulingConfig other) { + if (other == com.google.cloud.tpu.v1.SchedulingConfig.getDefaultInstance()) return this; + if (other.getPreemptible() != false) { + setPreemptible(other.getPreemptible()); + } + if (other.getReserved() != false) { + setReserved(other.getReserved()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.SchedulingConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.SchedulingConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean preemptible_ ; + /** + *
+     * Defines whether the node is preemptible.
+     * 
+ * + * bool preemptible = 1; + * @return The preemptible. + */ + @java.lang.Override + public boolean getPreemptible() { + return preemptible_; + } + /** + *
+     * Defines whether the node is preemptible.
+     * 
+ * + * bool preemptible = 1; + * @param value The preemptible to set. + * @return This builder for chaining. + */ + public Builder setPreemptible(boolean value) { + + preemptible_ = value; + onChanged(); + return this; + } + /** + *
+     * Defines whether the node is preemptible.
+     * 
+ * + * bool preemptible = 1; + * @return This builder for chaining. + */ + public Builder clearPreemptible() { + + preemptible_ = false; + onChanged(); + return this; + } + + private boolean reserved_ ; + /** + *
+     * Whether the node is created under a reservation.
+     * 
+ * + * bool reserved = 2; + * @return The reserved. + */ + @java.lang.Override + public boolean getReserved() { + return reserved_; + } + /** + *
+     * Whether the node is created under a reservation.
+     * 
+ * + * bool reserved = 2; + * @param value The reserved to set. + * @return This builder for chaining. + */ + public Builder setReserved(boolean value) { + + reserved_ = value; + onChanged(); + return this; + } + /** + *
+     * Whether the node is created under a reservation.
+     * 
+ * + * bool reserved = 2; + * @return This builder for chaining. + */ + public Builder clearReserved() { + + reserved_ = false; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.SchedulingConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.SchedulingConfig) + private static final com.google.cloud.tpu.v1.SchedulingConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.SchedulingConfig(); + } + + public static com.google.cloud.tpu.v1.SchedulingConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SchedulingConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SchedulingConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.SchedulingConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SchedulingConfigOrBuilder.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SchedulingConfigOrBuilder.java new file mode 100644 index 000000000000..ee190f21b550 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SchedulingConfigOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface SchedulingConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.SchedulingConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Defines whether the node is preemptible.
+   * 
+ * + * bool preemptible = 1; + * @return The preemptible. + */ + boolean getPreemptible(); + + /** + *
+   * Whether the node is created under a reservation.
+   * 
+ * + * bool reserved = 2; + * @return The reserved. + */ + boolean getReserved(); +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StartNodeRequest.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StartNodeRequest.java new file mode 100644 index 000000000000..c324a2c058c8 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StartNodeRequest.java @@ -0,0 +1,595 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + *
+ * Request for [StartNode][google.cloud.tpu.v1.Tpu.StartNode].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.StartNodeRequest} + */ +public final class StartNodeRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.StartNodeRequest) + StartNodeRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use StartNodeRequest.newBuilder() to construct. + private StartNodeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StartNodeRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new StartNodeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StartNodeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_StartNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_StartNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.StartNodeRequest.class, com.google.cloud.tpu.v1.StartNodeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!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.v1.StartNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.StartNodeRequest other = (com.google.cloud.tpu.v1.StartNodeRequest) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.StartNodeRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.StartNodeRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.StartNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.StartNodeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.StartNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.StartNodeRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.StartNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.StartNodeRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.StartNodeRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.StartNodeRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.StartNodeRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.StartNodeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.tpu.v1.StartNodeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request for [StartNode][google.cloud.tpu.v1.Tpu.StartNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.StartNodeRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.StartNodeRequest) + com.google.cloud.tpu.v1.StartNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_StartNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_StartNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.StartNodeRequest.class, com.google.cloud.tpu.v1.StartNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.StartNodeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_StartNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.StartNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.StartNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.StartNodeRequest build() { + com.google.cloud.tpu.v1.StartNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.StartNodeRequest buildPartial() { + com.google.cloud.tpu.v1.StartNodeRequest result = new com.google.cloud.tpu.v1.StartNodeRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.StartNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v1.StartNodeRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.StartNodeRequest other) { + if (other == com.google.cloud.tpu.v1.StartNodeRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.StartNodeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.StartNodeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.StartNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.StartNodeRequest) + private static final com.google.cloud.tpu.v1.StartNodeRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.StartNodeRequest(); + } + + public static com.google.cloud.tpu.v1.StartNodeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StartNodeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StartNodeRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.StartNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StartNodeRequestOrBuilder.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StartNodeRequestOrBuilder.java new file mode 100644 index 000000000000..c7b3e0e1275d --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StartNodeRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface StartNodeRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.StartNodeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StopNodeRequest.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StopNodeRequest.java new file mode 100644 index 000000000000..cf72c6728524 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StopNodeRequest.java @@ -0,0 +1,595 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + *
+ * Request for [StopNode][google.cloud.tpu.v1.Tpu.StopNode].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.StopNodeRequest} + */ +public final class StopNodeRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.StopNodeRequest) + StopNodeRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use StopNodeRequest.newBuilder() to construct. + private StopNodeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StopNodeRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new StopNodeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StopNodeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_StopNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_StopNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.StopNodeRequest.class, com.google.cloud.tpu.v1.StopNodeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!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.v1.StopNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.StopNodeRequest other = (com.google.cloud.tpu.v1.StopNodeRequest) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.StopNodeRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.StopNodeRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.StopNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.StopNodeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.StopNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.StopNodeRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.StopNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.StopNodeRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.StopNodeRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.StopNodeRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.StopNodeRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.StopNodeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.tpu.v1.StopNodeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request for [StopNode][google.cloud.tpu.v1.Tpu.StopNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.StopNodeRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.StopNodeRequest) + com.google.cloud.tpu.v1.StopNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_StopNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_StopNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.StopNodeRequest.class, com.google.cloud.tpu.v1.StopNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.StopNodeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_StopNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.StopNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.StopNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.StopNodeRequest build() { + com.google.cloud.tpu.v1.StopNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.StopNodeRequest buildPartial() { + com.google.cloud.tpu.v1.StopNodeRequest result = new com.google.cloud.tpu.v1.StopNodeRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.StopNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v1.StopNodeRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.StopNodeRequest other) { + if (other == com.google.cloud.tpu.v1.StopNodeRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.StopNodeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.StopNodeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.StopNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.StopNodeRequest) + private static final com.google.cloud.tpu.v1.StopNodeRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.StopNodeRequest(); + } + + public static com.google.cloud.tpu.v1.StopNodeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StopNodeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StopNodeRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.StopNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StopNodeRequestOrBuilder.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StopNodeRequestOrBuilder.java new file mode 100644 index 000000000000..6b652fd17f76 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/StopNodeRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface StopNodeRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.StopNodeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/Symptom.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/Symptom.java new file mode 100644 index 000000000000..cb56d032c8f0 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/Symptom.java @@ -0,0 +1,1337 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + *
+ * A Symptom instance.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.Symptom} + */ +public final class Symptom extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.Symptom) + SymptomOrBuilder { +private static final long serialVersionUID = 0L; + // Use Symptom.newBuilder() to construct. + private Symptom(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Symptom() { + symptomType_ = 0; + details_ = ""; + workerId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Symptom(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Symptom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 16: { + int rawValue = input.readEnum(); + + symptomType_ = rawValue; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + details_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + workerId_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_Symptom_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_Symptom_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.Symptom.class, com.google.cloud.tpu.v1.Symptom.Builder.class); + } + + /** + *
+   * SymptomType represents the different types of Symptoms that a TPU can be
+   * at.
+   * 
+ * + * Protobuf enum {@code google.cloud.tpu.v1.Symptom.SymptomType} + */ + public enum SymptomType + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Unspecified symptom.
+     * 
+ * + * SYMPTOM_TYPE_UNSPECIFIED = 0; + */ + SYMPTOM_TYPE_UNSPECIFIED(0), + /** + *
+     * TPU VM memory is low.
+     * 
+ * + * LOW_MEMORY = 1; + */ + LOW_MEMORY(1), + /** + *
+     * TPU runtime is out of memory.
+     * 
+ * + * OUT_OF_MEMORY = 2; + */ + OUT_OF_MEMORY(2), + /** + *
+     * TPU runtime execution has timed out.
+     * 
+ * + * EXECUTE_TIMED_OUT = 3; + */ + EXECUTE_TIMED_OUT(3), + /** + *
+     * TPU runtime fails to construct a mesh that recognizes each TPU device's
+     * neighbors.
+     * 
+ * + * MESH_BUILD_FAIL = 4; + */ + MESH_BUILD_FAIL(4), + /** + *
+     * TPU HBM is out of memory.
+     * 
+ * + * HBM_OUT_OF_MEMORY = 5; + */ + HBM_OUT_OF_MEMORY(5), + /** + *
+     * Abusive behaviors have been identified on the current project.
+     * 
+ * + * PROJECT_ABUSE = 6; + */ + PROJECT_ABUSE(6), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Unspecified symptom.
+     * 
+ * + * SYMPTOM_TYPE_UNSPECIFIED = 0; + */ + public static final int SYMPTOM_TYPE_UNSPECIFIED_VALUE = 0; + /** + *
+     * TPU VM memory is low.
+     * 
+ * + * LOW_MEMORY = 1; + */ + public static final int LOW_MEMORY_VALUE = 1; + /** + *
+     * TPU runtime is out of memory.
+     * 
+ * + * OUT_OF_MEMORY = 2; + */ + public static final int OUT_OF_MEMORY_VALUE = 2; + /** + *
+     * TPU runtime execution has timed out.
+     * 
+ * + * EXECUTE_TIMED_OUT = 3; + */ + public static final int EXECUTE_TIMED_OUT_VALUE = 3; + /** + *
+     * TPU runtime fails to construct a mesh that recognizes each TPU device's
+     * neighbors.
+     * 
+ * + * MESH_BUILD_FAIL = 4; + */ + public static final int MESH_BUILD_FAIL_VALUE = 4; + /** + *
+     * TPU HBM is out of memory.
+     * 
+ * + * HBM_OUT_OF_MEMORY = 5; + */ + public static final int HBM_OUT_OF_MEMORY_VALUE = 5; + /** + *
+     * Abusive behaviors have been identified on the current project.
+     * 
+ * + * PROJECT_ABUSE = 6; + */ + public static final int PROJECT_ABUSE_VALUE = 6; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SymptomType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static SymptomType forNumber(int value) { + switch (value) { + case 0: return SYMPTOM_TYPE_UNSPECIFIED; + case 1: return LOW_MEMORY; + case 2: return OUT_OF_MEMORY; + case 3: return EXECUTE_TIMED_OUT; + case 4: return MESH_BUILD_FAIL; + case 5: return HBM_OUT_OF_MEMORY; + case 6: return PROJECT_ABUSE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + SymptomType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SymptomType findValueByNumber(int number) { + return SymptomType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.tpu.v1.Symptom.getDescriptor().getEnumTypes().get(0); + } + + private static final SymptomType[] VALUES = values(); + + public static SymptomType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private SymptomType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.tpu.v1.Symptom.SymptomType) + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + *
+   * Timestamp when the Symptom is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + *
+   * Timestamp when the Symptom is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + *
+   * Timestamp when the Symptom is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int SYMPTOM_TYPE_FIELD_NUMBER = 2; + private int symptomType_; + /** + *
+   * Type of the Symptom.
+   * 
+ * + * .google.cloud.tpu.v1.Symptom.SymptomType symptom_type = 2; + * @return The enum numeric value on the wire for symptomType. + */ + @java.lang.Override public int getSymptomTypeValue() { + return symptomType_; + } + /** + *
+   * Type of the Symptom.
+   * 
+ * + * .google.cloud.tpu.v1.Symptom.SymptomType symptom_type = 2; + * @return The symptomType. + */ + @java.lang.Override public com.google.cloud.tpu.v1.Symptom.SymptomType getSymptomType() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v1.Symptom.SymptomType result = com.google.cloud.tpu.v1.Symptom.SymptomType.valueOf(symptomType_); + return result == null ? com.google.cloud.tpu.v1.Symptom.SymptomType.UNRECOGNIZED : result; + } + + public static final int DETAILS_FIELD_NUMBER = 3; + private volatile java.lang.Object details_; + /** + *
+   * Detailed information of the current Symptom.
+   * 
+ * + * string details = 3; + * @return The details. + */ + @java.lang.Override + public java.lang.String getDetails() { + java.lang.Object ref = details_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + details_ = s; + return s; + } + } + /** + *
+   * Detailed information of the current Symptom.
+   * 
+ * + * string details = 3; + * @return The bytes for details. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDetailsBytes() { + java.lang.Object ref = details_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + details_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WORKER_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object workerId_; + /** + *
+   * A string used to uniquely distinguish a worker within a TPU node.
+   * 
+ * + * string worker_id = 4; + * @return The workerId. + */ + @java.lang.Override + public java.lang.String getWorkerId() { + java.lang.Object ref = workerId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workerId_ = s; + return s; + } + } + /** + *
+   * A string used to uniquely distinguish a worker within a TPU node.
+   * 
+ * + * string worker_id = 4; + * @return The bytes for workerId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getWorkerIdBytes() { + java.lang.Object ref = workerId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + workerId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (symptomType_ != com.google.cloud.tpu.v1.Symptom.SymptomType.SYMPTOM_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, symptomType_); + } + if (!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.v1.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.v1.Symptom)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.Symptom other = (com.google.cloud.tpu.v1.Symptom) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime() + .equals(other.getCreateTime())) return false; + } + if (symptomType_ != other.symptomType_) return false; + if (!getDetails() + .equals(other.getDetails())) return false; + if (!getWorkerId() + .equals(other.getWorkerId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + SYMPTOM_TYPE_FIELD_NUMBER; + hash = (53 * hash) + symptomType_; + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetails().hashCode(); + hash = (37 * hash) + WORKER_ID_FIELD_NUMBER; + hash = (53 * hash) + getWorkerId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.Symptom parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.Symptom parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.Symptom parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.Symptom parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.Symptom parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.Symptom parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.Symptom parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.Symptom parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.Symptom parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.Symptom parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.Symptom parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.Symptom parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.tpu.v1.Symptom prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A Symptom instance.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.Symptom} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.Symptom) + com.google.cloud.tpu.v1.SymptomOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_Symptom_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_Symptom_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.Symptom.class, com.google.cloud.tpu.v1.Symptom.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.Symptom.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + symptomType_ = 0; + + details_ = ""; + + workerId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_Symptom_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.Symptom getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.Symptom.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.Symptom build() { + com.google.cloud.tpu.v1.Symptom result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.Symptom buildPartial() { + com.google.cloud.tpu.v1.Symptom result = new com.google.cloud.tpu.v1.Symptom(this); + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.symptomType_ = symptomType_; + result.details_ = details_; + result.workerId_ = workerId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.Symptom) { + return mergeFrom((com.google.cloud.tpu.v1.Symptom)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.Symptom other) { + if (other == com.google.cloud.tpu.v1.Symptom.getDefaultInstance()) return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.symptomType_ != 0) { + setSymptomTypeValue(other.getSymptomTypeValue()); + } + if (!other.getDetails().isEmpty()) { + details_ = other.details_; + onChanged(); + } + if (!other.getWorkerId().isEmpty()) { + workerId_ = other.workerId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.Symptom parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.Symptom) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_; + /** + *
+     * Timestamp when the Symptom is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + *
+     * Timestamp when the Symptom is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + *
+     * Timestamp when the Symptom is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Timestamp when the Symptom is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Timestamp when the Symptom is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Timestamp when the Symptom is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Timestamp when the Symptom is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Timestamp when the Symptom is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + } + /** + *
+     * Timestamp when the Symptom is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), + getParentForChildren(), + isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private int symptomType_ = 0; + /** + *
+     * Type of the Symptom.
+     * 
+ * + * .google.cloud.tpu.v1.Symptom.SymptomType symptom_type = 2; + * @return The enum numeric value on the wire for symptomType. + */ + @java.lang.Override public int getSymptomTypeValue() { + return symptomType_; + } + /** + *
+     * Type of the Symptom.
+     * 
+ * + * .google.cloud.tpu.v1.Symptom.SymptomType symptom_type = 2; + * @param value The enum numeric value on the wire for symptomType to set. + * @return This builder for chaining. + */ + public Builder setSymptomTypeValue(int value) { + + symptomType_ = value; + onChanged(); + return this; + } + /** + *
+     * Type of the Symptom.
+     * 
+ * + * .google.cloud.tpu.v1.Symptom.SymptomType symptom_type = 2; + * @return The symptomType. + */ + @java.lang.Override + public com.google.cloud.tpu.v1.Symptom.SymptomType getSymptomType() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v1.Symptom.SymptomType result = com.google.cloud.tpu.v1.Symptom.SymptomType.valueOf(symptomType_); + return result == null ? com.google.cloud.tpu.v1.Symptom.SymptomType.UNRECOGNIZED : result; + } + /** + *
+     * Type of the Symptom.
+     * 
+ * + * .google.cloud.tpu.v1.Symptom.SymptomType symptom_type = 2; + * @param value The symptomType to set. + * @return This builder for chaining. + */ + public Builder setSymptomType(com.google.cloud.tpu.v1.Symptom.SymptomType value) { + if (value == null) { + throw new NullPointerException(); + } + + symptomType_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Type of the Symptom.
+     * 
+ * + * .google.cloud.tpu.v1.Symptom.SymptomType symptom_type = 2; + * @return This builder for chaining. + */ + public Builder clearSymptomType() { + + symptomType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object details_ = ""; + /** + *
+     * Detailed information of the current Symptom.
+     * 
+ * + * string details = 3; + * @return The details. + */ + public java.lang.String getDetails() { + java.lang.Object ref = details_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + details_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Detailed information of the current Symptom.
+     * 
+ * + * string details = 3; + * @return The bytes for details. + */ + public com.google.protobuf.ByteString + getDetailsBytes() { + java.lang.Object ref = details_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + details_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Detailed information of the current Symptom.
+     * 
+ * + * string details = 3; + * @param value The details to set. + * @return This builder for chaining. + */ + public Builder setDetails( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + details_ = value; + onChanged(); + return this; + } + /** + *
+     * Detailed information of the current Symptom.
+     * 
+ * + * string details = 3; + * @return This builder for chaining. + */ + public Builder clearDetails() { + + details_ = getDefaultInstance().getDetails(); + onChanged(); + return this; + } + /** + *
+     * Detailed information of the current Symptom.
+     * 
+ * + * string details = 3; + * @param value The bytes for details to set. + * @return This builder for chaining. + */ + public Builder setDetailsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + details_ = value; + onChanged(); + return this; + } + + private java.lang.Object workerId_ = ""; + /** + *
+     * A string used to uniquely distinguish a worker within a TPU node.
+     * 
+ * + * string worker_id = 4; + * @return The workerId. + */ + public java.lang.String getWorkerId() { + java.lang.Object ref = workerId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workerId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A string used to uniquely distinguish a worker within a TPU node.
+     * 
+ * + * string worker_id = 4; + * @return The bytes for workerId. + */ + public com.google.protobuf.ByteString + getWorkerIdBytes() { + java.lang.Object ref = workerId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + workerId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A string used to uniquely distinguish a worker within a TPU node.
+     * 
+ * + * string worker_id = 4; + * @param value The workerId to set. + * @return This builder for chaining. + */ + public Builder setWorkerId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + workerId_ = value; + onChanged(); + return this; + } + /** + *
+     * A string used to uniquely distinguish a worker within a TPU node.
+     * 
+ * + * string worker_id = 4; + * @return This builder for chaining. + */ + public Builder clearWorkerId() { + + workerId_ = getDefaultInstance().getWorkerId(); + onChanged(); + return this; + } + /** + *
+     * A string used to uniquely distinguish a worker within a TPU node.
+     * 
+ * + * string worker_id = 4; + * @param value The bytes for workerId to set. + * @return This builder for chaining. + */ + public Builder setWorkerIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + workerId_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.Symptom) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.Symptom) + private static final com.google.cloud.tpu.v1.Symptom DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.Symptom(); + } + + public static com.google.cloud.tpu.v1.Symptom getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Symptom parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Symptom(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.Symptom getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SymptomOrBuilder.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SymptomOrBuilder.java new file mode 100644 index 000000000000..60cfa7da86a9 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/SymptomOrBuilder.java @@ -0,0 +1,95 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface SymptomOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.Symptom) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Timestamp when the Symptom is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + *
+   * Timestamp when the Symptom is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + *
+   * Timestamp when the Symptom is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + *
+   * Type of the Symptom.
+   * 
+ * + * .google.cloud.tpu.v1.Symptom.SymptomType symptom_type = 2; + * @return The enum numeric value on the wire for symptomType. + */ + int getSymptomTypeValue(); + /** + *
+   * Type of the Symptom.
+   * 
+ * + * .google.cloud.tpu.v1.Symptom.SymptomType symptom_type = 2; + * @return The symptomType. + */ + com.google.cloud.tpu.v1.Symptom.SymptomType getSymptomType(); + + /** + *
+   * Detailed information of the current Symptom.
+   * 
+ * + * string details = 3; + * @return The details. + */ + java.lang.String getDetails(); + /** + *
+   * Detailed information of the current Symptom.
+   * 
+ * + * string details = 3; + * @return The bytes for details. + */ + com.google.protobuf.ByteString + getDetailsBytes(); + + /** + *
+   * A string used to uniquely distinguish a worker within a TPU node.
+   * 
+ * + * string worker_id = 4; + * @return The workerId. + */ + java.lang.String getWorkerId(); + /** + *
+   * A string used to uniquely distinguish a worker within a TPU node.
+   * 
+ * + * string worker_id = 4; + * @return The bytes for workerId. + */ + com.google.protobuf.ByteString + getWorkerIdBytes(); +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersion.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersion.java new file mode 100644 index 000000000000..06bc7253f8ee --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersion.java @@ -0,0 +1,761 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +/** + *
+ * A tensorflow version that a Node can be configured with.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.TensorFlowVersion} + */ +public final class TensorFlowVersion extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v1.TensorFlowVersion) + TensorFlowVersionOrBuilder { +private static final long serialVersionUID = 0L; + // Use TensorFlowVersion.newBuilder() to construct. + private TensorFlowVersion(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TensorFlowVersion() { + name_ = ""; + version_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TensorFlowVersion(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TensorFlowVersion( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + version_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_TensorFlowVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_TensorFlowVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.TensorFlowVersion.class, com.google.cloud.tpu.v1.TensorFlowVersion.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERSION_FIELD_NUMBER = 2; + private volatile java.lang.Object version_; + /** + *
+   * the tensorflow version.
+   * 
+ * + * string version = 2; + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } + } + /** + *
+   * the tensorflow version.
+   * 
+ * + * string version = 2; + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!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.v1.TensorFlowVersion)) { + return super.equals(obj); + } + com.google.cloud.tpu.v1.TensorFlowVersion other = (com.google.cloud.tpu.v1.TensorFlowVersion) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getVersion() + .equals(other.getVersion())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v1.TensorFlowVersion parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.TensorFlowVersion parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.TensorFlowVersion parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.TensorFlowVersion parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.TensorFlowVersion parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v1.TensorFlowVersion parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.tpu.v1.TensorFlowVersion parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.TensorFlowVersion parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.TensorFlowVersion parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.TensorFlowVersion parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.tpu.v1.TensorFlowVersion parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v1.TensorFlowVersion parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.tpu.v1.TensorFlowVersion prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A tensorflow version that a Node can be configured with.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v1.TensorFlowVersion} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v1.TensorFlowVersion) + com.google.cloud.tpu.v1.TensorFlowVersionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_TensorFlowVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_TensorFlowVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v1.TensorFlowVersion.class, com.google.cloud.tpu.v1.TensorFlowVersion.Builder.class); + } + + // Construct using com.google.cloud.tpu.v1.TensorFlowVersion.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + version_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.tpu.v1.CloudTpuProto.internal_static_google_cloud_tpu_v1_TensorFlowVersion_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.TensorFlowVersion getDefaultInstanceForType() { + return com.google.cloud.tpu.v1.TensorFlowVersion.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v1.TensorFlowVersion build() { + com.google.cloud.tpu.v1.TensorFlowVersion result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.TensorFlowVersion buildPartial() { + com.google.cloud.tpu.v1.TensorFlowVersion result = new com.google.cloud.tpu.v1.TensorFlowVersion(this); + result.name_ = name_; + result.version_ = version_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v1.TensorFlowVersion) { + return mergeFrom((com.google.cloud.tpu.v1.TensorFlowVersion)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v1.TensorFlowVersion other) { + if (other == com.google.cloud.tpu.v1.TensorFlowVersion.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.tpu.v1.TensorFlowVersion parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v1.TensorFlowVersion) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The resource name.
+     * 
+ * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object version_ = ""; + /** + *
+     * the tensorflow version.
+     * 
+ * + * string version = 2; + * @return The version. + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * the tensorflow version.
+     * 
+ * + * string version = 2; + * @return The bytes for version. + */ + public com.google.protobuf.ByteString + getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * the tensorflow version.
+     * 
+ * + * string version = 2; + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + version_ = value; + onChanged(); + return this; + } + /** + *
+     * the tensorflow version.
+     * 
+ * + * string version = 2; + * @return This builder for chaining. + */ + public Builder clearVersion() { + + version_ = getDefaultInstance().getVersion(); + onChanged(); + return this; + } + /** + *
+     * the tensorflow version.
+     * 
+ * + * string version = 2; + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + version_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v1.TensorFlowVersion) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v1.TensorFlowVersion) + private static final com.google.cloud.tpu.v1.TensorFlowVersion DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v1.TensorFlowVersion(); + } + + public static com.google.cloud.tpu.v1.TensorFlowVersion getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TensorFlowVersion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TensorFlowVersion(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.tpu.v1.TensorFlowVersion getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersionName.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersionName.java new file mode 100644 index 000000000000..41dccb833939 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersionName.java @@ -0,0 +1,231 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class TensorFlowVersionName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_TENSOR_FLOW_VERSION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/tensorFlowVersions/{tensor_flow_version}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String tensorFlowVersion; + + @Deprecated + protected TensorFlowVersionName() { + project = null; + location = null; + tensorFlowVersion = null; + } + + private TensorFlowVersionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + tensorFlowVersion = Preconditions.checkNotNull(builder.getTensorFlowVersion()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getTensorFlowVersion() { + return tensorFlowVersion; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static TensorFlowVersionName of( + String project, String location, String tensorFlowVersion) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setTensorFlowVersion(tensorFlowVersion) + .build(); + } + + public static String format(String project, String location, String tensorFlowVersion) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setTensorFlowVersion(tensorFlowVersion) + .build() + .toString(); + } + + public static TensorFlowVersionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_TENSOR_FLOW_VERSION.validatedMatch( + formattedString, "TensorFlowVersionName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), matchMap.get("location"), matchMap.get("tensor_flow_version")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (TensorFlowVersionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_TENSOR_FLOW_VERSION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (tensorFlowVersion != null) { + fieldMapBuilder.put("tensor_flow_version", tensorFlowVersion); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_TENSOR_FLOW_VERSION.instantiate( + "project", project, "location", location, "tensor_flow_version", tensorFlowVersion); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + TensorFlowVersionName that = ((TensorFlowVersionName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.tensorFlowVersion, that.tensorFlowVersion); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(tensorFlowVersion); + return h; + } + + /** + * Builder for projects/{project}/locations/{location}/tensorFlowVersions/{tensor_flow_version}. + */ + public static class Builder { + private String project; + private String location; + private String tensorFlowVersion; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getTensorFlowVersion() { + return tensorFlowVersion; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setTensorFlowVersion(String tensorFlowVersion) { + this.tensorFlowVersion = tensorFlowVersion; + return this; + } + + private Builder(TensorFlowVersionName tensorFlowVersionName) { + this.project = tensorFlowVersionName.project; + this.location = tensorFlowVersionName.location; + this.tensorFlowVersion = tensorFlowVersionName.tensorFlowVersion; + } + + public TensorFlowVersionName build() { + return new TensorFlowVersionName(this); + } + } +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersionOrBuilder.java b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersionOrBuilder.java new file mode 100644 index 000000000000..fe0475ee89cd --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TensorFlowVersionOrBuilder.java @@ -0,0 +1,49 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v1/cloud_tpu.proto + +package com.google.cloud.tpu.v1; + +public interface TensorFlowVersionOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v1.TensorFlowVersion) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The resource name.
+   * 
+ * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * the tensorflow version.
+   * 
+ * + * string version = 2; + * @return The version. + */ + java.lang.String getVersion(); + /** + *
+   * the tensorflow version.
+   * 
+ * + * string version = 2; + * @return The bytes for version. + */ + com.google.protobuf.ByteString + getVersionBytes(); +} diff --git a/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/proto/google/cloud/tpu/v1/cloud_tpu.proto b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/proto/google/cloud/tpu/v1/cloud_tpu.proto new file mode 100644 index 000000000000..08e83550b1f7 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/proto-google-cloud-tpu-v1/src/main/proto/google/cloud/tpu/v1/cloud_tpu.proto @@ -0,0 +1,622 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.tpu.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/tpu/v1;tpu"; +option java_multiple_files = true; +option java_outer_classname = "CloudTpuProto"; +option java_package = "com.google.cloud.tpu.v1"; + +// Manages TPU nodes and other resources +// +// TPU API v1 +service Tpu { + option (google.api.default_host) = "tpu.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists nodes. + rpc ListNodes(ListNodesRequest) returns (ListNodesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/nodes" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the details of a node. + rpc GetNode(GetNodeRequest) returns (Node) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/nodes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a node. + rpc CreateNode(CreateNodeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/nodes" + body: "node" + }; + option (google.api.method_signature) = "parent,node,node_id"; + option (google.longrunning.operation_info) = { + response_type: "Node" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a node. + rpc DeleteNode(DeleteNodeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/nodes/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Node" + metadata_type: "OperationMetadata" + }; + } + + // Reimages a node's OS. + rpc ReimageNode(ReimageNodeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/nodes/*}:reimage" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Node" + metadata_type: "OperationMetadata" + }; + } + + // Stops a node. + rpc StopNode(StopNodeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/nodes/*}:stop" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Node" + metadata_type: "OperationMetadata" + }; + } + + // Starts a node. + rpc StartNode(StartNodeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/nodes/*}:start" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Node" + metadata_type: "OperationMetadata" + }; + } + + // List TensorFlow versions supported by this API. + rpc ListTensorFlowVersions(ListTensorFlowVersionsRequest) returns (ListTensorFlowVersionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/tensorflowVersions" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets TensorFlow Version. + rpc GetTensorFlowVersion(GetTensorFlowVersionRequest) returns (TensorFlowVersion) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/tensorflowVersions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists accelerator types supported by this API. + rpc ListAcceleratorTypes(ListAcceleratorTypesRequest) returns (ListAcceleratorTypesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/acceleratorTypes" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets AcceleratorType. + rpc GetAcceleratorType(GetAcceleratorTypeRequest) returns (AcceleratorType) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/acceleratorTypes/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Sets the scheduling options for this node. +message SchedulingConfig { + // Defines whether the node is preemptible. + bool preemptible = 1; + + // Whether the node is created under a reservation. + bool reserved = 2; +} + +// A network endpoint over which a TPU worker can be reached. +message NetworkEndpoint { + // The IP address of this network endpoint. + string ip_address = 1; + + // The port of this network endpoint. + int32 port = 2; +} + +// A TPU instance. +message Node { + option (google.api.resource) = { + type: "tpu.googleapis.com/Node" + pattern: "projects/{project}/locations/{location}/nodes/{node}" + }; + + // Represents the different states of a TPU node during its lifecycle. + enum State { + // TPU node state is not known/set. + STATE_UNSPECIFIED = 0; + + // TPU node is being created. + CREATING = 1; + + // TPU node has been created and is fully usable. + READY = 2; + + // TPU node is restarting. + RESTARTING = 3; + + // TPU node is undergoing reimaging. + REIMAGING = 4; + + // TPU node is being deleted. + DELETING = 5; + + // TPU node is being repaired and may be unusable. Details can be + // found in the `help_description` field. + REPAIRING = 6; + + // TPU node is stopped. + STOPPED = 8; + + // TPU node is currently stopping. + STOPPING = 9; + + // TPU node is currently starting. + STARTING = 10; + + // TPU node has been preempted. Only applies to Preemptible TPU Nodes. + PREEMPTED = 11; + + // TPU node has been terminated due to maintenance or has reached the end of + // its life cycle (for preemptible nodes). + TERMINATED = 12; + + // TPU node is currently hiding. + HIDING = 13; + + // TPU node has been hidden. + HIDDEN = 14; + + // TPU node is currently unhiding. + UNHIDING = 15; + } + + // Health defines the status of a TPU node as reported by + // Health Monitor. + enum Health { + // Health status is unknown: not initialized or failed to retrieve. + HEALTH_UNSPECIFIED = 0; + + // The resource is healthy. + HEALTHY = 1; + + // The resource is unhealthy. + DEPRECATED_UNHEALTHY = 2; + + // The resource is unresponsive. + TIMEOUT = 3; + + // The in-guest ML stack is unhealthy. + UNHEALTHY_TENSORFLOW = 4; + + // The node is under maintenance/priority boost caused rescheduling and + // will resume running once rescheduled. + UNHEALTHY_MAINTENANCE = 5; + } + + // TPU API Version. + enum ApiVersion { + // API version is unknown. + API_VERSION_UNSPECIFIED = 0; + + // TPU API V1Alpha1 version. + V1_ALPHA1 = 1; + + // TPU API V1 version. + V1 = 2; + + // TPU API V2Alpha1 version. + V2_ALPHA1 = 3; + } + + // Output only. Immutable. The name of the TPU + string name = 1 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // The user-supplied description of the TPU. Maximum of 512 characters. + string description = 3; + + // Required. The type of hardware accelerators associated with this node. + string accelerator_type = 5 [(google.api.field_behavior) = REQUIRED]; + + // Output only. DEPRECATED! Use network_endpoints instead. + // The network address for the TPU Node as visible to Compute Engine + // instances. + string ip_address = 8 [deprecated = true]; + + // Output only. DEPRECATED! Use network_endpoints instead. + // The network port for the TPU Node as visible to Compute Engine instances. + string port = 14 [deprecated = true]; + + // Output only. The current state for the TPU Node. + State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If this field is populated, it contains a description of why the TPU Node + // is unhealthy. + string health_description = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The version of Tensorflow running in the Node. + string tensorflow_version = 11 [(google.api.field_behavior) = REQUIRED]; + + // The name of a network they wish to peer the TPU node to. It must be a + // preexisting Compute Engine network inside of the project on which this API + // has been activated. If none is provided, "default" will be used. + string network = 12; + + // The CIDR block that the TPU node will use when selecting an IP address. + // This CIDR block must be a /29 block; the Compute Engine networks API + // forbids a smaller block, and using a larger block would be wasteful (a + // node can only consume one IP address). Errors will occur if the CIDR block + // has already been used for a currently existing TPU node, the CIDR block + // conflicts with any subnetworks in the user's provided network, or the + // provided network is peered with another network that is using that CIDR + // block. + string cidr_block = 13; + + // Output only. The service account used to run the tensor flow services within the node. + // To share resources, including Google Cloud Storage data, with the + // Tensorflow job running in the Node, this account must have permissions to + // that data. + string service_account = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the node was created. + google.protobuf.Timestamp create_time = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The scheduling options for this node. + SchedulingConfig scheduling_config = 17; + + // Output only. The network endpoints where TPU workers can be accessed and + // sent work. It is recommended that Tensorflow clients of the node reach out + // to the 0th entry in this map first. + repeated NetworkEndpoint network_endpoints = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The health status of the TPU node. + Health health = 22; + + // Resource labels to represent user-provided metadata. + map labels = 24; + + // Whether the VPC peering for the node is set up through Service Networking + // API. The VPC Peering should be set up before provisioning the node. + // If this field is set, cidr_block field should not be specified. If the + // network, that you want to peer the TPU Node to, is Shared VPC networks, + // the node must be created with this this field enabled. + bool use_service_networking = 27; + + // Output only. The API version that created this Node. + ApiVersion api_version = 38 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Symptoms that have occurred to the TPU Node. + repeated Symptom symptoms = 39 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request for [ListNodes][google.cloud.tpu.v1.Tpu.ListNodes]. +message ListNodesRequest { + // Required. The parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "tpu.googleapis.com/Node" + } + ]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; +} + +// Response for [ListNodes][google.cloud.tpu.v1.Tpu.ListNodes]. +message ListNodesResponse { + // The listed nodes. + repeated Node nodes = 1; + + // The next page token or empty if none. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request for [GetNode][google.cloud.tpu.v1.Tpu.GetNode]. +message GetNodeRequest { + // Required. The resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "tpu.googleapis.com/Node" + } + ]; +} + +// Request for [CreateNode][google.cloud.tpu.v1.Tpu.CreateNode]. +message CreateNodeRequest { + // Required. The parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "tpu.googleapis.com/Node" + } + ]; + + // The unqualified resource name. + string node_id = 2; + + // Required. The node. + Node node = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for [DeleteNode][google.cloud.tpu.v1.Tpu.DeleteNode]. +message DeleteNodeRequest { + // Required. The resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "tpu.googleapis.com/Node" + } + ]; +} + +// Request for [ReimageNode][google.cloud.tpu.v1.Tpu.ReimageNode]. +message ReimageNodeRequest { + // The resource name. + string name = 1; + + // The version for reimage to create. + string tensorflow_version = 2; +} + +// Request for [StopNode][google.cloud.tpu.v1.Tpu.StopNode]. +message StopNodeRequest { + // The resource name. + string name = 1; +} + +// Request for [StartNode][google.cloud.tpu.v1.Tpu.StartNode]. +message StartNodeRequest { + // The resource name. + string name = 1; +} + +// A tensorflow version that a Node can be configured with. +message TensorFlowVersion { + option (google.api.resource) = { + type: "tpu.googleapis.com/TensorFlowVersion" + pattern: "projects/{project}/locations/{location}/tensorFlowVersions/{tensor_flow_version}" + }; + + // The resource name. + string name = 1; + + // the tensorflow version. + string version = 2; +} + +// Request for [GetTensorFlowVersion][google.cloud.tpu.v1.Tpu.GetTensorFlowVersion]. +message GetTensorFlowVersionRequest { + // Required. The resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "tpu.googleapis.com/TensorFlowVersion" + } + ]; +} + +// Request for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions]. +message ListTensorFlowVersionsRequest { + // Required. The parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "tpu.googleapis.com/TensorFlowVersion" + } + ]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; + + // List filter. + string filter = 5; + + // Sort results. + string order_by = 6; +} + +// Response for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions]. +message ListTensorFlowVersionsResponse { + // The listed nodes. + repeated TensorFlowVersion tensorflow_versions = 1; + + // The next page token or empty if none. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// A accelerator type that a Node can be configured with. +message AcceleratorType { + option (google.api.resource) = { + type: "tpu.googleapis.com/AcceleratorType" + pattern: "projects/{project}/locations/{location}/acceleratorTypes/{accelerator_type}" + }; + + // The resource name. + string name = 1; + + // the accelerator type. + string type = 2; +} + +// Request for [GetAcceleratorType][google.cloud.tpu.v1.Tpu.GetAcceleratorType]. +message GetAcceleratorTypeRequest { + // Required. The resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "tpu.googleapis.com/AcceleratorType" + } + ]; +} + +// Request for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes]. +message ListAcceleratorTypesRequest { + // Required. The parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "tpu.googleapis.com/AcceleratorType" + } + ]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; + + // List filter. + string filter = 5; + + // Sort results. + string order_by = 6; +} + +// Response for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes]. +message ListAcceleratorTypesResponse { + // The listed nodes. + repeated AcceleratorType accelerator_types = 1; + + // The next page token or empty if none. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Note: the following OperationMetadata message was added manually. +// This is caused by a conflict with some other message and will +// be resolved separately. Please make sure to add this message back +// if it's removed during public proto regeneration. + +// Metadata describing an [Operation][google.longrunning.Operation] +message OperationMetadata { + // The time the operation was created. + google.protobuf.Timestamp create_time = 1; + + // The time the operation finished running. + google.protobuf.Timestamp end_time = 2; + + // Target of the operation - for example + // projects/project-1/connectivityTests/test-1 + string target = 3; + + // Name of the verb executed by the operation. + string verb = 4; + + // Human-readable status of the operation, if any. + string status_detail = 5; + + // Specifies if cancellation was requested for the operation. + bool cancel_requested = 6; + + // API version. + string api_version = 7; +} + +// A Symptom instance. +message Symptom { + // SymptomType represents the different types of Symptoms that a TPU can be + // at. + enum SymptomType { + // Unspecified symptom. + SYMPTOM_TYPE_UNSPECIFIED = 0; + + // TPU VM memory is low. + LOW_MEMORY = 1; + + // TPU runtime is out of memory. + OUT_OF_MEMORY = 2; + + // TPU runtime execution has timed out. + EXECUTE_TIMED_OUT = 3; + + // TPU runtime fails to construct a mesh that recognizes each TPU device's + // neighbors. + MESH_BUILD_FAIL = 4; + + // TPU HBM is out of memory. + HBM_OUT_OF_MEMORY = 5; + + // Abusive behaviors have been identified on the current project. + PROJECT_ABUSE = 6; + } + + // Timestamp when the Symptom is created. + google.protobuf.Timestamp create_time = 1; + + // Type of the Symptom. + SymptomType symptom_type = 2; + + // Detailed information of the current Symptom. + string details = 3; + + // A string used to uniquely distinguish a worker within a TPU node. + string worker_id = 4; +} diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/stub/tpustubsettings/getnode/SyncGetNode.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/stub/tpustubsettings/getnode/SyncGetNode.java new file mode 100644 index 000000000000..b96ed478d45d --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/stub/tpustubsettings/getnode/SyncGetNode.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.stub.samples; + +// [START tpu_v1_generated_tpustubsettings_getnode_sync] +import com.google.cloud.tpu.v1.stub.TpuStubSettings; +import java.time.Duration; + +public class SyncGetNode { + + public static void main(String[] args) throws Exception { + syncGetNode(); + } + + public static void syncGetNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + TpuStubSettings.Builder tpuSettingsBuilder = TpuStubSettings.newBuilder(); + tpuSettingsBuilder + .getNodeSettings() + .setRetrySettings( + tpuSettingsBuilder.getNodeSettings().getRetrySettings().toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + TpuStubSettings tpuSettings = tpuSettingsBuilder.build(); + } +} +// [END tpu_v1_generated_tpustubsettings_getnode_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/create/SyncCreateSetCredentialsProvider.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..32d5b4f7ff7f --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.tpu.v1.TpuClient; +import com.google.cloud.tpu.v1.TpuSettings; +import com.google.cloud.tpu.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + TpuSettings tpuSettings = + TpuSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + TpuClient tpuClient = TpuClient.create(tpuSettings); + } +} +// [END tpu_v1_generated_tpuclient_create_setcredentialsprovider_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/create/SyncCreateSetEndpoint.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..f19eab4b9342 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_create_setendpoint_sync] +import com.google.cloud.tpu.v1.TpuClient; +import com.google.cloud.tpu.v1.TpuSettings; +import com.google.cloud.tpu.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + TpuSettings tpuSettings = TpuSettings.newBuilder().setEndpoint(myEndpoint).build(); + TpuClient tpuClient = TpuClient.create(tpuSettings); + } +} +// [END tpu_v1_generated_tpuclient_create_setendpoint_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/createnode/AsyncCreateNode.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/createnode/AsyncCreateNode.java new file mode 100644 index 000000000000..135808e3a898 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/createnode/AsyncCreateNode.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_createnode_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v1.CreateNodeRequest; +import com.google.cloud.tpu.v1.LocationName; +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.TpuClient; +import com.google.longrunning.Operation; + +public class AsyncCreateNode { + + public static void main(String[] args) throws Exception { + asyncCreateNode(); + } + + public static void asyncCreateNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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(); + } + } +} +// [END tpu_v1_generated_tpuclient_createnode_async] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/createnode/AsyncCreateNodeLRO.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/createnode/AsyncCreateNodeLRO.java new file mode 100644 index 000000000000..c119a9a5d150 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/createnode/AsyncCreateNodeLRO.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_createnode_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.tpu.v1.CreateNodeRequest; +import com.google.cloud.tpu.v1.LocationName; +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.OperationMetadata; +import com.google.cloud.tpu.v1.TpuClient; + +public class AsyncCreateNodeLRO { + + public static void main(String[] args) throws Exception { + asyncCreateNodeLRO(); + } + + public static void asyncCreateNodeLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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(); + } + } +} +// [END tpu_v1_generated_tpuclient_createnode_lro_async] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/createnode/SyncCreateNode.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/createnode/SyncCreateNode.java new file mode 100644 index 000000000000..79e58c793318 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/createnode/SyncCreateNode.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_createnode_sync] +import com.google.cloud.tpu.v1.CreateNodeRequest; +import com.google.cloud.tpu.v1.LocationName; +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncCreateNode { + + public static void main(String[] args) throws Exception { + syncCreateNode(); + } + + public static void syncCreateNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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(); + } + } +} +// [END tpu_v1_generated_tpuclient_createnode_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/createnode/SyncCreateNodeLocationnameNodeString.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/createnode/SyncCreateNodeLocationnameNodeString.java new file mode 100644 index 000000000000..b9d37cbef281 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/createnode/SyncCreateNodeLocationnameNodeString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_createnode_locationnamenodestring_sync] +import com.google.cloud.tpu.v1.LocationName; +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncCreateNodeLocationnameNodeString { + + public static void main(String[] args) throws Exception { + syncCreateNodeLocationnameNodeString(); + } + + public static void syncCreateNodeLocationnameNodeString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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(); + } + } +} +// [END tpu_v1_generated_tpuclient_createnode_locationnamenodestring_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/createnode/SyncCreateNodeStringNodeString.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/createnode/SyncCreateNodeStringNodeString.java new file mode 100644 index 000000000000..2be8b6f66174 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/createnode/SyncCreateNodeStringNodeString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_createnode_stringnodestring_sync] +import com.google.cloud.tpu.v1.LocationName; +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncCreateNodeStringNodeString { + + public static void main(String[] args) throws Exception { + syncCreateNodeStringNodeString(); + } + + public static void syncCreateNodeStringNodeString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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(); + } + } +} +// [END tpu_v1_generated_tpuclient_createnode_stringnodestring_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/deletenode/AsyncDeleteNode.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/deletenode/AsyncDeleteNode.java new file mode 100644 index 000000000000..e208941b885a --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/deletenode/AsyncDeleteNode.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_deletenode_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v1.DeleteNodeRequest; +import com.google.cloud.tpu.v1.NodeName; +import com.google.cloud.tpu.v1.TpuClient; +import com.google.longrunning.Operation; + +public class AsyncDeleteNode { + + public static void main(String[] args) throws Exception { + asyncDeleteNode(); + } + + public static void asyncDeleteNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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(); + } + } +} +// [END tpu_v1_generated_tpuclient_deletenode_async] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/deletenode/AsyncDeleteNodeLRO.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/deletenode/AsyncDeleteNodeLRO.java new file mode 100644 index 000000000000..4a27ea1f06c4 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/deletenode/AsyncDeleteNodeLRO.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_deletenode_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.tpu.v1.DeleteNodeRequest; +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.NodeName; +import com.google.cloud.tpu.v1.OperationMetadata; +import com.google.cloud.tpu.v1.TpuClient; + +public class AsyncDeleteNodeLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteNodeLRO(); + } + + public static void asyncDeleteNodeLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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(); + } + } +} +// [END tpu_v1_generated_tpuclient_deletenode_lro_async] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/deletenode/SyncDeleteNode.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/deletenode/SyncDeleteNode.java new file mode 100644 index 000000000000..e4a1668a5ade --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/deletenode/SyncDeleteNode.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_deletenode_sync] +import com.google.cloud.tpu.v1.DeleteNodeRequest; +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.NodeName; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncDeleteNode { + + public static void main(String[] args) throws Exception { + syncDeleteNode(); + } + + public static void syncDeleteNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + DeleteNodeRequest request = + DeleteNodeRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); + Node response = tpuClient.deleteNodeAsync(request).get(); + } + } +} +// [END tpu_v1_generated_tpuclient_deletenode_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/deletenode/SyncDeleteNodeNodename.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/deletenode/SyncDeleteNodeNodename.java new file mode 100644 index 000000000000..3648088d21f6 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/deletenode/SyncDeleteNodeNodename.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_deletenode_nodename_sync] +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.NodeName; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncDeleteNodeNodename { + + public static void main(String[] args) throws Exception { + syncDeleteNodeNodename(); + } + + public static void syncDeleteNodeNodename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); + Node response = tpuClient.deleteNodeAsync(name).get(); + } + } +} +// [END tpu_v1_generated_tpuclient_deletenode_nodename_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/deletenode/SyncDeleteNodeString.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/deletenode/SyncDeleteNodeString.java new file mode 100644 index 000000000000..9f6d56cec7bd --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/deletenode/SyncDeleteNodeString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_deletenode_string_sync] +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.NodeName; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncDeleteNodeString { + + public static void main(String[] args) throws Exception { + syncDeleteNodeString(); + } + + public static void syncDeleteNodeString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + String name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString(); + Node response = tpuClient.deleteNodeAsync(name).get(); + } + } +} +// [END tpu_v1_generated_tpuclient_deletenode_string_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getacceleratortype/AsyncGetAcceleratorType.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getacceleratortype/AsyncGetAcceleratorType.java new file mode 100644 index 000000000000..9bc876032e89 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getacceleratortype/AsyncGetAcceleratorType.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_getacceleratortype_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v1.AcceleratorType; +import com.google.cloud.tpu.v1.AcceleratorTypeName; +import com.google.cloud.tpu.v1.GetAcceleratorTypeRequest; +import com.google.cloud.tpu.v1.TpuClient; + +public class AsyncGetAcceleratorType { + + public static void main(String[] args) throws Exception { + asyncGetAcceleratorType(); + } + + public static void asyncGetAcceleratorType() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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(); + } + } +} +// [END tpu_v1_generated_tpuclient_getacceleratortype_async] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getacceleratortype/SyncGetAcceleratorType.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getacceleratortype/SyncGetAcceleratorType.java new file mode 100644 index 000000000000..315664040774 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getacceleratortype/SyncGetAcceleratorType.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_getacceleratortype_sync] +import com.google.cloud.tpu.v1.AcceleratorType; +import com.google.cloud.tpu.v1.AcceleratorTypeName; +import com.google.cloud.tpu.v1.GetAcceleratorTypeRequest; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncGetAcceleratorType { + + public static void main(String[] args) throws Exception { + syncGetAcceleratorType(); + } + + public static void syncGetAcceleratorType() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + GetAcceleratorTypeRequest request = + GetAcceleratorTypeRequest.newBuilder() + .setName( + AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]") + .toString()) + .build(); + AcceleratorType response = tpuClient.getAcceleratorType(request); + } + } +} +// [END tpu_v1_generated_tpuclient_getacceleratortype_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getacceleratortype/SyncGetAcceleratorTypeAcceleratortypename.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getacceleratortype/SyncGetAcceleratorTypeAcceleratortypename.java new file mode 100644 index 000000000000..cfa3cb6b4b73 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getacceleratortype/SyncGetAcceleratorTypeAcceleratortypename.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_getacceleratortype_acceleratortypename_sync] +import com.google.cloud.tpu.v1.AcceleratorType; +import com.google.cloud.tpu.v1.AcceleratorTypeName; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncGetAcceleratorTypeAcceleratortypename { + + public static void main(String[] args) throws Exception { + syncGetAcceleratorTypeAcceleratortypename(); + } + + public static void syncGetAcceleratorTypeAcceleratortypename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + AcceleratorTypeName name = + AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]"); + AcceleratorType response = tpuClient.getAcceleratorType(name); + } + } +} +// [END tpu_v1_generated_tpuclient_getacceleratortype_acceleratortypename_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getacceleratortype/SyncGetAcceleratorTypeString.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getacceleratortype/SyncGetAcceleratorTypeString.java new file mode 100644 index 000000000000..dadf40e27cb1 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getacceleratortype/SyncGetAcceleratorTypeString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_getacceleratortype_string_sync] +import com.google.cloud.tpu.v1.AcceleratorType; +import com.google.cloud.tpu.v1.AcceleratorTypeName; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncGetAcceleratorTypeString { + + public static void main(String[] args) throws Exception { + syncGetAcceleratorTypeString(); + } + + public static void syncGetAcceleratorTypeString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + String name = + AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]").toString(); + AcceleratorType response = tpuClient.getAcceleratorType(name); + } + } +} +// [END tpu_v1_generated_tpuclient_getacceleratortype_string_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getnode/AsyncGetNode.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getnode/AsyncGetNode.java new file mode 100644 index 000000000000..5e0a593c75a6 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getnode/AsyncGetNode.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_getnode_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v1.GetNodeRequest; +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.NodeName; +import com.google.cloud.tpu.v1.TpuClient; + +public class AsyncGetNode { + + public static void main(String[] args) throws Exception { + asyncGetNode(); + } + + public static void asyncGetNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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(); + } + } +} +// [END tpu_v1_generated_tpuclient_getnode_async] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getnode/SyncGetNode.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getnode/SyncGetNode.java new file mode 100644 index 000000000000..8a20b0a299e8 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getnode/SyncGetNode.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_getnode_sync] +import com.google.cloud.tpu.v1.GetNodeRequest; +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.NodeName; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncGetNode { + + public static void main(String[] args) throws Exception { + syncGetNode(); + } + + public static void syncGetNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + GetNodeRequest request = + GetNodeRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); + Node response = tpuClient.getNode(request); + } + } +} +// [END tpu_v1_generated_tpuclient_getnode_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getnode/SyncGetNodeNodename.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getnode/SyncGetNodeNodename.java new file mode 100644 index 000000000000..669352936062 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getnode/SyncGetNodeNodename.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_getnode_nodename_sync] +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.NodeName; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncGetNodeNodename { + + public static void main(String[] args) throws Exception { + syncGetNodeNodename(); + } + + public static void syncGetNodeNodename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); + Node response = tpuClient.getNode(name); + } + } +} +// [END tpu_v1_generated_tpuclient_getnode_nodename_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getnode/SyncGetNodeString.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getnode/SyncGetNodeString.java new file mode 100644 index 000000000000..1527e6e0936a --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/getnode/SyncGetNodeString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_getnode_string_sync] +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.NodeName; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncGetNodeString { + + public static void main(String[] args) throws Exception { + syncGetNodeString(); + } + + public static void syncGetNodeString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + String name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString(); + Node response = tpuClient.getNode(name); + } + } +} +// [END tpu_v1_generated_tpuclient_getnode_string_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/gettensorflowversion/AsyncGetTensorFlowVersion.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/gettensorflowversion/AsyncGetTensorFlowVersion.java new file mode 100644 index 000000000000..bbf69d561c3d --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/gettensorflowversion/AsyncGetTensorFlowVersion.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_gettensorflowversion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v1.GetTensorFlowVersionRequest; +import com.google.cloud.tpu.v1.TensorFlowVersion; +import com.google.cloud.tpu.v1.TensorFlowVersionName; +import com.google.cloud.tpu.v1.TpuClient; + +public class AsyncGetTensorFlowVersion { + + public static void main(String[] args) throws Exception { + asyncGetTensorFlowVersion(); + } + + public static void asyncGetTensorFlowVersion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + GetTensorFlowVersionRequest request = + GetTensorFlowVersionRequest.newBuilder() + .setName( + TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]") + .toString()) + .build(); + ApiFuture future = + tpuClient.getTensorFlowVersionCallable().futureCall(request); + // Do something. + TensorFlowVersion response = future.get(); + } + } +} +// [END tpu_v1_generated_tpuclient_gettensorflowversion_async] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/gettensorflowversion/SyncGetTensorFlowVersion.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/gettensorflowversion/SyncGetTensorFlowVersion.java new file mode 100644 index 000000000000..85247f48a1b4 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/gettensorflowversion/SyncGetTensorFlowVersion.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_gettensorflowversion_sync] +import com.google.cloud.tpu.v1.GetTensorFlowVersionRequest; +import com.google.cloud.tpu.v1.TensorFlowVersion; +import com.google.cloud.tpu.v1.TensorFlowVersionName; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncGetTensorFlowVersion { + + public static void main(String[] args) throws Exception { + syncGetTensorFlowVersion(); + } + + public static void syncGetTensorFlowVersion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + GetTensorFlowVersionRequest request = + GetTensorFlowVersionRequest.newBuilder() + .setName( + TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]") + .toString()) + .build(); + TensorFlowVersion response = tpuClient.getTensorFlowVersion(request); + } + } +} +// [END tpu_v1_generated_tpuclient_gettensorflowversion_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/gettensorflowversion/SyncGetTensorFlowVersionString.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/gettensorflowversion/SyncGetTensorFlowVersionString.java new file mode 100644 index 000000000000..2c70fab7b3ab --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/gettensorflowversion/SyncGetTensorFlowVersionString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_gettensorflowversion_string_sync] +import com.google.cloud.tpu.v1.TensorFlowVersion; +import com.google.cloud.tpu.v1.TensorFlowVersionName; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncGetTensorFlowVersionString { + + public static void main(String[] args) throws Exception { + syncGetTensorFlowVersionString(); + } + + public static void syncGetTensorFlowVersionString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + String name = + TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]").toString(); + TensorFlowVersion response = tpuClient.getTensorFlowVersion(name); + } + } +} +// [END tpu_v1_generated_tpuclient_gettensorflowversion_string_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/gettensorflowversion/SyncGetTensorFlowVersionTensorflowversionname.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/gettensorflowversion/SyncGetTensorFlowVersionTensorflowversionname.java new file mode 100644 index 000000000000..8e1d6cfb6eab --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/gettensorflowversion/SyncGetTensorFlowVersionTensorflowversionname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_gettensorflowversion_tensorflowversionname_sync] +import com.google.cloud.tpu.v1.TensorFlowVersion; +import com.google.cloud.tpu.v1.TensorFlowVersionName; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncGetTensorFlowVersionTensorflowversionname { + + public static void main(String[] args) throws Exception { + syncGetTensorFlowVersionTensorflowversionname(); + } + + public static void syncGetTensorFlowVersionTensorflowversionname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + TensorFlowVersionName name = + TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]"); + TensorFlowVersion response = tpuClient.getTensorFlowVersion(name); + } + } +} +// [END tpu_v1_generated_tpuclient_gettensorflowversion_tensorflowversionname_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listacceleratortypes/AsyncListAcceleratorTypes.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listacceleratortypes/AsyncListAcceleratorTypes.java new file mode 100644 index 000000000000..628271b920c7 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listacceleratortypes/AsyncListAcceleratorTypes.java @@ -0,0 +1,58 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_listacceleratortypes_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v1.AcceleratorType; +import com.google.cloud.tpu.v1.AcceleratorTypeName; +import com.google.cloud.tpu.v1.ListAcceleratorTypesRequest; +import com.google.cloud.tpu.v1.TpuClient; + +public class AsyncListAcceleratorTypes { + + public static void main(String[] args) throws Exception { + asyncListAcceleratorTypes(); + } + + public static void asyncListAcceleratorTypes() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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); + } + } + } +} +// [END tpu_v1_generated_tpuclient_listacceleratortypes_async] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listacceleratortypes/AsyncListAcceleratorTypesPaged.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listacceleratortypes/AsyncListAcceleratorTypesPaged.java new file mode 100644 index 000000000000..7adfc638a723 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listacceleratortypes/AsyncListAcceleratorTypesPaged.java @@ -0,0 +1,66 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_listacceleratortypes_paged_async] +import com.google.cloud.tpu.v1.AcceleratorType; +import com.google.cloud.tpu.v1.AcceleratorTypeName; +import com.google.cloud.tpu.v1.ListAcceleratorTypesRequest; +import com.google.cloud.tpu.v1.ListAcceleratorTypesResponse; +import com.google.cloud.tpu.v1.TpuClient; +import com.google.common.base.Strings; + +public class AsyncListAcceleratorTypesPaged { + + public static void main(String[] args) throws Exception { + asyncListAcceleratorTypesPaged(); + } + + public static void asyncListAcceleratorTypesPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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.getAcceleratorTypesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END tpu_v1_generated_tpuclient_listacceleratortypes_paged_async] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listacceleratortypes/SyncListAcceleratorTypes.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listacceleratortypes/SyncListAcceleratorTypes.java new file mode 100644 index 000000000000..fc7a5b5d71b6 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listacceleratortypes/SyncListAcceleratorTypes.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_listacceleratortypes_sync] +import com.google.cloud.tpu.v1.AcceleratorType; +import com.google.cloud.tpu.v1.AcceleratorTypeName; +import com.google.cloud.tpu.v1.ListAcceleratorTypesRequest; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncListAcceleratorTypes { + + public static void main(String[] args) throws Exception { + syncListAcceleratorTypes(); + } + + public static void syncListAcceleratorTypes() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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); + } + } + } +} +// [END tpu_v1_generated_tpuclient_listacceleratortypes_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listacceleratortypes/SyncListAcceleratorTypesAcceleratortypename.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listacceleratortypes/SyncListAcceleratorTypesAcceleratortypename.java new file mode 100644 index 000000000000..401ac381de21 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listacceleratortypes/SyncListAcceleratorTypesAcceleratortypename.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_listacceleratortypes_acceleratortypename_sync] +import com.google.cloud.tpu.v1.AcceleratorType; +import com.google.cloud.tpu.v1.AcceleratorTypeName; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncListAcceleratorTypesAcceleratortypename { + + public static void main(String[] args) throws Exception { + syncListAcceleratorTypesAcceleratortypename(); + } + + public static void syncListAcceleratorTypesAcceleratortypename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + AcceleratorTypeName parent = + AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]"); + for (AcceleratorType element : tpuClient.listAcceleratorTypes(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v1_generated_tpuclient_listacceleratortypes_acceleratortypename_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listacceleratortypes/SyncListAcceleratorTypesString.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listacceleratortypes/SyncListAcceleratorTypesString.java new file mode 100644 index 000000000000..2a343757516c --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listacceleratortypes/SyncListAcceleratorTypesString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_listacceleratortypes_string_sync] +import com.google.cloud.tpu.v1.AcceleratorType; +import com.google.cloud.tpu.v1.AcceleratorTypeName; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncListAcceleratorTypesString { + + public static void main(String[] args) throws Exception { + syncListAcceleratorTypesString(); + } + + public static void syncListAcceleratorTypesString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + String parent = + AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]").toString(); + for (AcceleratorType element : tpuClient.listAcceleratorTypes(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v1_generated_tpuclient_listacceleratortypes_string_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listnodes/AsyncListNodes.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listnodes/AsyncListNodes.java new file mode 100644 index 000000000000..66e789d57314 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listnodes/AsyncListNodes.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_listnodes_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v1.ListNodesRequest; +import com.google.cloud.tpu.v1.LocationName; +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.TpuClient; + +public class AsyncListNodes { + + public static void main(String[] args) throws Exception { + asyncListNodes(); + } + + public static void asyncListNodes() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + ListNodesRequest request = + ListNodesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = tpuClient.listNodesPagedCallable().futureCall(request); + // Do something. + for (Node element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v1_generated_tpuclient_listnodes_async] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listnodes/AsyncListNodesPaged.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listnodes/AsyncListNodesPaged.java new file mode 100644 index 000000000000..a979a45575ca --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listnodes/AsyncListNodesPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_listnodes_paged_async] +import com.google.cloud.tpu.v1.ListNodesRequest; +import com.google.cloud.tpu.v1.ListNodesResponse; +import com.google.cloud.tpu.v1.LocationName; +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.TpuClient; +import com.google.common.base.Strings; + +public class AsyncListNodesPaged { + + public static void main(String[] args) throws Exception { + asyncListNodesPaged(); + } + + public static void asyncListNodesPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + ListNodesRequest request = + ListNodesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListNodesResponse response = tpuClient.listNodesCallable().call(request); + for (Node element : response.getNodesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END tpu_v1_generated_tpuclient_listnodes_paged_async] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listnodes/SyncListNodes.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listnodes/SyncListNodes.java new file mode 100644 index 000000000000..cfd2ef7be750 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listnodes/SyncListNodes.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_listnodes_sync] +import com.google.cloud.tpu.v1.ListNodesRequest; +import com.google.cloud.tpu.v1.LocationName; +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncListNodes { + + public static void main(String[] args) throws Exception { + syncListNodes(); + } + + public static void syncListNodes() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + ListNodesRequest request = + ListNodesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Node element : tpuClient.listNodes(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v1_generated_tpuclient_listnodes_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listnodes/SyncListNodesLocationname.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listnodes/SyncListNodesLocationname.java new file mode 100644 index 000000000000..6cc8ed87b40c --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listnodes/SyncListNodesLocationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_listnodes_locationname_sync] +import com.google.cloud.tpu.v1.LocationName; +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncListNodesLocationname { + + public static void main(String[] args) throws Exception { + syncListNodesLocationname(); + } + + public static void syncListNodesLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Node element : tpuClient.listNodes(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v1_generated_tpuclient_listnodes_locationname_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listnodes/SyncListNodesString.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listnodes/SyncListNodesString.java new file mode 100644 index 000000000000..60493c99f2f0 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listnodes/SyncListNodesString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_listnodes_string_sync] +import com.google.cloud.tpu.v1.LocationName; +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncListNodesString { + + public static void main(String[] args) throws Exception { + syncListNodesString(); + } + + public static void syncListNodesString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Node element : tpuClient.listNodes(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v1_generated_tpuclient_listnodes_string_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listtensorflowversions/AsyncListTensorFlowVersions.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listtensorflowversions/AsyncListTensorFlowVersions.java new file mode 100644 index 000000000000..fced33adb6b4 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listtensorflowversions/AsyncListTensorFlowVersions.java @@ -0,0 +1,58 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_listtensorflowversions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest; +import com.google.cloud.tpu.v1.TensorFlowVersion; +import com.google.cloud.tpu.v1.TensorFlowVersionName; +import com.google.cloud.tpu.v1.TpuClient; + +public class AsyncListTensorFlowVersions { + + public static void main(String[] args) throws Exception { + asyncListTensorFlowVersions(); + } + + public static void asyncListTensorFlowVersions() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + ListTensorFlowVersionsRequest request = + ListTensorFlowVersionsRequest.newBuilder() + .setParent( + TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + tpuClient.listTensorFlowVersionsPagedCallable().futureCall(request); + // Do something. + for (TensorFlowVersion element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v1_generated_tpuclient_listtensorflowversions_async] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listtensorflowversions/AsyncListTensorFlowVersionsPaged.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listtensorflowversions/AsyncListTensorFlowVersionsPaged.java new file mode 100644 index 000000000000..a052350dedfd --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listtensorflowversions/AsyncListTensorFlowVersionsPaged.java @@ -0,0 +1,66 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_listtensorflowversions_paged_async] +import com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest; +import com.google.cloud.tpu.v1.ListTensorFlowVersionsResponse; +import com.google.cloud.tpu.v1.TensorFlowVersion; +import com.google.cloud.tpu.v1.TensorFlowVersionName; +import com.google.cloud.tpu.v1.TpuClient; +import com.google.common.base.Strings; + +public class AsyncListTensorFlowVersionsPaged { + + public static void main(String[] args) throws Exception { + asyncListTensorFlowVersionsPaged(); + } + + public static void asyncListTensorFlowVersionsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + ListTensorFlowVersionsRequest request = + ListTensorFlowVersionsRequest.newBuilder() + .setParent( + TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListTensorFlowVersionsResponse response = + tpuClient.listTensorFlowVersionsCallable().call(request); + for (TensorFlowVersion element : response.getTensorflowVersionsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END tpu_v1_generated_tpuclient_listtensorflowversions_paged_async] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listtensorflowversions/SyncListTensorFlowVersions.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listtensorflowversions/SyncListTensorFlowVersions.java new file mode 100644 index 000000000000..86fc5c6cd069 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listtensorflowversions/SyncListTensorFlowVersions.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_listtensorflowversions_sync] +import com.google.cloud.tpu.v1.ListTensorFlowVersionsRequest; +import com.google.cloud.tpu.v1.TensorFlowVersion; +import com.google.cloud.tpu.v1.TensorFlowVersionName; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncListTensorFlowVersions { + + public static void main(String[] args) throws Exception { + syncListTensorFlowVersions(); + } + + public static void syncListTensorFlowVersions() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + ListTensorFlowVersionsRequest request = + ListTensorFlowVersionsRequest.newBuilder() + .setParent( + TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (TensorFlowVersion element : tpuClient.listTensorFlowVersions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v1_generated_tpuclient_listtensorflowversions_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listtensorflowversions/SyncListTensorFlowVersionsString.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listtensorflowversions/SyncListTensorFlowVersionsString.java new file mode 100644 index 000000000000..74551315ed19 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listtensorflowversions/SyncListTensorFlowVersionsString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_listtensorflowversions_string_sync] +import com.google.cloud.tpu.v1.TensorFlowVersion; +import com.google.cloud.tpu.v1.TensorFlowVersionName; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncListTensorFlowVersionsString { + + public static void main(String[] args) throws Exception { + syncListTensorFlowVersionsString(); + } + + public static void syncListTensorFlowVersionsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + String parent = + TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]").toString(); + for (TensorFlowVersion element : tpuClient.listTensorFlowVersions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v1_generated_tpuclient_listtensorflowversions_string_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listtensorflowversions/SyncListTensorFlowVersionsTensorflowversionname.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listtensorflowversions/SyncListTensorFlowVersionsTensorflowversionname.java new file mode 100644 index 000000000000..d5318914ccb2 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/listtensorflowversions/SyncListTensorFlowVersionsTensorflowversionname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_listtensorflowversions_tensorflowversionname_sync] +import com.google.cloud.tpu.v1.TensorFlowVersion; +import com.google.cloud.tpu.v1.TensorFlowVersionName; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncListTensorFlowVersionsTensorflowversionname { + + public static void main(String[] args) throws Exception { + syncListTensorFlowVersionsTensorflowversionname(); + } + + public static void syncListTensorFlowVersionsTensorflowversionname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + TensorFlowVersionName parent = + TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]"); + for (TensorFlowVersion element : tpuClient.listTensorFlowVersions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v1_generated_tpuclient_listtensorflowversions_tensorflowversionname_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/reimagenode/AsyncReimageNode.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/reimagenode/AsyncReimageNode.java new file mode 100644 index 000000000000..f36cbe5f1c35 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/reimagenode/AsyncReimageNode.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_reimagenode_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v1.ReimageNodeRequest; +import com.google.cloud.tpu.v1.TpuClient; +import com.google.longrunning.Operation; + +public class AsyncReimageNode { + + public static void main(String[] args) throws Exception { + asyncReimageNode(); + } + + public static void asyncReimageNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + ReimageNodeRequest request = + ReimageNodeRequest.newBuilder() + .setName("name3373707") + .setTensorflowVersion("tensorflowVersion-470125103") + .build(); + ApiFuture future = tpuClient.reimageNodeCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END tpu_v1_generated_tpuclient_reimagenode_async] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/reimagenode/AsyncReimageNodeLRO.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/reimagenode/AsyncReimageNodeLRO.java new file mode 100644 index 000000000000..55c81051b2f0 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/reimagenode/AsyncReimageNodeLRO.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_reimagenode_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.OperationMetadata; +import com.google.cloud.tpu.v1.ReimageNodeRequest; +import com.google.cloud.tpu.v1.TpuClient; + +public class AsyncReimageNodeLRO { + + public static void main(String[] args) throws Exception { + asyncReimageNodeLRO(); + } + + public static void asyncReimageNodeLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + ReimageNodeRequest request = + ReimageNodeRequest.newBuilder() + .setName("name3373707") + .setTensorflowVersion("tensorflowVersion-470125103") + .build(); + OperationFuture future = + tpuClient.reimageNodeOperationCallable().futureCall(request); + // Do something. + Node response = future.get(); + } + } +} +// [END tpu_v1_generated_tpuclient_reimagenode_lro_async] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/reimagenode/SyncReimageNode.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/reimagenode/SyncReimageNode.java new file mode 100644 index 000000000000..8e3793b5bbf7 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/reimagenode/SyncReimageNode.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_reimagenode_sync] +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.ReimageNodeRequest; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncReimageNode { + + public static void main(String[] args) throws Exception { + syncReimageNode(); + } + + public static void syncReimageNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + ReimageNodeRequest request = + ReimageNodeRequest.newBuilder() + .setName("name3373707") + .setTensorflowVersion("tensorflowVersion-470125103") + .build(); + Node response = tpuClient.reimageNodeAsync(request).get(); + } + } +} +// [END tpu_v1_generated_tpuclient_reimagenode_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/startnode/AsyncStartNode.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/startnode/AsyncStartNode.java new file mode 100644 index 000000000000..8ce3dcfeb103 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/startnode/AsyncStartNode.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_startnode_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v1.StartNodeRequest; +import com.google.cloud.tpu.v1.TpuClient; +import com.google.longrunning.Operation; + +public class AsyncStartNode { + + public static void main(String[] args) throws Exception { + asyncStartNode(); + } + + public static void asyncStartNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + StartNodeRequest request = StartNodeRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = tpuClient.startNodeCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END tpu_v1_generated_tpuclient_startnode_async] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/startnode/AsyncStartNodeLRO.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/startnode/AsyncStartNodeLRO.java new file mode 100644 index 000000000000..fc2bb43e4728 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/startnode/AsyncStartNodeLRO.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_startnode_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.OperationMetadata; +import com.google.cloud.tpu.v1.StartNodeRequest; +import com.google.cloud.tpu.v1.TpuClient; + +public class AsyncStartNodeLRO { + + public static void main(String[] args) throws Exception { + asyncStartNodeLRO(); + } + + public static void asyncStartNodeLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + StartNodeRequest request = StartNodeRequest.newBuilder().setName("name3373707").build(); + OperationFuture future = + tpuClient.startNodeOperationCallable().futureCall(request); + // Do something. + Node response = future.get(); + } + } +} +// [END tpu_v1_generated_tpuclient_startnode_lro_async] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/startnode/SyncStartNode.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/startnode/SyncStartNode.java new file mode 100644 index 000000000000..32e716469c42 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/startnode/SyncStartNode.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_startnode_sync] +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.StartNodeRequest; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncStartNode { + + public static void main(String[] args) throws Exception { + syncStartNode(); + } + + public static void syncStartNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + StartNodeRequest request = StartNodeRequest.newBuilder().setName("name3373707").build(); + Node response = tpuClient.startNodeAsync(request).get(); + } + } +} +// [END tpu_v1_generated_tpuclient_startnode_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/stopnode/AsyncStopNode.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/stopnode/AsyncStopNode.java new file mode 100644 index 000000000000..ce4bd5ffb949 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/stopnode/AsyncStopNode.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_stopnode_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v1.StopNodeRequest; +import com.google.cloud.tpu.v1.TpuClient; +import com.google.longrunning.Operation; + +public class AsyncStopNode { + + public static void main(String[] args) throws Exception { + asyncStopNode(); + } + + public static void asyncStopNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + StopNodeRequest request = StopNodeRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = tpuClient.stopNodeCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END tpu_v1_generated_tpuclient_stopnode_async] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/stopnode/AsyncStopNodeLRO.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/stopnode/AsyncStopNodeLRO.java new file mode 100644 index 000000000000..db1ab1cef974 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/stopnode/AsyncStopNodeLRO.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_stopnode_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.OperationMetadata; +import com.google.cloud.tpu.v1.StopNodeRequest; +import com.google.cloud.tpu.v1.TpuClient; + +public class AsyncStopNodeLRO { + + public static void main(String[] args) throws Exception { + asyncStopNodeLRO(); + } + + public static void asyncStopNodeLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + StopNodeRequest request = StopNodeRequest.newBuilder().setName("name3373707").build(); + OperationFuture future = + tpuClient.stopNodeOperationCallable().futureCall(request); + // Do something. + Node response = future.get(); + } + } +} +// [END tpu_v1_generated_tpuclient_stopnode_lro_async] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/stopnode/SyncStopNode.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/stopnode/SyncStopNode.java new file mode 100644 index 000000000000..ade9a76a8607 --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/stopnode/SyncStopNode.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpuclient_stopnode_sync] +import com.google.cloud.tpu.v1.Node; +import com.google.cloud.tpu.v1.StopNodeRequest; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncStopNode { + + public static void main(String[] args) throws Exception { + syncStopNode(); + } + + public static void syncStopNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + StopNodeRequest request = StopNodeRequest.newBuilder().setName("name3373707").build(); + Node response = tpuClient.stopNodeAsync(request).get(); + } + } +} +// [END tpu_v1_generated_tpuclient_stopnode_sync] diff --git a/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpusettings/getnode/SyncGetNode.java b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpusettings/getnode/SyncGetNode.java new file mode 100644 index 000000000000..043c66b8352b --- /dev/null +++ b/owl-bot-staging/java-tpu/v1/samples/snippets/generated/com/google/cloud/tpu/v1/tpusettings/getnode/SyncGetNode.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1.samples; + +// [START tpu_v1_generated_tpusettings_getnode_sync] +import com.google.cloud.tpu.v1.TpuSettings; +import java.time.Duration; + +public class SyncGetNode { + + public static void main(String[] args) throws Exception { + syncGetNode(); + } + + public static void syncGetNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + TpuSettings.Builder tpuSettingsBuilder = TpuSettings.newBuilder(); + tpuSettingsBuilder + .getNodeSettings() + .setRetrySettings( + tpuSettingsBuilder.getNodeSettings().getRetrySettings().toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + TpuSettings tpuSettings = tpuSettingsBuilder.build(); + } +} +// [END tpu_v1_generated_tpusettings_getnode_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuClient.java b/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuClient.java new file mode 100644 index 000000000000..7a1fbd831549 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuClient.java @@ -0,0 +1,1977 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.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
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * 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
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * TpuSettings tpuSettings =
+ *     TpuSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * TpuClient tpuClient = TpuClient.create(tpuSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * 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). + */ + 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()); + } + + protected TpuClient(TpuStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final TpuSettings getSettings() { + return settings; + } + + 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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.getNodesList()) {
+   *       // 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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.getAcceleratorTypesList()) {
+   *       // 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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.getRuntimeVersionsList()) {
+   *       // 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * 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/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuSettings.java b/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuSettings.java new file mode 100644 index 000000000000..3bcc3ac16b7e --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuSettings.java @@ -0,0 +1,394 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.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.StubSettings; +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
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * 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/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/gapic_metadata.json b/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/gapic_metadata.json new file mode 100644 index 000000000000..db678f19cbc3 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/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/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/package-info.java b/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/package-info.java new file mode 100644 index 000000000000..556bc1c77ba5 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/package-info.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to 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
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * 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/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/GrpcTpuCallableFactory.java b/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/GrpcTpuCallableFactory.java new file mode 100644 index 000000000000..98e979c2ef27 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/GrpcTpuCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/GrpcTpuStub.java b/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/GrpcTpuStub.java new file mode 100644 index 000000000000..27fb59a72b2e --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/GrpcTpuStub.java @@ -0,0 +1,655 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.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.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Tpu service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@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/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStub.java b/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStub.java new file mode 100644 index 000000000000..02185bf703a8 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStub.java @@ -0,0 +1,162 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStubSettings.java b/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStubSettings.java new file mode 100644 index 000000000000..726f0fec79ac --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStubSettings.java @@ -0,0 +1,1018 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.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
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * 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; + } + + 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/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockTpu.java b/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockTpu.java new file mode 100644 index 000000000000..d680ccbb8959 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockTpu.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockTpuImpl.java b/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockTpuImpl.java new file mode 100644 index 000000000000..54096f705d73 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockTpuImpl.java @@ -0,0 +1,332 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/TpuClientTest.java b/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/TpuClientTest.java new file mode 100644 index 000000000000..79115b13271b --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/TpuClientTest.java @@ -0,0 +1,1184 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.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()) + .setShieldedInstanceConfig(ShieldedInstanceConfig.newBuilder().build()) + .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()) + .setShieldedInstanceConfig(ShieldedInstanceConfig.newBuilder().build()) + .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()) + .setShieldedInstanceConfig(ShieldedInstanceConfig.newBuilder().build()) + .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()) + .setShieldedInstanceConfig(ShieldedInstanceConfig.newBuilder().build()) + .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()) + .setShieldedInstanceConfig(ShieldedInstanceConfig.newBuilder().build()) + .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()) + .setShieldedInstanceConfig(ShieldedInstanceConfig.newBuilder().build()) + .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()) + .setShieldedInstanceConfig(ShieldedInstanceConfig.newBuilder().build()) + .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()) + .setShieldedInstanceConfig(ShieldedInstanceConfig.newBuilder().build()) + .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()) + .setShieldedInstanceConfig(ShieldedInstanceConfig.newBuilder().build()) + .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/owl-bot-staging/java-tpu/v2alpha1/grpc-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/TpuGrpc.java b/owl-bot-staging/java-tpu/v2alpha1/grpc-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/TpuGrpc.java new file mode 100644 index 000000000000..37dfaaf024de --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/grpc-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/TpuGrpc.java @@ -0,0 +1,1340 @@ +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") +@io.grpc.stub.annotations.GrpcGenerated +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 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 getListNodesMethod() { + io.grpc.MethodDescriptor 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 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 getGetNodeMethod() { + io.grpc.MethodDescriptor getGetNodeMethod; + if ((getGetNodeMethod = TpuGrpc.getGetNodeMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getGetNodeMethod = TpuGrpc.getGetNodeMethod) == null) { + TpuGrpc.getGetNodeMethod = getGetNodeMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetNode")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.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 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 getCreateNodeMethod() { + io.grpc.MethodDescriptor 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 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 getDeleteNodeMethod() { + io.grpc.MethodDescriptor 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 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 getStopNodeMethod() { + io.grpc.MethodDescriptor 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 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 getStartNodeMethod() { + io.grpc.MethodDescriptor 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 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 getUpdateNodeMethod() { + io.grpc.MethodDescriptor 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 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 getGenerateServiceIdentityMethod() { + io.grpc.MethodDescriptor 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 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 getListAcceleratorTypesMethod() { + io.grpc.MethodDescriptor 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 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 getGetAcceleratorTypeMethod() { + io.grpc.MethodDescriptor 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 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 getListRuntimeVersionsMethod() { + io.grpc.MethodDescriptor 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 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 getGetRuntimeVersionMethod() { + io.grpc.MethodDescriptor 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 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 getGetGuestAttributesMethod() { + io.grpc.MethodDescriptor 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 static abstract 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 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 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 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 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 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 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 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) responseObserver); + break; + case METHODID_LIST_ACCELERATOR_TYPES: + serviceImpl.listAcceleratorTypes((com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest) request, + (io.grpc.stub.StreamObserver) 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) 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) 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 static abstract 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorType.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorType.java new file mode 100644 index 000000000000..d75113261ecf --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorType.java @@ -0,0 +1,761 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorTypeName.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorTypeName.java new file mode 100644 index 000000000000..f9c364852c39 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorTypeName.java @@ -0,0 +1,227 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorTypeOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorTypeOrBuilder.java new file mode 100644 index 000000000000..961b59c1216c --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorTypeOrBuilder.java @@ -0,0 +1,49 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AccessConfig.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AccessConfig.java new file mode 100644 index 000000000000..f9bc2d2564c5 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AccessConfig.java @@ -0,0 +1,595 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AccessConfigOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AccessConfigOrBuilder.java new file mode 100644 index 000000000000..f8ae5ed04810 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AccessConfigOrBuilder.java @@ -0,0 +1,29 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AttachedDisk.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AttachedDisk.java new file mode 100644 index 000000000000..bc2123e95ae5 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AttachedDisk.java @@ -0,0 +1,891 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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< + DiskMode> 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AttachedDiskOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AttachedDiskOrBuilder.java new file mode 100644 index 000000000000..e1a6a845faa7 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AttachedDiskOrBuilder.java @@ -0,0 +1,54 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CloudTpuProto.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CloudTpuProto.java new file mode 100644 index 000000000000..17b5f521720a --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CloudTpuProto.java @@ -0,0 +1,665 @@ +// 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; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_ShieldedInstanceConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_ShieldedInstanceConfig_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\"\360" + + "\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\022S\n\030shielded_instance_config\030- \001(\01321.g" + + "oogle.cloud.tpu.v2alpha1.ShieldedInstanc" + + "eConfig\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" + + "alue\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\021STA" + + "TE_UNSPECIFIED\020\000\022\014\n\010CREATING\020\001\022\t\n\005READY\020" + + "\002\022\016\n\nRESTARTING\020\003\022\r\n\tREIMAGING\020\004\022\014\n\010DELE" + + "TING\020\005\022\r\n\tREPAIRING\020\006\022\013\n\007STOPPED\020\010\022\014\n\010ST" + + "OPPING\020\t\022\014\n\010STARTING\020\n\022\r\n\tPREEMPTED\020\013\022\016\n" + + "\nTERMINATED\020\014\022\n\n\006HIDING\020\r\022\n\n\006HIDDEN\020\016\022\014\n" + + "\010UNHIDING\020\017\"o\n\006Health\022\026\n\022HEALTH_UNSPECIF" + + "IED\020\000\022\013\n\007HEALTHY\020\001\022\013\n\007TIMEOUT\020\003\022\030\n\024UNHEA" + + "LTHY_TENSORFLOW\020\004\022\031\n\025UNHEALTHY_MAINTENAN" + + "CE\020\005\"O\n\nApiVersion\022\033\n\027API_VERSION_UNSPEC" + + "IFIED\020\000\022\r\n\tV1_ALPHA1\020\001\022\006\n\002V1\020\002\022\r\n\tV2_ALP" + + "HA1\020\003:R\352AO\n\027tpu.googleapis.com/Node\0224pro" + + "jects/{project}/locations/{location}/nod" + + "es/{node}\"j\n\020ListNodesRequest\022/\n\006parent\030" + + "\001 \001(\tB\037\340A\002\372A\031\n\027tpu.googleapis.com/Node\022\021" + + "\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"q\n" + + "\021ListNodesResponse\022.\n\005nodes\030\001 \003(\0132\037.goog" + + "le.cloud.tpu.v2alpha1.Node\022\027\n\017next_page_" + + "token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"?\n\016GetN" + + "odeRequest\022-\n\004name\030\001 \001(\tB\037\340A\002\372A\031\n\027tpu.go" + + "ogleapis.com/Node\"\223\001\n\021CreateNodeRequest\022" + + "9\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!locations.googl" + + "eapis.com/Location\022\017\n\007node_id\030\002 \001(\t\0222\n\004n" + + "ode\030\003 \001(\0132\037.google.cloud.tpu.v2alpha1.No" + + "deB\003\340A\002\"B\n\021DeleteNodeRequest\022-\n\004name\030\001 \001" + + "(\tB\037\340A\002\372A\031\n\027tpu.googleapis.com/Node\"\037\n\017S" + + "topNodeRequest\022\014\n\004name\030\001 \001(\t\" \n\020StartNod" + + "eRequest\022\014\n\004name\030\001 \001(\t\"}\n\021UpdateNodeRequ" + + "est\0224\n\013update_mask\030\001 \001(\0132\032.google.protob" + + "uf.FieldMaskB\003\340A\002\0222\n\004node\030\002 \001(\0132\037.google" + + ".cloud.tpu.v2alpha1.NodeB\003\340A\002\" \n\017Service" + + "Identity\022\r\n\005email\030\001 \001(\t\"[\n\036GenerateServi" + + "ceIdentityRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A" + + "#\n!locations.googleapis.com/Location\"_\n\037" + + "GenerateServiceIdentityResponse\022<\n\010ident" + + "ity\030\001 \001(\0132*.google.cloud.tpu.v2alpha1.Se" + + "rviceIdentity\"\243\001\n\017AcceleratorType\022\014\n\004nam" + + "e\030\001 \001(\t\022\014\n\004type\030\002 \001(\t:t\352Aq\n\"tpu.googleap" + + "is.com/AcceleratorType\022Kprojects/{projec" + + "t}/locations/{location}/acceleratorTypes" + + "/{accelerator_type}\"U\n\031GetAcceleratorTyp" + + "eRequest\0228\n\004name\030\001 \001(\tB*\340A\002\372A$\n\"tpu.goog" + + "leapis.com/AcceleratorType\"\242\001\n\033ListAccel" + + "eratorTypesRequest\022:\n\006parent\030\001 \001(\tB*\340A\002\372" + + "A$\n\"tpu.googleapis.com/AcceleratorType\022\021" + + "\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n" + + "\006filter\030\005 \001(\t\022\020\n\010order_by\030\006 \001(\t\"\223\001\n\034List" + + "AcceleratorTypesResponse\022E\n\021accelerator_" + + "types\030\001 \003(\0132*.google.cloud.tpu.v2alpha1." + + "AcceleratorType\022\027\n\017next_page_token\030\002 \001(\t" + + "\022\023\n\013unreachable\030\003 \003(\t\"\326\001\n\021OperationMetad" + + "ata\022/\n\013create_time\030\001 \001(\0132\032.google.protob" + + "uf.Timestamp\022,\n\010end_time\030\002 \001(\0132\032.google." + + "protobuf.Timestamp\022\016\n\006target\030\003 \001(\t\022\014\n\004ve" + + "rb\030\004 \001(\t\022\025\n\rstatus_detail\030\005 \001(\t\022\030\n\020cance" + + "l_requested\030\006 \001(\010\022\023\n\013api_version\030\007 \001(\t\"\242" + + "\001\n\016RuntimeVersion\022\014\n\004name\030\001 \001(\t\022\017\n\007versi" + + "on\030\002 \001(\t:q\352An\n!tpu.googleapis.com/Runtim" + + "eVersion\022Iprojects/{project}/locations/{" + + "location}/runtimeVersions/{runtime_versi" + + "on}\"S\n\030GetRuntimeVersionRequest\0227\n\004name\030" + + "\001 \001(\tB)\340A\002\372A#\n!tpu.googleapis.com/Runtim" + + "eVersion\"\240\001\n\032ListRuntimeVersionsRequest\022" + + "9\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!tpu.googleapis." + + "com/RuntimeVersion\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\010ord" + + "er_by\030\006 \001(\t\"\220\001\n\033ListRuntimeVersionsRespo" + + "nse\022C\n\020runtime_versions\030\001 \003(\0132).google.c" + + "loud.tpu.v2alpha1.RuntimeVersion\022\027\n\017next" + + "_page_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"\313" + + "\002\n\007Symptom\022/\n\013create_time\030\001 \001(\0132\032.google" + + ".protobuf.Timestamp\022D\n\014symptom_type\030\002 \001(" + + "\0162..google.cloud.tpu.v2alpha1.Symptom.Sy" + + "mptomType\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_UN" + + "SPECIFIED\020\000\022\016\n\nLOW_MEMORY\020\001\022\021\n\rOUT_OF_ME" + + "MORY\020\002\022\025\n\021EXECUTE_TIMED_OUT\020\003\022\023\n\017MESH_BU" + + "ILD_FAIL\020\004\022\025\n\021HBM_OUT_OF_MEMORY\020\005\022\021\n\rPRO" + + "JECT_ABUSE\020\006\"r\n\031GetGuestAttributesReques" + + "t\022-\n\004name\030\001 \001(\tB\037\340A\002\372A\031\n\027tpu.googleapis." + + "com/Node\022\022\n\nquery_path\030\002 \001(\t\022\022\n\nworker_i" + + "ds\030\003 \003(\t\"b\n\032GetGuestAttributesResponse\022D" + + "\n\020guest_attributes\030\001 \003(\0132*.google.cloud." + + "tpu.v2alpha1.GuestAttributes\"4\n\026Shielded" + + "InstanceConfig\022\032\n\022enable_secure_boot\030\001 \001" + + "(\0102\263\024\n\003Tpu\022\250\001\n\tListNodes\022+.google.cloud." + + "tpu.v2alpha1.ListNodesRequest\032,.google.c" + + "loud.tpu.v2alpha1.ListNodesResponse\"@\202\323\344" + + "\223\0021\022//v2alpha1/{parent=projects/*/locati" + + "ons/*}/nodes\332A\006parent\022\225\001\n\007GetNode\022).goog" + + "le.cloud.tpu.v2alpha1.GetNodeRequest\032\037.g" + + "oogle.cloud.tpu.v2alpha1.Node\">\202\323\344\223\0021\022//" + + "v2alpha1/{name=projects/*/locations/*/no" + + "des/*}\332A\004name\022\312\001\n\nCreateNode\022,.google.cl" + + "oud.tpu.v2alpha1.CreateNodeRequest\032\035.goo" + + "gle.longrunning.Operation\"o\202\323\344\223\0027\"//v2al" + + "pha1/{parent=projects/*/locations/*}/nod" + + "es:\004node\332A\023parent,node,node_id\312A\031\n\004Node\022" + + "\021OperationMetadata\022\265\001\n\nDeleteNode\022,.goog" + + "le.cloud.tpu.v2alpha1.DeleteNodeRequest\032" + + "\035.google.longrunning.Operation\"Z\202\323\344\223\0021*/" + + "/v2alpha1/{name=projects/*/locations/*/n" + + "odes/*}\332A\004name\312A\031\n\004Node\022\021OperationMetada" + + "ta\022\262\001\n\010StopNode\022*.google.cloud.tpu.v2alp" + + "ha1.StopNodeRequest\032\035.google.longrunning" + + ".Operation\"[\202\323\344\223\0029\"4/v2alpha1/{name=proj" + + "ects/*/locations/*/nodes/*}:stop:\001*\312A\031\n\004" + + "Node\022\021OperationMetadata\022\265\001\n\tStartNode\022+." + + "google.cloud.tpu.v2alpha1.StartNodeReque" + + "st\032\035.google.longrunning.Operation\"\\\202\323\344\223\002" + + ":\"5/v2alpha1/{name=projects/*/locations/" + + "*/nodes/*}:start:\001*\312A\031\n\004Node\022\021OperationM" + + "etadata\022\314\001\n\nUpdateNode\022,.google.cloud.tp" + + "u.v2alpha1.UpdateNodeRequest\032\035.google.lo" + + "ngrunning.Operation\"q\202\323\344\223\002<24/v2alpha1/{" + + "node.name=projects/*/locations/*/nodes/*" + + "}:\004node\332A\020node,update_mask\312A\031\n\004Node\022\021Ope" + + "rationMetadata\022\336\001\n\027GenerateServiceIdenti" + + "ty\0229.google.cloud.tpu.v2alpha1.GenerateS" + + "erviceIdentityRequest\032:.google.cloud.tpu" + + ".v2alpha1.GenerateServiceIdentityRespons" + + "e\"L\202\323\344\223\002F\"A/v2alpha1/{parent=projects/*/" + + "locations/*}:generateServiceIdentity:\001*\022" + + "\324\001\n\024ListAcceleratorTypes\0226.google.cloud." + + "tpu.v2alpha1.ListAcceleratorTypesRequest" + + "\0327.google.cloud.tpu.v2alpha1.ListAcceler" + + "atorTypesResponse\"K\202\323\344\223\002<\022:/v2alpha1/{pa" + + "rent=projects/*/locations/*}/accelerator" + + "Types\332A\006parent\022\301\001\n\022GetAcceleratorType\0224." + + "google.cloud.tpu.v2alpha1.GetAccelerator" + + "TypeRequest\032*.google.cloud.tpu.v2alpha1." + + "AcceleratorType\"I\202\323\344\223\002<\022:/v2alpha1/{name" + + "=projects/*/locations/*/acceleratorTypes" + + "/*}\332A\004name\022\320\001\n\023ListRuntimeVersions\0225.goo" + + "gle.cloud.tpu.v2alpha1.ListRuntimeVersio" + + "nsRequest\0326.google.cloud.tpu.v2alpha1.Li" + + "stRuntimeVersionsResponse\"J\202\323\344\223\002;\0229/v2al" + + "pha1/{parent=projects/*/locations/*}/run" + + "timeVersions\332A\006parent\022\275\001\n\021GetRuntimeVers" + + "ion\0223.google.cloud.tpu.v2alpha1.GetRunti" + + "meVersionRequest\032).google.cloud.tpu.v2al" + + "pha1.RuntimeVersion\"H\202\323\344\223\002;\0229/v2alpha1/{" + + "name=projects/*/locations/*/runtimeVersi" + + "ons/*}\332A\004name\022\320\001\n\022GetGuestAttributes\0224.g" + + "oogle.cloud.tpu.v2alpha1.GetGuestAttribu" + + "tesRequest\0325.google.cloud.tpu.v2alpha1.G" + + "etGuestAttributesResponse\"M\202\323\344\223\002G\"B/v2al" + + "pha1/{name=projects/*/locations/*/nodes/" + + "*}:getGuestAttributes:\001*\032F\312A\022tpu.googlea" + + "pis.com\322A.https://www.googleapis.com/aut" + + "h/cloud-platformBn\n\035com.google.cloud.tpu" + + ".v2alpha1B\rCloudTpuProtoP\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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CreateNodeRequestOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CreateNodeRequestOrBuilder.java new file mode 100644 index 000000000000..58cfbcf11c19 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CreateNodeRequestOrBuilder.java @@ -0,0 +1,76 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteNodeRequest.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteNodeRequest.java new file mode 100644 index 000000000000..c64ddd447658 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteNodeRequest.java @@ -0,0 +1,595 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteNodeRequestOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteNodeRequestOrBuilder.java new file mode 100644 index 000000000000..0c6333da567a --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteNodeRequestOrBuilder.java @@ -0,0 +1,29 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityRequest.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityRequest.java new file mode 100644 index 000000000000..e50c9990a816 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityRequest.java @@ -0,0 +1,597 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityRequestOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityRequestOrBuilder.java new file mode 100644 index 000000000000..d8435479991d --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityRequestOrBuilder.java @@ -0,0 +1,29 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityResponse.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityResponse.java new file mode 100644 index 000000000000..5a74e3581370 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityResponse.java @@ -0,0 +1,667 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityResponseOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityResponseOrBuilder.java new file mode 100644 index 000000000000..60569c6ed088 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityResponseOrBuilder.java @@ -0,0 +1,36 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetAcceleratorTypeRequest.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetAcceleratorTypeRequest.java new file mode 100644 index 000000000000..5d94643faa71 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetAcceleratorTypeRequest.java @@ -0,0 +1,597 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetAcceleratorTypeRequestOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetAcceleratorTypeRequestOrBuilder.java new file mode 100644 index 000000000000..a52d77c225d3 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetAcceleratorTypeRequestOrBuilder.java @@ -0,0 +1,29 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesRequest.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesRequest.java new file mode 100644 index 000000000000..682bd21138c6 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesRequest.java @@ -0,0 +1,1023 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesRequestOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesRequestOrBuilder.java new file mode 100644 index 000000000000..aef6790d7f31 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesRequestOrBuilder.java @@ -0,0 +1,94 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesResponse.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesResponse.java new file mode 100644 index 000000000000..0690bd2a3864 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesResponse.java @@ -0,0 +1,874 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesResponseOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesResponseOrBuilder.java new file mode 100644 index 000000000000..34ae4e22da30 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesResponseOrBuilder.java @@ -0,0 +1,53 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetNodeRequest.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetNodeRequest.java new file mode 100644 index 000000000000..71202aa1cb91 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetNodeRequest.java @@ -0,0 +1,595 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetNodeRequestOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetNodeRequestOrBuilder.java new file mode 100644 index 000000000000..4374797464d5 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetNodeRequestOrBuilder.java @@ -0,0 +1,29 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetRuntimeVersionRequest.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetRuntimeVersionRequest.java new file mode 100644 index 000000000000..8fdf3fe3301d --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetRuntimeVersionRequest.java @@ -0,0 +1,597 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetRuntimeVersionRequestOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetRuntimeVersionRequestOrBuilder.java new file mode 100644 index 000000000000..e5e3a11c3528 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetRuntimeVersionRequestOrBuilder.java @@ -0,0 +1,29 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributes.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributes.java new file mode 100644 index 000000000000..02bb58a8c39a --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributes.java @@ -0,0 +1,845 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesEntry.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesEntry.java new file mode 100644 index 000000000000..9bc25e63e29b --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesEntry.java @@ -0,0 +1,927 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesEntryOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesEntryOrBuilder.java new file mode 100644 index 000000000000..415dc3dc7b86 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesEntryOrBuilder.java @@ -0,0 +1,69 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesOrBuilder.java new file mode 100644 index 000000000000..e233695fde73 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesOrBuilder.java @@ -0,0 +1,60 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesValue.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesValue.java new file mode 100644 index 000000000000..5bd7e1a59385 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesValue.java @@ -0,0 +1,872 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesValueOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesValueOrBuilder.java new file mode 100644 index 000000000000..d7a9b5abe4f8 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GuestAttributesValueOrBuilder.java @@ -0,0 +1,53 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesRequest.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesRequest.java new file mode 100644 index 000000000000..09478d219a59 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesRequest.java @@ -0,0 +1,1175 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesRequestOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesRequestOrBuilder.java new file mode 100644 index 000000000000..2c6486a70c5f --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesRequestOrBuilder.java @@ -0,0 +1,99 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesResponse.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesResponse.java new file mode 100644 index 000000000000..e54eb48388e4 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesResponse.java @@ -0,0 +1,1284 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesResponseOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesResponseOrBuilder.java new file mode 100644 index 000000000000..9bcc0f264186 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesResponseOrBuilder.java @@ -0,0 +1,114 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesRequest.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesRequest.java new file mode 100644 index 000000000000..24a7ec7c2378 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesRequest.java @@ -0,0 +1,841 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesRequestOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesRequestOrBuilder.java new file mode 100644 index 000000000000..6ccc65aa25cd --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesRequestOrBuilder.java @@ -0,0 +1,59 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesResponse.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesResponse.java new file mode 100644 index 000000000000..36ae29aa6c1a --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesResponse.java @@ -0,0 +1,1282 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesResponseOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesResponseOrBuilder.java new file mode 100644 index 000000000000..90a441f2b160 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListNodesResponseOrBuilder.java @@ -0,0 +1,114 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsRequest.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsRequest.java new file mode 100644 index 000000000000..37a330249267 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsRequest.java @@ -0,0 +1,1175 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsRequestOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsRequestOrBuilder.java new file mode 100644 index 000000000000..9b0732a3aba4 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsRequestOrBuilder.java @@ -0,0 +1,99 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsResponse.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsResponse.java new file mode 100644 index 000000000000..a9a898a8c194 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsResponse.java @@ -0,0 +1,1284 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsResponseOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsResponseOrBuilder.java new file mode 100644 index 000000000000..2613e6e3d961 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsResponseOrBuilder.java @@ -0,0 +1,114 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/LocationName.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/LocationName.java new file mode 100644 index 000000000000..b315fbb37d9d --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfig.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfig.java new file mode 100644 index 000000000000..b139d43a7c51 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfig.java @@ -0,0 +1,871 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfigOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfigOrBuilder.java new file mode 100644 index 000000000000..1cc3bf8f42be --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfigOrBuilder.java @@ -0,0 +1,67 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkEndpoint.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkEndpoint.java new file mode 100644 index 000000000000..398dd24b7064 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkEndpoint.java @@ -0,0 +1,911 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkEndpointOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkEndpointOrBuilder.java new file mode 100644 index 000000000000..aeeb5a816083 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkEndpointOrBuilder.java @@ -0,0 +1,66 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/Node.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/Node.java new file mode 100644 index 000000000000..b35805806f65 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/Node.java @@ -0,0 +1,6092 @@ +// 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; + } + case 362: { + com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig.Builder subBuilder = null; + if (shieldedInstanceConfig_ != null) { + subBuilder = shieldedInstanceConfig_.toBuilder(); + } + shieldedInstanceConfig_ = input.readMessage(com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(shieldedInstanceConfig_); + shieldedInstanceConfig_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 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< + State> 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< + Health> 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< + ApiVersion> 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< + java.lang.String, java.lang.String> 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< + java.lang.String, java.lang.String> 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 NullPointerException("map key"); } + return internalGetLabels().getMap().containsKey(key); + } + /** + * Use {@link #getLabelsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + *
+   * 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 NullPointerException("map key"); } + 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 NullPointerException("map key"); } + java.util.Map map = + internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int METADATA_FIELD_NUMBER = 34; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> 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< + java.lang.String, java.lang.String> 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 NullPointerException("map key"); } + 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 NullPointerException("map key"); } + 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 NullPointerException("map key"); } + 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); + } + + public static final int SHIELDED_INSTANCE_CONFIG_FIELD_NUMBER = 45; + private com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig shieldedInstanceConfig_; + /** + *
+   * Shielded Instance options.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.ShieldedInstanceConfig shielded_instance_config = 45; + * @return Whether the shieldedInstanceConfig field is set. + */ + @java.lang.Override + public boolean hasShieldedInstanceConfig() { + return shieldedInstanceConfig_ != null; + } + /** + *
+   * Shielded Instance options.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.ShieldedInstanceConfig shielded_instance_config = 45; + * @return The shieldedInstanceConfig. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig getShieldedInstanceConfig() { + return shieldedInstanceConfig_ == null ? com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig.getDefaultInstance() : shieldedInstanceConfig_; + } + /** + *
+   * Shielded Instance options.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.ShieldedInstanceConfig shielded_instance_config = 45; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfigOrBuilder getShieldedInstanceConfigOrBuilder() { + return getShieldedInstanceConfig(); + } + + 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)); + } + if (shieldedInstanceConfig_ != null) { + output.writeMessage(45, getShieldedInstanceConfig()); + } + 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)); + } + if (shieldedInstanceConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(45, getShieldedInstanceConfig()); + } + 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 (hasShieldedInstanceConfig() != other.hasShieldedInstanceConfig()) return false; + if (hasShieldedInstanceConfig()) { + if (!getShieldedInstanceConfig() + .equals(other.getShieldedInstanceConfig())) 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(); + } + if (hasShieldedInstanceConfig()) { + hash = (37 * hash) + SHIELDED_INSTANCE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getShieldedInstanceConfig().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(); + } + if (shieldedInstanceConfigBuilder_ == null) { + shieldedInstanceConfig_ = null; + } else { + shieldedInstanceConfig_ = null; + shieldedInstanceConfigBuilder_ = 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_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(); + } + if (shieldedInstanceConfigBuilder_ == null) { + result.shieldedInstanceConfig_ = shieldedInstanceConfig_; + } else { + result.shieldedInstanceConfig_ = shieldedInstanceConfigBuilder_.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_); + } + } + } + if (other.hasShieldedInstanceConfig()) { + mergeShieldedInstanceConfig(other.getShieldedInstanceConfig()); + } + 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< + java.lang.String, java.lang.String> 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 NullPointerException("map key"); } + return internalGetLabels().getMap().containsKey(key); + } + /** + * Use {@link #getLabelsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + *
+     * 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 NullPointerException("map key"); } + 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 NullPointerException("map key"); } + java.util.Map map = + internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap() + .clear(); + return this; + } + /** + *
+     * Resource labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 24; + */ + + public Builder removeLabels( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableLabels().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + *
+     * 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 NullPointerException("map key"); } + if (value == null) { + throw new NullPointerException("map value"); +} + + 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< + java.lang.String, java.lang.String> 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 NullPointerException("map key"); } + 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 NullPointerException("map key"); } + 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 NullPointerException("map key"); } + 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 NullPointerException("map key"); } + 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 NullPointerException("map key"); } + if (value == null) { + throw new NullPointerException("map value"); +} + + 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_; + } + + private com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig shieldedInstanceConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig, com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig.Builder, com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfigOrBuilder> shieldedInstanceConfigBuilder_; + /** + *
+     * Shielded Instance options.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ShieldedInstanceConfig shielded_instance_config = 45; + * @return Whether the shieldedInstanceConfig field is set. + */ + public boolean hasShieldedInstanceConfig() { + return shieldedInstanceConfigBuilder_ != null || shieldedInstanceConfig_ != null; + } + /** + *
+     * Shielded Instance options.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ShieldedInstanceConfig shielded_instance_config = 45; + * @return The shieldedInstanceConfig. + */ + public com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig getShieldedInstanceConfig() { + if (shieldedInstanceConfigBuilder_ == null) { + return shieldedInstanceConfig_ == null ? com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig.getDefaultInstance() : shieldedInstanceConfig_; + } else { + return shieldedInstanceConfigBuilder_.getMessage(); + } + } + /** + *
+     * Shielded Instance options.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ShieldedInstanceConfig shielded_instance_config = 45; + */ + public Builder setShieldedInstanceConfig(com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig value) { + if (shieldedInstanceConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + shieldedInstanceConfig_ = value; + onChanged(); + } else { + shieldedInstanceConfigBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Shielded Instance options.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ShieldedInstanceConfig shielded_instance_config = 45; + */ + public Builder setShieldedInstanceConfig( + com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig.Builder builderForValue) { + if (shieldedInstanceConfigBuilder_ == null) { + shieldedInstanceConfig_ = builderForValue.build(); + onChanged(); + } else { + shieldedInstanceConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Shielded Instance options.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ShieldedInstanceConfig shielded_instance_config = 45; + */ + public Builder mergeShieldedInstanceConfig(com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig value) { + if (shieldedInstanceConfigBuilder_ == null) { + if (shieldedInstanceConfig_ != null) { + shieldedInstanceConfig_ = + com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig.newBuilder(shieldedInstanceConfig_).mergeFrom(value).buildPartial(); + } else { + shieldedInstanceConfig_ = value; + } + onChanged(); + } else { + shieldedInstanceConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Shielded Instance options.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ShieldedInstanceConfig shielded_instance_config = 45; + */ + public Builder clearShieldedInstanceConfig() { + if (shieldedInstanceConfigBuilder_ == null) { + shieldedInstanceConfig_ = null; + onChanged(); + } else { + shieldedInstanceConfig_ = null; + shieldedInstanceConfigBuilder_ = null; + } + + return this; + } + /** + *
+     * Shielded Instance options.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ShieldedInstanceConfig shielded_instance_config = 45; + */ + public com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig.Builder getShieldedInstanceConfigBuilder() { + + onChanged(); + return getShieldedInstanceConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Shielded Instance options.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ShieldedInstanceConfig shielded_instance_config = 45; + */ + public com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfigOrBuilder getShieldedInstanceConfigOrBuilder() { + if (shieldedInstanceConfigBuilder_ != null) { + return shieldedInstanceConfigBuilder_.getMessageOrBuilder(); + } else { + return shieldedInstanceConfig_ == null ? + com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig.getDefaultInstance() : shieldedInstanceConfig_; + } + } + /** + *
+     * Shielded Instance options.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.ShieldedInstanceConfig shielded_instance_config = 45; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig, com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig.Builder, com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfigOrBuilder> + getShieldedInstanceConfigFieldBuilder() { + if (shieldedInstanceConfigBuilder_ == null) { + shieldedInstanceConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig, com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig.Builder, com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfigOrBuilder>( + getShieldedInstanceConfig(), + getParentForChildren(), + isClean()); + shieldedInstanceConfig_ = null; + } + return shieldedInstanceConfigBuilder_; + } + @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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NodeName.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NodeName.java new file mode 100644 index 000000000000..43dcb62a3573 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NodeName.java @@ -0,0 +1,217 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NodeOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NodeOrBuilder.java new file mode 100644 index 000000000000..7a53c63f53d0 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NodeOrBuilder.java @@ -0,0 +1,654 @@ +// 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; + */ + + /* nullable */ +java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ +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; + */ + + /* nullable */ +java.lang.String getMetadataOrDefault( + java.lang.String key, + /* nullable */ +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); + + /** + *
+   * Shielded Instance options.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.ShieldedInstanceConfig shielded_instance_config = 45; + * @return Whether the shieldedInstanceConfig field is set. + */ + boolean hasShieldedInstanceConfig(); + /** + *
+   * Shielded Instance options.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.ShieldedInstanceConfig shielded_instance_config = 45; + * @return The shieldedInstanceConfig. + */ + com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig getShieldedInstanceConfig(); + /** + *
+   * Shielded Instance options.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.ShieldedInstanceConfig shielded_instance_config = 45; + */ + com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfigOrBuilder getShieldedInstanceConfigOrBuilder(); +} diff --git a/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/OperationMetadata.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/OperationMetadata.java new file mode 100644 index 000000000000..73da95932fc2 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/OperationMetadata.java @@ -0,0 +1,1653 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/OperationMetadataOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..c6e532d4d93b --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/OperationMetadataOrBuilder.java @@ -0,0 +1,155 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersion.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersion.java new file mode 100644 index 000000000000..a2e8be7587ce --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersion.java @@ -0,0 +1,761 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersionName.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersionName.java new file mode 100644 index 000000000000..fb06582e59f4 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersionName.java @@ -0,0 +1,227 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersionOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersionOrBuilder.java new file mode 100644 index 000000000000..61ba8883f9e3 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/RuntimeVersionOrBuilder.java @@ -0,0 +1,49 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SchedulingConfig.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SchedulingConfig.java new file mode 100644 index 000000000000..7f6ce8504997 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SchedulingConfig.java @@ -0,0 +1,591 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SchedulingConfigOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SchedulingConfigOrBuilder.java new file mode 100644 index 000000000000..5e8a02cbe3b3 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SchedulingConfigOrBuilder.java @@ -0,0 +1,29 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceAccount.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceAccount.java new file mode 100644 index 000000000000..18380457802e --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceAccount.java @@ -0,0 +1,862 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceAccountOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceAccountOrBuilder.java new file mode 100644 index 000000000000..b066871c5cad --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceAccountOrBuilder.java @@ -0,0 +1,76 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceIdentity.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceIdentity.java new file mode 100644 index 000000000000..bc9d9edf80f2 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceIdentity.java @@ -0,0 +1,595 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceIdentityOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceIdentityOrBuilder.java new file mode 100644 index 000000000000..12b3c9f7dcd5 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ServiceIdentityOrBuilder.java @@ -0,0 +1,29 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ShieldedInstanceConfig.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ShieldedInstanceConfig.java new file mode 100644 index 000000000000..01eceeac5fd6 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ShieldedInstanceConfig.java @@ -0,0 +1,510 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + *
+ * A set of Shielded Instance options.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.ShieldedInstanceConfig} + */ +public final class ShieldedInstanceConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.ShieldedInstanceConfig) + ShieldedInstanceConfigOrBuilder { +private static final long serialVersionUID = 0L; + // Use ShieldedInstanceConfig.newBuilder() to construct. + private ShieldedInstanceConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ShieldedInstanceConfig() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ShieldedInstanceConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ShieldedInstanceConfig( + 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: { + + enableSecureBoot_ = input.readBool(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto.internal_static_google_cloud_tpu_v2alpha1_ShieldedInstanceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto.internal_static_google_cloud_tpu_v2alpha1_ShieldedInstanceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig.class, com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig.Builder.class); + } + + public static final int ENABLE_SECURE_BOOT_FIELD_NUMBER = 1; + private boolean enableSecureBoot_; + /** + *
+   * Defines whether the instance has Secure Boot enabled.
+   * 
+ * + * bool enable_secure_boot = 1; + * @return The enableSecureBoot. + */ + @java.lang.Override + public boolean getEnableSecureBoot() { + return enableSecureBoot_; + } + + 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 (enableSecureBoot_ != false) { + output.writeBool(1, enableSecureBoot_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (enableSecureBoot_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, enableSecureBoot_); + } + 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.ShieldedInstanceConfig)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig other = (com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig) obj; + + if (getEnableSecureBoot() + != other.getEnableSecureBoot()) 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) + ENABLE_SECURE_BOOT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnableSecureBoot()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig 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.ShieldedInstanceConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig 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.ShieldedInstanceConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig 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.ShieldedInstanceConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig 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.ShieldedInstanceConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig 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.ShieldedInstanceConfig 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.ShieldedInstanceConfig 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.ShieldedInstanceConfig 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 set of Shielded Instance options.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.ShieldedInstanceConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.ShieldedInstanceConfig) + com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto.internal_static_google_cloud_tpu_v2alpha1_ShieldedInstanceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto.internal_static_google_cloud_tpu_v2alpha1_ShieldedInstanceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig.class, com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig.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(); + enableSecureBoot_ = 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_ShieldedInstanceConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig build() { + com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig buildPartial() { + com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig result = new com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig(this); + result.enableSecureBoot_ = enableSecureBoot_; + 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.ShieldedInstanceConfig) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig other) { + if (other == com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig.getDefaultInstance()) return this; + if (other.getEnableSecureBoot() != false) { + setEnableSecureBoot(other.getEnableSecureBoot()); + } + 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.ShieldedInstanceConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean enableSecureBoot_ ; + /** + *
+     * Defines whether the instance has Secure Boot enabled.
+     * 
+ * + * bool enable_secure_boot = 1; + * @return The enableSecureBoot. + */ + @java.lang.Override + public boolean getEnableSecureBoot() { + return enableSecureBoot_; + } + /** + *
+     * Defines whether the instance has Secure Boot enabled.
+     * 
+ * + * bool enable_secure_boot = 1; + * @param value The enableSecureBoot to set. + * @return This builder for chaining. + */ + public Builder setEnableSecureBoot(boolean value) { + + enableSecureBoot_ = value; + onChanged(); + return this; + } + /** + *
+     * Defines whether the instance has Secure Boot enabled.
+     * 
+ * + * bool enable_secure_boot = 1; + * @return This builder for chaining. + */ + public Builder clearEnableSecureBoot() { + + enableSecureBoot_ = 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.ShieldedInstanceConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.ShieldedInstanceConfig) + private static final com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig(); + } + + public static com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ShieldedInstanceConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ShieldedInstanceConfig(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.ShieldedInstanceConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ShieldedInstanceConfigOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ShieldedInstanceConfigOrBuilder.java new file mode 100644 index 000000000000..a720bd197b91 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ShieldedInstanceConfigOrBuilder.java @@ -0,0 +1,19 @@ +// 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 ShieldedInstanceConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.ShieldedInstanceConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Defines whether the instance has Secure Boot enabled.
+   * 
+ * + * bool enable_secure_boot = 1; + * @return The enableSecureBoot. + */ + boolean getEnableSecureBoot(); +} diff --git a/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StartNodeRequest.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StartNodeRequest.java new file mode 100644 index 000000000000..cc4b34347ec8 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StartNodeRequest.java @@ -0,0 +1,595 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StartNodeRequestOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StartNodeRequestOrBuilder.java new file mode 100644 index 000000000000..7563815e5851 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StartNodeRequestOrBuilder.java @@ -0,0 +1,29 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StopNodeRequest.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StopNodeRequest.java new file mode 100644 index 000000000000..f921d9152105 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StopNodeRequest.java @@ -0,0 +1,595 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StopNodeRequestOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StopNodeRequestOrBuilder.java new file mode 100644 index 000000000000..ffe3d83bb37f --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StopNodeRequestOrBuilder.java @@ -0,0 +1,29 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/Symptom.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/Symptom.java new file mode 100644 index 000000000000..b20b6aab729d --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/Symptom.java @@ -0,0 +1,1337 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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< + SymptomType> 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SymptomOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SymptomOrBuilder.java new file mode 100644 index 000000000000..10c2a01cbd87 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SymptomOrBuilder.java @@ -0,0 +1,95 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequest.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequest.java new file mode 100644 index 000000000000..d92d0d3b66d6 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequest.java @@ -0,0 +1,913 @@ +// 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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequestOrBuilder.java b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequestOrBuilder.java new file mode 100644 index 000000000000..c268e829ed7d --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequestOrBuilder.java @@ -0,0 +1,66 @@ +// 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/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/proto/google/cloud/tpu/v2alpha1/cloud_tpu.proto b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/proto/google/cloud/tpu/v2alpha1/cloud_tpu.proto new file mode 100644 index 000000000000..612e1c4f5ddb --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/proto-google-cloud-tpu-v2alpha1/src/main/proto/google/cloud/tpu/v2alpha1/cloud_tpu.proto @@ -0,0 +1,791 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.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]; + + // Shielded Instance options. + ShieldedInstanceConfig shielded_instance_config = 45; +} + +// 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; +} + +// A set of Shielded Instance options. +message ShieldedInstanceConfig { + // Defines whether the instance has Secure Boot enabled. + bool enable_secure_boot = 1; +} \ No newline at end of file diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/stub/tpustubsettings/getnode/SyncGetNode.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/stub/tpustubsettings/getnode/SyncGetNode.java new file mode 100644 index 000000000000..284d1d908741 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/stub/tpustubsettings/getnode/SyncGetNode.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.stub.samples; + +// [START tpu_v2alpha1_generated_tpustubsettings_getnode_sync] +import com.google.cloud.tpu.v2alpha1.stub.TpuStubSettings; +import java.time.Duration; + +public class SyncGetNode { + + public static void main(String[] args) throws Exception { + syncGetNode(); + } + + public static void syncGetNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + TpuStubSettings.Builder tpuSettingsBuilder = TpuStubSettings.newBuilder(); + tpuSettingsBuilder + .getNodeSettings() + .setRetrySettings( + tpuSettingsBuilder.getNodeSettings().getRetrySettings().toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + TpuStubSettings tpuSettings = tpuSettingsBuilder.build(); + } +} +// [END tpu_v2alpha1_generated_tpustubsettings_getnode_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/create/SyncCreateSetCredentialsProvider.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..0d5337d79923 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.tpu.v2alpha1.TpuClient; +import com.google.cloud.tpu.v2alpha1.TpuSettings; +import com.google.cloud.tpu.v2alpha1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + TpuSettings tpuSettings = + TpuSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + TpuClient tpuClient = TpuClient.create(tpuSettings); + } +} +// [END tpu_v2alpha1_generated_tpuclient_create_setcredentialsprovider_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/create/SyncCreateSetEndpoint.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..6dd505fdca01 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_create_setendpoint_sync] +import com.google.cloud.tpu.v2alpha1.TpuClient; +import com.google.cloud.tpu.v2alpha1.TpuSettings; +import com.google.cloud.tpu.v2alpha1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + TpuSettings tpuSettings = TpuSettings.newBuilder().setEndpoint(myEndpoint).build(); + TpuClient tpuClient = TpuClient.create(tpuSettings); + } +} +// [END tpu_v2alpha1_generated_tpuclient_create_setendpoint_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/createnode/AsyncCreateNode.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/createnode/AsyncCreateNode.java new file mode 100644 index 000000000000..7aebf5a05016 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/createnode/AsyncCreateNode.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_createnode_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2alpha1.CreateNodeRequest; +import com.google.cloud.tpu.v2alpha1.LocationName; +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.TpuClient; +import com.google.longrunning.Operation; + +public class AsyncCreateNode { + + public static void main(String[] args) throws Exception { + asyncCreateNode(); + } + + public static void asyncCreateNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_createnode_async] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/createnode/AsyncCreateNodeLRO.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/createnode/AsyncCreateNodeLRO.java new file mode 100644 index 000000000000..5d949942e44e --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/createnode/AsyncCreateNodeLRO.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_createnode_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.tpu.v2alpha1.CreateNodeRequest; +import com.google.cloud.tpu.v2alpha1.LocationName; +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.OperationMetadata; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class AsyncCreateNodeLRO { + + public static void main(String[] args) throws Exception { + asyncCreateNodeLRO(); + } + + public static void asyncCreateNodeLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_createnode_lro_async] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/createnode/SyncCreateNode.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/createnode/SyncCreateNode.java new file mode 100644 index 000000000000..9c67764c645e --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/createnode/SyncCreateNode.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_createnode_sync] +import com.google.cloud.tpu.v2alpha1.CreateNodeRequest; +import com.google.cloud.tpu.v2alpha1.LocationName; +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncCreateNode { + + public static void main(String[] args) throws Exception { + syncCreateNode(); + } + + public static void syncCreateNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_createnode_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/createnode/SyncCreateNodeLocationnameNodeString.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/createnode/SyncCreateNodeLocationnameNodeString.java new file mode 100644 index 000000000000..1591e3ea6657 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/createnode/SyncCreateNodeLocationnameNodeString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_createnode_locationnamenodestring_sync] +import com.google.cloud.tpu.v2alpha1.LocationName; +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncCreateNodeLocationnameNodeString { + + public static void main(String[] args) throws Exception { + syncCreateNodeLocationnameNodeString(); + } + + public static void syncCreateNodeLocationnameNodeString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_createnode_locationnamenodestring_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/createnode/SyncCreateNodeStringNodeString.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/createnode/SyncCreateNodeStringNodeString.java new file mode 100644 index 000000000000..070563aec17e --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/createnode/SyncCreateNodeStringNodeString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_createnode_stringnodestring_sync] +import com.google.cloud.tpu.v2alpha1.LocationName; +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncCreateNodeStringNodeString { + + public static void main(String[] args) throws Exception { + syncCreateNodeStringNodeString(); + } + + public static void syncCreateNodeStringNodeString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_createnode_stringnodestring_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/deletenode/AsyncDeleteNode.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/deletenode/AsyncDeleteNode.java new file mode 100644 index 000000000000..b835a28aa180 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/deletenode/AsyncDeleteNode.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_deletenode_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2alpha1.DeleteNodeRequest; +import com.google.cloud.tpu.v2alpha1.NodeName; +import com.google.cloud.tpu.v2alpha1.TpuClient; +import com.google.longrunning.Operation; + +public class AsyncDeleteNode { + + public static void main(String[] args) throws Exception { + asyncDeleteNode(); + } + + public static void asyncDeleteNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_deletenode_async] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/deletenode/AsyncDeleteNodeLRO.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/deletenode/AsyncDeleteNodeLRO.java new file mode 100644 index 000000000000..cab1b4b6e219 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/deletenode/AsyncDeleteNodeLRO.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_deletenode_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.tpu.v2alpha1.DeleteNodeRequest; +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.NodeName; +import com.google.cloud.tpu.v2alpha1.OperationMetadata; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class AsyncDeleteNodeLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteNodeLRO(); + } + + public static void asyncDeleteNodeLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_deletenode_lro_async] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/deletenode/SyncDeleteNode.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/deletenode/SyncDeleteNode.java new file mode 100644 index 000000000000..5f510d5f433c --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/deletenode/SyncDeleteNode.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_deletenode_sync] +import com.google.cloud.tpu.v2alpha1.DeleteNodeRequest; +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.NodeName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncDeleteNode { + + public static void main(String[] args) throws Exception { + syncDeleteNode(); + } + + public static void syncDeleteNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + DeleteNodeRequest request = + DeleteNodeRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); + Node response = tpuClient.deleteNodeAsync(request).get(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_deletenode_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/deletenode/SyncDeleteNodeNodename.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/deletenode/SyncDeleteNodeNodename.java new file mode 100644 index 000000000000..6ceb4b8c774e --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/deletenode/SyncDeleteNodeNodename.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_deletenode_nodename_sync] +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.NodeName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncDeleteNodeNodename { + + public static void main(String[] args) throws Exception { + syncDeleteNodeNodename(); + } + + public static void syncDeleteNodeNodename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); + Node response = tpuClient.deleteNodeAsync(name).get(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_deletenode_nodename_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/deletenode/SyncDeleteNodeString.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/deletenode/SyncDeleteNodeString.java new file mode 100644 index 000000000000..b4d17cd5498e --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/deletenode/SyncDeleteNodeString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_deletenode_string_sync] +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.NodeName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncDeleteNodeString { + + public static void main(String[] args) throws Exception { + syncDeleteNodeString(); + } + + public static void syncDeleteNodeString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + String name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString(); + Node response = tpuClient.deleteNodeAsync(name).get(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_deletenode_string_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/generateserviceidentity/AsyncGenerateServiceIdentity.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/generateserviceidentity/AsyncGenerateServiceIdentity.java new file mode 100644 index 000000000000..8ceafe852fc6 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/generateserviceidentity/AsyncGenerateServiceIdentity.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_generateserviceidentity_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest; +import com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse; +import com.google.cloud.tpu.v2alpha1.LocationName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class AsyncGenerateServiceIdentity { + + public static void main(String[] args) throws Exception { + asyncGenerateServiceIdentity(); + } + + public static void asyncGenerateServiceIdentity() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_generateserviceidentity_async] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/generateserviceidentity/SyncGenerateServiceIdentity.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/generateserviceidentity/SyncGenerateServiceIdentity.java new file mode 100644 index 000000000000..31e6bbcc50f3 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/generateserviceidentity/SyncGenerateServiceIdentity.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_generateserviceidentity_sync] +import com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest; +import com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse; +import com.google.cloud.tpu.v2alpha1.LocationName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncGenerateServiceIdentity { + + public static void main(String[] args) throws Exception { + syncGenerateServiceIdentity(); + } + + public static void syncGenerateServiceIdentity() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + GenerateServiceIdentityRequest request = + GenerateServiceIdentityRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + GenerateServiceIdentityResponse response = tpuClient.generateServiceIdentity(request); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_generateserviceidentity_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getacceleratortype/AsyncGetAcceleratorType.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getacceleratortype/AsyncGetAcceleratorType.java new file mode 100644 index 000000000000..28dd94e76fec --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getacceleratortype/AsyncGetAcceleratorType.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_getacceleratortype_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2alpha1.AcceleratorType; +import com.google.cloud.tpu.v2alpha1.AcceleratorTypeName; +import com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class AsyncGetAcceleratorType { + + public static void main(String[] args) throws Exception { + asyncGetAcceleratorType(); + } + + public static void asyncGetAcceleratorType() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_getacceleratortype_async] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getacceleratortype/SyncGetAcceleratorType.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getacceleratortype/SyncGetAcceleratorType.java new file mode 100644 index 000000000000..1740eb187f2c --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getacceleratortype/SyncGetAcceleratorType.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_getacceleratortype_sync] +import com.google.cloud.tpu.v2alpha1.AcceleratorType; +import com.google.cloud.tpu.v2alpha1.AcceleratorTypeName; +import com.google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncGetAcceleratorType { + + public static void main(String[] args) throws Exception { + syncGetAcceleratorType(); + } + + public static void syncGetAcceleratorType() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + GetAcceleratorTypeRequest request = + GetAcceleratorTypeRequest.newBuilder() + .setName( + AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]") + .toString()) + .build(); + AcceleratorType response = tpuClient.getAcceleratorType(request); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_getacceleratortype_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getacceleratortype/SyncGetAcceleratorTypeAcceleratortypename.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getacceleratortype/SyncGetAcceleratorTypeAcceleratortypename.java new file mode 100644 index 000000000000..94ed84fa7894 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getacceleratortype/SyncGetAcceleratorTypeAcceleratortypename.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_getacceleratortype_acceleratortypename_sync] +import com.google.cloud.tpu.v2alpha1.AcceleratorType; +import com.google.cloud.tpu.v2alpha1.AcceleratorTypeName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncGetAcceleratorTypeAcceleratortypename { + + public static void main(String[] args) throws Exception { + syncGetAcceleratorTypeAcceleratortypename(); + } + + public static void syncGetAcceleratorTypeAcceleratortypename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + AcceleratorTypeName name = + AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]"); + AcceleratorType response = tpuClient.getAcceleratorType(name); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_getacceleratortype_acceleratortypename_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getacceleratortype/SyncGetAcceleratorTypeString.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getacceleratortype/SyncGetAcceleratorTypeString.java new file mode 100644 index 000000000000..4949842c6d33 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getacceleratortype/SyncGetAcceleratorTypeString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_getacceleratortype_string_sync] +import com.google.cloud.tpu.v2alpha1.AcceleratorType; +import com.google.cloud.tpu.v2alpha1.AcceleratorTypeName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncGetAcceleratorTypeString { + + public static void main(String[] args) throws Exception { + syncGetAcceleratorTypeString(); + } + + public static void syncGetAcceleratorTypeString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + String name = + AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]").toString(); + AcceleratorType response = tpuClient.getAcceleratorType(name); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_getacceleratortype_string_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getguestattributes/AsyncGetGuestAttributes.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getguestattributes/AsyncGetGuestAttributes.java new file mode 100644 index 000000000000..69c495518d84 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getguestattributes/AsyncGetGuestAttributes.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_getguestattributes_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest; +import com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse; +import com.google.cloud.tpu.v2alpha1.NodeName; +import com.google.cloud.tpu.v2alpha1.TpuClient; +import java.util.ArrayList; + +public class AsyncGetGuestAttributes { + + public static void main(String[] args) throws Exception { + asyncGetGuestAttributes(); + } + + public static void asyncGetGuestAttributes() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_getguestattributes_async] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getguestattributes/SyncGetGuestAttributes.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getguestattributes/SyncGetGuestAttributes.java new file mode 100644 index 000000000000..23645d3abfab --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getguestattributes/SyncGetGuestAttributes.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_getguestattributes_sync] +import com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest; +import com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse; +import com.google.cloud.tpu.v2alpha1.NodeName; +import com.google.cloud.tpu.v2alpha1.TpuClient; +import java.util.ArrayList; + +public class SyncGetGuestAttributes { + + public static void main(String[] args) throws Exception { + syncGetGuestAttributes(); + } + + public static void syncGetGuestAttributes() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_getguestattributes_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getnode/AsyncGetNode.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getnode/AsyncGetNode.java new file mode 100644 index 000000000000..693d916d8fc8 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getnode/AsyncGetNode.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_getnode_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2alpha1.GetNodeRequest; +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.NodeName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class AsyncGetNode { + + public static void main(String[] args) throws Exception { + asyncGetNode(); + } + + public static void asyncGetNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_getnode_async] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getnode/SyncGetNode.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getnode/SyncGetNode.java new file mode 100644 index 000000000000..6c58807c2106 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getnode/SyncGetNode.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_getnode_sync] +import com.google.cloud.tpu.v2alpha1.GetNodeRequest; +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.NodeName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncGetNode { + + public static void main(String[] args) throws Exception { + syncGetNode(); + } + + public static void syncGetNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + GetNodeRequest request = + GetNodeRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); + Node response = tpuClient.getNode(request); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_getnode_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getnode/SyncGetNodeNodename.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getnode/SyncGetNodeNodename.java new file mode 100644 index 000000000000..64aebf223ed8 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getnode/SyncGetNodeNodename.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_getnode_nodename_sync] +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.NodeName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncGetNodeNodename { + + public static void main(String[] args) throws Exception { + syncGetNodeNodename(); + } + + public static void syncGetNodeNodename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); + Node response = tpuClient.getNode(name); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_getnode_nodename_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getnode/SyncGetNodeString.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getnode/SyncGetNodeString.java new file mode 100644 index 000000000000..7841a99ab661 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getnode/SyncGetNodeString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_getnode_string_sync] +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.NodeName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncGetNodeString { + + public static void main(String[] args) throws Exception { + syncGetNodeString(); + } + + public static void syncGetNodeString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + String name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString(); + Node response = tpuClient.getNode(name); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_getnode_string_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getruntimeversion/AsyncGetRuntimeVersion.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getruntimeversion/AsyncGetRuntimeVersion.java new file mode 100644 index 000000000000..d694da43caeb --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getruntimeversion/AsyncGetRuntimeVersion.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_getruntimeversion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest; +import com.google.cloud.tpu.v2alpha1.RuntimeVersion; +import com.google.cloud.tpu.v2alpha1.RuntimeVersionName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class AsyncGetRuntimeVersion { + + public static void main(String[] args) throws Exception { + asyncGetRuntimeVersion(); + } + + public static void asyncGetRuntimeVersion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_getruntimeversion_async] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getruntimeversion/SyncGetRuntimeVersion.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getruntimeversion/SyncGetRuntimeVersion.java new file mode 100644 index 000000000000..bfbbf288ffc6 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getruntimeversion/SyncGetRuntimeVersion.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_getruntimeversion_sync] +import com.google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest; +import com.google.cloud.tpu.v2alpha1.RuntimeVersion; +import com.google.cloud.tpu.v2alpha1.RuntimeVersionName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncGetRuntimeVersion { + + public static void main(String[] args) throws Exception { + syncGetRuntimeVersion(); + } + + public static void syncGetRuntimeVersion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + GetRuntimeVersionRequest request = + GetRuntimeVersionRequest.newBuilder() + .setName( + RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]").toString()) + .build(); + RuntimeVersion response = tpuClient.getRuntimeVersion(request); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_getruntimeversion_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getruntimeversion/SyncGetRuntimeVersionRuntimeversionname.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getruntimeversion/SyncGetRuntimeVersionRuntimeversionname.java new file mode 100644 index 000000000000..181c01f77b7b --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getruntimeversion/SyncGetRuntimeVersionRuntimeversionname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_getruntimeversion_runtimeversionname_sync] +import com.google.cloud.tpu.v2alpha1.RuntimeVersion; +import com.google.cloud.tpu.v2alpha1.RuntimeVersionName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncGetRuntimeVersionRuntimeversionname { + + public static void main(String[] args) throws Exception { + syncGetRuntimeVersionRuntimeversionname(); + } + + public static void syncGetRuntimeVersionRuntimeversionname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + RuntimeVersionName name = + RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]"); + RuntimeVersion response = tpuClient.getRuntimeVersion(name); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_getruntimeversion_runtimeversionname_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getruntimeversion/SyncGetRuntimeVersionString.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getruntimeversion/SyncGetRuntimeVersionString.java new file mode 100644 index 000000000000..92c96e65fff9 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/getruntimeversion/SyncGetRuntimeVersionString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_getruntimeversion_string_sync] +import com.google.cloud.tpu.v2alpha1.RuntimeVersion; +import com.google.cloud.tpu.v2alpha1.RuntimeVersionName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncGetRuntimeVersionString { + + public static void main(String[] args) throws Exception { + syncGetRuntimeVersionString(); + } + + public static void syncGetRuntimeVersionString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + String name = + RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]").toString(); + RuntimeVersion response = tpuClient.getRuntimeVersion(name); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_getruntimeversion_string_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listacceleratortypes/AsyncListAcceleratorTypes.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listacceleratortypes/AsyncListAcceleratorTypes.java new file mode 100644 index 000000000000..8d1337fd6b43 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listacceleratortypes/AsyncListAcceleratorTypes.java @@ -0,0 +1,58 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_listacceleratortypes_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2alpha1.AcceleratorType; +import com.google.cloud.tpu.v2alpha1.AcceleratorTypeName; +import com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class AsyncListAcceleratorTypes { + + public static void main(String[] args) throws Exception { + asyncListAcceleratorTypes(); + } + + public static void asyncListAcceleratorTypes() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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); + } + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_listacceleratortypes_async] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listacceleratortypes/AsyncListAcceleratorTypesPaged.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listacceleratortypes/AsyncListAcceleratorTypesPaged.java new file mode 100644 index 000000000000..5dbe6d57c530 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listacceleratortypes/AsyncListAcceleratorTypesPaged.java @@ -0,0 +1,66 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_listacceleratortypes_paged_async] +import com.google.cloud.tpu.v2alpha1.AcceleratorType; +import com.google.cloud.tpu.v2alpha1.AcceleratorTypeName; +import com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest; +import com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse; +import com.google.cloud.tpu.v2alpha1.TpuClient; +import com.google.common.base.Strings; + +public class AsyncListAcceleratorTypesPaged { + + public static void main(String[] args) throws Exception { + asyncListAcceleratorTypesPaged(); + } + + public static void asyncListAcceleratorTypesPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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.getAcceleratorTypesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_listacceleratortypes_paged_async] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listacceleratortypes/SyncListAcceleratorTypes.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listacceleratortypes/SyncListAcceleratorTypes.java new file mode 100644 index 000000000000..d35e98f15ec6 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listacceleratortypes/SyncListAcceleratorTypes.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_listacceleratortypes_sync] +import com.google.cloud.tpu.v2alpha1.AcceleratorType; +import com.google.cloud.tpu.v2alpha1.AcceleratorTypeName; +import com.google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncListAcceleratorTypes { + + public static void main(String[] args) throws Exception { + syncListAcceleratorTypes(); + } + + public static void syncListAcceleratorTypes() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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); + } + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_listacceleratortypes_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listacceleratortypes/SyncListAcceleratorTypesAcceleratortypename.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listacceleratortypes/SyncListAcceleratorTypesAcceleratortypename.java new file mode 100644 index 000000000000..5d4012985d4d --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listacceleratortypes/SyncListAcceleratorTypesAcceleratortypename.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_listacceleratortypes_acceleratortypename_sync] +import com.google.cloud.tpu.v2alpha1.AcceleratorType; +import com.google.cloud.tpu.v2alpha1.AcceleratorTypeName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncListAcceleratorTypesAcceleratortypename { + + public static void main(String[] args) throws Exception { + syncListAcceleratorTypesAcceleratortypename(); + } + + public static void syncListAcceleratorTypesAcceleratortypename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + AcceleratorTypeName parent = + AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]"); + for (AcceleratorType element : tpuClient.listAcceleratorTypes(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_listacceleratortypes_acceleratortypename_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listacceleratortypes/SyncListAcceleratorTypesString.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listacceleratortypes/SyncListAcceleratorTypesString.java new file mode 100644 index 000000000000..6db1d55b293e --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listacceleratortypes/SyncListAcceleratorTypesString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_listacceleratortypes_string_sync] +import com.google.cloud.tpu.v2alpha1.AcceleratorType; +import com.google.cloud.tpu.v2alpha1.AcceleratorTypeName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncListAcceleratorTypesString { + + public static void main(String[] args) throws Exception { + syncListAcceleratorTypesString(); + } + + public static void syncListAcceleratorTypesString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + String parent = + AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]").toString(); + for (AcceleratorType element : tpuClient.listAcceleratorTypes(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_listacceleratortypes_string_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listnodes/AsyncListNodes.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listnodes/AsyncListNodes.java new file mode 100644 index 000000000000..dd2ebcb7937d --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listnodes/AsyncListNodes.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_listnodes_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2alpha1.ListNodesRequest; +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.NodeName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class AsyncListNodes { + + public static void main(String[] args) throws Exception { + asyncListNodes(); + } + + public static void asyncListNodes() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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); + } + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_listnodes_async] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listnodes/AsyncListNodesPaged.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listnodes/AsyncListNodesPaged.java new file mode 100644 index 000000000000..87f07997e785 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listnodes/AsyncListNodesPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_listnodes_paged_async] +import com.google.cloud.tpu.v2alpha1.ListNodesRequest; +import com.google.cloud.tpu.v2alpha1.ListNodesResponse; +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.NodeName; +import com.google.cloud.tpu.v2alpha1.TpuClient; +import com.google.common.base.Strings; + +public class AsyncListNodesPaged { + + public static void main(String[] args) throws Exception { + asyncListNodesPaged(); + } + + public static void asyncListNodesPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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.getNodesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_listnodes_paged_async] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listnodes/SyncListNodes.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listnodes/SyncListNodes.java new file mode 100644 index 000000000000..adf0bf8bb185 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listnodes/SyncListNodes.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_listnodes_sync] +import com.google.cloud.tpu.v2alpha1.ListNodesRequest; +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.NodeName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncListNodes { + + public static void main(String[] args) throws Exception { + syncListNodes(); + } + + public static void syncListNodes() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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); + } + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_listnodes_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listnodes/SyncListNodesNodename.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listnodes/SyncListNodesNodename.java new file mode 100644 index 000000000000..fdccc3a23888 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listnodes/SyncListNodesNodename.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_listnodes_nodename_sync] +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.NodeName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncListNodesNodename { + + public static void main(String[] args) throws Exception { + syncListNodesNodename(); + } + + public static void syncListNodesNodename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + NodeName parent = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); + for (Node element : tpuClient.listNodes(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_listnodes_nodename_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listnodes/SyncListNodesString.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listnodes/SyncListNodesString.java new file mode 100644 index 000000000000..528798a43c21 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listnodes/SyncListNodesString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_listnodes_string_sync] +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.NodeName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncListNodesString { + + public static void main(String[] args) throws Exception { + syncListNodesString(); + } + + public static void syncListNodesString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + String parent = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString(); + for (Node element : tpuClient.listNodes(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_listnodes_string_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listruntimeversions/AsyncListRuntimeVersions.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listruntimeversions/AsyncListRuntimeVersions.java new file mode 100644 index 000000000000..274d7ea22a48 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listruntimeversions/AsyncListRuntimeVersions.java @@ -0,0 +1,57 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_listruntimeversions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest; +import com.google.cloud.tpu.v2alpha1.RuntimeVersion; +import com.google.cloud.tpu.v2alpha1.RuntimeVersionName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class AsyncListRuntimeVersions { + + public static void main(String[] args) throws Exception { + asyncListRuntimeVersions(); + } + + public static void asyncListRuntimeVersions() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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); + } + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_listruntimeversions_async] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listruntimeversions/AsyncListRuntimeVersionsPaged.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listruntimeversions/AsyncListRuntimeVersionsPaged.java new file mode 100644 index 000000000000..c2b443aa1b36 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listruntimeversions/AsyncListRuntimeVersionsPaged.java @@ -0,0 +1,65 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_listruntimeversions_paged_async] +import com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest; +import com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse; +import com.google.cloud.tpu.v2alpha1.RuntimeVersion; +import com.google.cloud.tpu.v2alpha1.RuntimeVersionName; +import com.google.cloud.tpu.v2alpha1.TpuClient; +import com.google.common.base.Strings; + +public class AsyncListRuntimeVersionsPaged { + + public static void main(String[] args) throws Exception { + asyncListRuntimeVersionsPaged(); + } + + public static void asyncListRuntimeVersionsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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.getRuntimeVersionsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_listruntimeversions_paged_async] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listruntimeversions/SyncListRuntimeVersions.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listruntimeversions/SyncListRuntimeVersions.java new file mode 100644 index 000000000000..b411994e46e2 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listruntimeversions/SyncListRuntimeVersions.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_listruntimeversions_sync] +import com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest; +import com.google.cloud.tpu.v2alpha1.RuntimeVersion; +import com.google.cloud.tpu.v2alpha1.RuntimeVersionName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncListRuntimeVersions { + + public static void main(String[] args) throws Exception { + syncListRuntimeVersions(); + } + + public static void syncListRuntimeVersions() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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); + } + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_listruntimeversions_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listruntimeversions/SyncListRuntimeVersionsRuntimeversionname.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listruntimeversions/SyncListRuntimeVersionsRuntimeversionname.java new file mode 100644 index 000000000000..a336a9ed42a2 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listruntimeversions/SyncListRuntimeVersionsRuntimeversionname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_listruntimeversions_runtimeversionname_sync] +import com.google.cloud.tpu.v2alpha1.RuntimeVersion; +import com.google.cloud.tpu.v2alpha1.RuntimeVersionName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncListRuntimeVersionsRuntimeversionname { + + public static void main(String[] args) throws Exception { + syncListRuntimeVersionsRuntimeversionname(); + } + + public static void syncListRuntimeVersionsRuntimeversionname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + RuntimeVersionName parent = + RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]"); + for (RuntimeVersion element : tpuClient.listRuntimeVersions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_listruntimeversions_runtimeversionname_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listruntimeversions/SyncListRuntimeVersionsString.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listruntimeversions/SyncListRuntimeVersionsString.java new file mode 100644 index 000000000000..06ff8ba197dc --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/listruntimeversions/SyncListRuntimeVersionsString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_listruntimeversions_string_sync] +import com.google.cloud.tpu.v2alpha1.RuntimeVersion; +import com.google.cloud.tpu.v2alpha1.RuntimeVersionName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncListRuntimeVersionsString { + + public static void main(String[] args) throws Exception { + syncListRuntimeVersionsString(); + } + + public static void syncListRuntimeVersionsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + String parent = + RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]").toString(); + for (RuntimeVersion element : tpuClient.listRuntimeVersions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_listruntimeversions_string_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/startnode/AsyncStartNode.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/startnode/AsyncStartNode.java new file mode 100644 index 000000000000..00ed6e6cb73a --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/startnode/AsyncStartNode.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_startnode_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2alpha1.StartNodeRequest; +import com.google.cloud.tpu.v2alpha1.TpuClient; +import com.google.longrunning.Operation; + +public class AsyncStartNode { + + public static void main(String[] args) throws Exception { + asyncStartNode(); + } + + public static void asyncStartNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + StartNodeRequest request = StartNodeRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = tpuClient.startNodeCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_startnode_async] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/startnode/AsyncStartNodeLRO.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/startnode/AsyncStartNodeLRO.java new file mode 100644 index 000000000000..d019038fb54e --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/startnode/AsyncStartNodeLRO.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_startnode_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.OperationMetadata; +import com.google.cloud.tpu.v2alpha1.StartNodeRequest; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class AsyncStartNodeLRO { + + public static void main(String[] args) throws Exception { + asyncStartNodeLRO(); + } + + public static void asyncStartNodeLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + StartNodeRequest request = StartNodeRequest.newBuilder().setName("name3373707").build(); + OperationFuture future = + tpuClient.startNodeOperationCallable().futureCall(request); + // Do something. + Node response = future.get(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_startnode_lro_async] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/startnode/SyncStartNode.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/startnode/SyncStartNode.java new file mode 100644 index 000000000000..221c0eb2add2 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/startnode/SyncStartNode.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_startnode_sync] +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.StartNodeRequest; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncStartNode { + + public static void main(String[] args) throws Exception { + syncStartNode(); + } + + public static void syncStartNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + StartNodeRequest request = StartNodeRequest.newBuilder().setName("name3373707").build(); + Node response = tpuClient.startNodeAsync(request).get(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_startnode_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/stopnode/AsyncStopNode.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/stopnode/AsyncStopNode.java new file mode 100644 index 000000000000..b87767742c2d --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/stopnode/AsyncStopNode.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_stopnode_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2alpha1.StopNodeRequest; +import com.google.cloud.tpu.v2alpha1.TpuClient; +import com.google.longrunning.Operation; + +public class AsyncStopNode { + + public static void main(String[] args) throws Exception { + asyncStopNode(); + } + + public static void asyncStopNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + StopNodeRequest request = StopNodeRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = tpuClient.stopNodeCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_stopnode_async] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/stopnode/AsyncStopNodeLRO.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/stopnode/AsyncStopNodeLRO.java new file mode 100644 index 000000000000..d81e1656d1a0 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/stopnode/AsyncStopNodeLRO.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_stopnode_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.OperationMetadata; +import com.google.cloud.tpu.v2alpha1.StopNodeRequest; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class AsyncStopNodeLRO { + + public static void main(String[] args) throws Exception { + asyncStopNodeLRO(); + } + + public static void asyncStopNodeLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + StopNodeRequest request = StopNodeRequest.newBuilder().setName("name3373707").build(); + OperationFuture future = + tpuClient.stopNodeOperationCallable().futureCall(request); + // Do something. + Node response = future.get(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_stopnode_lro_async] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/stopnode/SyncStopNode.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/stopnode/SyncStopNode.java new file mode 100644 index 000000000000..46b321325163 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/stopnode/SyncStopNode.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_stopnode_sync] +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.StopNodeRequest; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncStopNode { + + public static void main(String[] args) throws Exception { + syncStopNode(); + } + + public static void syncStopNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + StopNodeRequest request = StopNodeRequest.newBuilder().setName("name3373707").build(); + Node response = tpuClient.stopNodeAsync(request).get(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_stopnode_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/updatenode/AsyncUpdateNode.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/updatenode/AsyncUpdateNode.java new file mode 100644 index 000000000000..b743abe71ac2 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/updatenode/AsyncUpdateNode.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_updatenode_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.TpuClient; +import com.google.cloud.tpu.v2alpha1.UpdateNodeRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateNode { + + public static void main(String[] args) throws Exception { + asyncUpdateNode(); + } + + public static void asyncUpdateNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_updatenode_async] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/updatenode/AsyncUpdateNodeLRO.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/updatenode/AsyncUpdateNodeLRO.java new file mode 100644 index 000000000000..390c057518b9 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/updatenode/AsyncUpdateNodeLRO.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_updatenode_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.OperationMetadata; +import com.google.cloud.tpu.v2alpha1.TpuClient; +import com.google.cloud.tpu.v2alpha1.UpdateNodeRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateNodeLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateNodeLRO(); + } + + public static void asyncUpdateNodeLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + 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(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_updatenode_lro_async] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/updatenode/SyncUpdateNode.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/updatenode/SyncUpdateNode.java new file mode 100644 index 000000000000..079e952d27ec --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/updatenode/SyncUpdateNode.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_updatenode_sync] +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.TpuClient; +import com.google.cloud.tpu.v2alpha1.UpdateNodeRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateNode { + + public static void main(String[] args) throws Exception { + syncUpdateNode(); + } + + public static void syncUpdateNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + UpdateNodeRequest request = + UpdateNodeRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setNode(Node.newBuilder().build()) + .build(); + Node response = tpuClient.updateNodeAsync(request).get(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_updatenode_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/updatenode/SyncUpdateNodeNodeFieldmask.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/updatenode/SyncUpdateNodeNodeFieldmask.java new file mode 100644 index 000000000000..f0720d17fe0d --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpuclient/updatenode/SyncUpdateNodeNodeFieldmask.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpuclient_updatenode_nodefieldmask_sync] +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.TpuClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateNodeNodeFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateNodeNodeFieldmask(); + } + + public static void syncUpdateNodeNodeFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (TpuClient tpuClient = TpuClient.create()) { + Node node = Node.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Node response = tpuClient.updateNodeAsync(node, updateMask).get(); + } + } +} +// [END tpu_v2alpha1_generated_tpuclient_updatenode_nodefieldmask_sync] diff --git a/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpusettings/getnode/SyncGetNode.java b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpusettings/getnode/SyncGetNode.java new file mode 100644 index 000000000000..fa5d928fa292 --- /dev/null +++ b/owl-bot-staging/java-tpu/v2alpha1/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpusettings/getnode/SyncGetNode.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1.samples; + +// [START tpu_v2alpha1_generated_tpusettings_getnode_sync] +import com.google.cloud.tpu.v2alpha1.TpuSettings; +import java.time.Duration; + +public class SyncGetNode { + + public static void main(String[] args) throws Exception { + syncGetNode(); + } + + public static void syncGetNode() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + TpuSettings.Builder tpuSettingsBuilder = TpuSettings.newBuilder(); + tpuSettingsBuilder + .getNodeSettings() + .setRetrySettings( + tpuSettingsBuilder.getNodeSettings().getRetrySettings().toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + TpuSettings tpuSettings = tpuSettingsBuilder.build(); + } +} +// [END tpu_v2alpha1_generated_tpusettings_getnode_sync]