From 21fe6697a41873fb4d51c68e2670429797f4f8f3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 7 Dec 2022 15:18:13 +0000 Subject: [PATCH] feat: [tpu] publishing TPU v2 API (#8851) - [ ] Regenerate this pull request now. fix!: fix incorrect resource annotations for TPU v2alpha1 API PiperOrigin-RevId: 493327922 Source-Link: https://togithub.com/googleapis/googleapis/commit/93c3e0eb6b4a4063daa4c9f89c488058699efe2b Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/4c018988e3571df80cde7923a1e6209fcf9197c7 Copy-Tag: eyJwIjoiamF2YS10cHUvLk93bEJvdC55YW1sIiwiaCI6IjRjMDE4OTg4ZTM1NzFkZjgwY2RlNzkyM2ExZTYyMDlmY2Y5MTk3YzcifQ== docs: minor updates in comments PiperOrigin-RevId: 491785685 Source-Link: https://togithub.com/googleapis/googleapis/commit/e8bd0c402d36f49ac34052289dfce4baa1294b51 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/9691e0cc991a6e0483492a2fd6d89ddc192e6223 Copy-Tag: eyJwIjoiamF2YS10cHUvLk93bEJvdC55YW1sIiwiaCI6Ijk2OTFlMGNjOTkxYTZlMDQ4MzQ5MmEyZmQ2ZDg5ZGRjMTkyZTYyMjMifQ== --- java-tpu/README.md | 32 +- java-tpu/google-cloud-tpu-bom/pom.xml | 10 + java-tpu/google-cloud-tpu/pom.xml | 30 + .../com/google/cloud/tpu/v1/TpuClient.java | 240 +- .../com/google/cloud/tpu/v1/TpuSettings.java | 28 + .../google/cloud/tpu/v1/gapic_metadata.json | 6 + .../com/google/cloud/tpu/v1/package-info.java | 4 +- .../google/cloud/tpu/v1/stub/GrpcTpuStub.java | 73 + .../com/google/cloud/tpu/v1/stub/TpuStub.java | 18 + .../cloud/tpu/v1/stub/TpuStubSettings.java | 113 +- .../com/google/cloud/tpu/v2/TpuClient.java | 2244 +++++ .../com/google/cloud/tpu/v2/TpuSettings.java | 440 + .../google/cloud/tpu/v2/gapic_metadata.json | 63 + .../com/google/cloud/tpu/v2/package-info.java | 45 + .../tpu/v2/stub/GrpcTpuCallableFactory.java | 113 + .../google/cloud/tpu/v2/stub/GrpcTpuStub.java | 726 ++ .../v2/stub/HttpJsonTpuCallableFactory.java | 105 + .../cloud/tpu/v2/stub/HttpJsonTpuStub.java | 1117 +++ .../com/google/cloud/tpu/v2/stub/TpuStub.java | 183 + .../cloud/tpu/v2/stub/TpuStubSettings.java | 1174 +++ .../google/cloud/tpu/v2alpha1/TpuClient.java | 1620 +++- .../cloud/tpu/v2alpha1/TpuSettings.java | 133 +- .../cloud/tpu/v2alpha1/gapic_metadata.json | 21 + .../cloud/tpu/v2alpha1/stub/GrpcTpuStub.java | 303 +- .../cloud/tpu/v2alpha1/stub/TpuStub.java | 74 +- .../tpu/v2alpha1/stub/TpuStubSettings.java | 477 +- .../google/cloud/tpu/v1/MockLocations.java | 59 + .../cloud/tpu/v1/MockLocationsImpl.java | 105 + .../google/cloud/tpu/v1/TpuClientTest.java | 110 +- .../google/cloud/tpu/v2/MockLocations.java | 59 + .../cloud/tpu/v2/MockLocationsImpl.java | 105 + .../java/com/google/cloud/tpu/v2/MockTpu.java | 59 + .../com/google/cloud/tpu/v2/MockTpuImpl.java | 332 + .../cloud/tpu/v2/TpuClientHttpJsonTest.java | 1406 +++ .../google/cloud/tpu/v2/TpuClientTest.java | 1259 +++ .../cloud/tpu/v2alpha1/MockLocations.java | 59 + .../cloud/tpu/v2alpha1/MockLocationsImpl.java | 105 + .../cloud/tpu/v2alpha1/MockTpuImpl.java | 106 + .../cloud/tpu/v2alpha1/TpuClientTest.java | 665 +- .../java/com/google/cloud/tpu/v1/TpuGrpc.java | 8 +- java-tpu/grpc-google-cloud-tpu-v2/pom.xml | 45 + .../java/com/google/cloud/tpu/v2/TpuGrpc.java | 1696 ++++ .../google/cloud/tpu/v2alpha1/TpuGrpc.java | 601 +- java-tpu/pom.xml | 12 + .../java/com/google/cloud/tpu/v1/Node.java | 4 +- .../proto/google/cloud/tpu/v1/cloud_tpu.proto | 11 +- .../clirr-ignored-differences.xml | 19 + java-tpu/proto-google-cloud-tpu-v2/pom.xml | 37 + .../google/cloud/tpu/v2/AcceleratorType.java | 791 ++ .../cloud/tpu/v2/AcceleratorTypeName.java | 227 + .../tpu/v2/AcceleratorTypeOrBuilder.java | 75 + .../com/google/cloud/tpu/v2/AccessConfig.java | 611 ++ .../cloud/tpu/v2/AccessConfigOrBuilder.java | 50 + .../com/google/cloud/tpu/v2/AttachedDisk.java | 944 ++ .../cloud/tpu/v2/AttachedDiskOrBuilder.java | 81 + .../google/cloud/tpu/v2/CloudTpuProto.java | 733 ++ .../cloud/tpu/v2/CreateNodeRequest.java | 1064 +++ .../tpu/v2/CreateNodeRequestOrBuilder.java | 114 + .../cloud/tpu/v2/DeleteNodeRequest.java | 628 ++ .../tpu/v2/DeleteNodeRequestOrBuilder.java | 54 + .../v2/GenerateServiceIdentityRequest.java | 631 ++ ...nerateServiceIdentityRequestOrBuilder.java | 54 + .../v2/GenerateServiceIdentityResponse.java | 705 ++ ...erateServiceIdentityResponseOrBuilder.java | 60 + .../tpu/v2/GetAcceleratorTypeRequest.java | 629 ++ .../GetAcceleratorTypeRequestOrBuilder.java | 54 + .../tpu/v2/GetGuestAttributesRequest.java | 1093 +++ .../GetGuestAttributesRequestOrBuilder.java | 134 + .../tpu/v2/GetGuestAttributesResponse.java | 931 ++ .../GetGuestAttributesResponseOrBuilder.java | 77 + .../google/cloud/tpu/v2/GetNodeRequest.java | 627 ++ .../cloud/tpu/v2/GetNodeRequestOrBuilder.java | 54 + .../tpu/v2/GetRuntimeVersionRequest.java | 629 ++ .../v2/GetRuntimeVersionRequestOrBuilder.java | 54 + .../google/cloud/tpu/v2/GuestAttributes.java | 895 ++ .../cloud/tpu/v2/GuestAttributesEntry.java | 970 ++ .../tpu/v2/GuestAttributesEntryOrBuilder.java | 100 + .../tpu/v2/GuestAttributesOrBuilder.java | 89 + .../cloud/tpu/v2/GuestAttributesValue.java | 925 ++ .../tpu/v2/GuestAttributesValueOrBuilder.java | 77 + .../tpu/v2/ListAcceleratorTypesRequest.java | 1254 +++ .../ListAcceleratorTypesRequestOrBuilder.java | 142 + .../tpu/v2/ListAcceleratorTypesResponse.java | 1380 +++ ...ListAcceleratorTypesResponseOrBuilder.java | 153 + .../google/cloud/tpu/v2/ListNodesRequest.java | 896 ++ .../tpu/v2/ListNodesRequestOrBuilder.java | 92 + .../cloud/tpu/v2/ListNodesResponse.java | 1364 +++ .../tpu/v2/ListNodesResponseOrBuilder.java | 152 + .../tpu/v2/ListRuntimeVersionsRequest.java | 1254 +++ .../ListRuntimeVersionsRequestOrBuilder.java | 142 + .../tpu/v2/ListRuntimeVersionsResponse.java | 1379 +++ .../ListRuntimeVersionsResponseOrBuilder.java | 153 + .../com/google/cloud/tpu/v2/LocationName.java | 192 + .../google/cloud/tpu/v2/NetworkConfig.java | 1009 +++ .../cloud/tpu/v2/NetworkConfigOrBuilder.java | 111 + .../google/cloud/tpu/v2/NetworkEndpoint.java | 971 ++ .../tpu/v2/NetworkEndpointOrBuilder.java | 98 + .../java/com/google/cloud/tpu/v2/Node.java | 6843 ++++++++++++++ .../com/google/cloud/tpu/v2/NodeName.java | 217 + .../google/cloud/tpu/v2/NodeOrBuilder.java | 833 ++ .../cloud/tpu/v2/OperationMetadata.java | 1768 ++++ .../tpu/v2/OperationMetadataOrBuilder.java | 210 + .../google/cloud/tpu/v2/RuntimeVersion.java | 791 ++ .../cloud/tpu/v2/RuntimeVersionName.java | 227 + .../cloud/tpu/v2/RuntimeVersionOrBuilder.java | 75 + .../google/cloud/tpu/v2/SchedulingConfig.java | 616 ++ .../tpu/v2/SchedulingConfigOrBuilder.java | 51 + .../google/cloud/tpu/v2/ServiceAccount.java | 906 ++ .../cloud/tpu/v2/ServiceAccountOrBuilder.java | 107 + .../google/cloud/tpu/v2/ServiceIdentity.java | 613 ++ .../tpu/v2/ServiceIdentityOrBuilder.java | 50 + .../cloud/tpu/v2/ShieldedInstanceConfig.java | 526 ++ .../v2/ShieldedInstanceConfigOrBuilder.java | 38 + .../google/cloud/tpu/v2/StartNodeRequest.java | 627 ++ .../tpu/v2/StartNodeRequestOrBuilder.java | 54 + .../google/cloud/tpu/v2/StopNodeRequest.java | 627 ++ .../tpu/v2/StopNodeRequestOrBuilder.java | 54 + .../java/com/google/cloud/tpu/v2/Symptom.java | 1449 +++ .../google/cloud/tpu/v2/SymptomOrBuilder.java | 135 + .../cloud/tpu/v2/UpdateNodeRequest.java | 992 ++ .../tpu/v2/UpdateNodeRequestOrBuilder.java | 104 + .../proto/google/cloud/tpu/v2/cloud_tpu.proto | 795 ++ .../cloud/tpu/v2alpha1/AcceleratorType.java | 14 +- .../v2alpha1/AcceleratorTypeOrBuilder.java | 4 +- .../cloud/tpu/v2alpha1/CloudTpuProto.java | 890 +- .../cloud/tpu/v2alpha1/CreateNodeRequest.java | 178 + .../v2alpha1/CreateNodeRequestOrBuilder.java | 25 + .../v2alpha1/CreateQueuedResourceRequest.java | 1285 +++ .../CreateQueuedResourceRequestOrBuilder.java | 147 + .../cloud/tpu/v2alpha1/DeleteNodeRequest.java | 178 + .../v2alpha1/DeleteNodeRequestOrBuilder.java | 25 + .../v2alpha1/DeleteQueuedResourceRequest.java | 808 ++ .../DeleteQueuedResourceRequestOrBuilder.java | 79 + .../GenerateServiceIdentityRequest.java | 6 +- .../GenerateServiceIdentityResponse.java | 6 +- .../v2alpha1/GetAcceleratorTypeRequest.java | 6 +- .../v2alpha1/GetGuestAttributesRequest.java | 6 +- .../v2alpha1/GetGuestAttributesResponse.java | 6 +- .../v2alpha1/GetQueuedResourceRequest.java | 630 ++ .../GetQueuedResourceRequestOrBuilder.java | 54 + .../v2alpha1/GetRuntimeVersionRequest.java | 6 +- .../v2alpha1/ListAcceleratorTypesRequest.java | 6 +- .../ListAcceleratorTypesResponse.java | 6 +- .../v2alpha1/ListQueuedResourcesRequest.java | 899 ++ .../ListQueuedResourcesRequestOrBuilder.java | 92 + .../v2alpha1/ListQueuedResourcesResponse.java | 1386 +++ .../ListQueuedResourcesResponseOrBuilder.java | 153 + .../v2alpha1/ListRuntimeVersionsRequest.java | 6 +- .../v2alpha1/ListRuntimeVersionsResponse.java | 6 +- .../cloud/tpu/v2alpha1/NetworkConfig.java | 99 + .../tpu/v2alpha1/NetworkConfigOrBuilder.java | 15 + .../com/google/cloud/tpu/v2alpha1/Node.java | 238 +- .../cloud/tpu/v2alpha1/NodeOrBuilder.java | 41 +- .../cloud/tpu/v2alpha1/QueuedResource.java | 7988 +++++++++++++++++ .../tpu/v2alpha1/QueuedResourceName.java | 227 + .../tpu/v2alpha1/QueuedResourceOrBuilder.java | 239 + .../tpu/v2alpha1/QueuedResourceState.java | 7251 +++++++++++++++ .../QueuedResourceStateOrBuilder.java | 341 + .../SimulateMaintenanceEventRequest.java | 946 ++ ...ulateMaintenanceEventRequestOrBuilder.java | 117 + .../cloud/tpu/v2alpha1/StartNodeRequest.java | 42 +- .../v2alpha1/StartNodeRequestOrBuilder.java | 12 +- .../cloud/tpu/v2alpha1/StopNodeRequest.java | 42 +- .../v2alpha1/StopNodeRequestOrBuilder.java | 12 +- .../cloud/tpu/v2alpha1/UpdateNodeRequest.java | 36 +- .../v2alpha1/UpdateNodeRequestOrBuilder.java | 9 +- .../google/cloud/tpu/v2alpha1/cloud_tpu.proto | 548 +- .../v1/tpu/getlocation/AsyncGetLocation.java | 45 + .../v1/tpu/getlocation/SyncGetLocation.java | 42 + .../tpu/listlocations/AsyncListLocations.java | 53 + .../AsyncListLocationsPaged.java | 61 + .../tpu/listlocations/SyncListLocations.java | 50 + .../tpustubsettings/getnode/SyncGetNode.java | 45 + .../SyncCreateSetCredentialsProvider.java | 44 + .../SyncCreateSetCredentialsProvider1.java | 39 + .../v2/tpu/create/SyncCreateSetEndpoint.java | 40 + .../v2/tpu/createnode/AsyncCreateNode.java | 52 + .../v2/tpu/createnode/AsyncCreateNodeLRO.java | 53 + .../tpu/v2/tpu/createnode/SyncCreateNode.java | 48 + .../SyncCreateNodeLocationnameNodeString.java | 44 + .../SyncCreateNodeStringNodeString.java | 44 + .../v2/tpu/deletenode/AsyncDeleteNode.java | 49 + .../v2/tpu/deletenode/AsyncDeleteNodeLRO.java | 51 + .../tpu/v2/tpu/deletenode/SyncDeleteNode.java | 46 + .../deletenode/SyncDeleteNodeNodename.java | 42 + .../tpu/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 + .../v2/tpu/getlocation/AsyncGetLocation.java | 45 + .../v2/tpu/getlocation/SyncGetLocation.java | 42 + .../tpu/v2/tpu/getnode/AsyncGetNode.java | 49 + .../cloud/tpu/v2/tpu/getnode/SyncGetNode.java | 46 + .../v2/tpu/getnode/SyncGetNodeNodename.java | 42 + .../tpu/v2/tpu/getnode/SyncGetNodeString.java | 42 + .../AsyncGetRuntimeVersion.java | 50 + .../SyncGetRuntimeVersion.java | 47 + ...ncGetRuntimeVersionRuntimeversionname.java | 43 + .../SyncGetRuntimeVersionString.java | 43 + .../AsyncListAcceleratorTypes.java | 56 + .../AsyncListAcceleratorTypesPaged.java | 64 + .../SyncListAcceleratorTypes.java | 52 + .../SyncListAcceleratorTypesLocationname.java | 44 + .../SyncListAcceleratorTypesString.java | 44 + .../tpu/listlocations/AsyncListLocations.java | 53 + .../AsyncListLocationsPaged.java | 61 + .../tpu/listlocations/SyncListLocations.java | 50 + .../tpu/v2/tpu/listnodes/AsyncListNodes.java | 53 + .../v2/tpu/listnodes/AsyncListNodesPaged.java | 61 + .../tpu/v2/tpu/listnodes/SyncListNodes.java | 50 + .../listnodes/SyncListNodesLocationname.java | 44 + .../v2/tpu/listnodes/SyncListNodesString.java | 44 + .../AsyncListRuntimeVersions.java | 56 + .../AsyncListRuntimeVersionsPaged.java | 64 + .../SyncListRuntimeVersions.java | 52 + .../SyncListRuntimeVersionsLocationname.java | 44 + .../SyncListRuntimeVersionsString.java | 44 + .../tpu/v2/tpu/startnode/AsyncStartNode.java | 49 + .../v2/tpu/startnode/AsyncStartNodeLRO.java | 51 + .../tpu/v2/tpu/startnode/SyncStartNode.java | 46 + .../tpu/v2/tpu/stopnode/AsyncStopNode.java | 49 + .../tpu/v2/tpu/stopnode/AsyncStopNodeLRO.java | 51 + .../tpu/v2/tpu/stopnode/SyncStopNode.java | 46 + .../v2/tpu/updatenode/AsyncUpdateNode.java | 51 + .../v2/tpu/updatenode/AsyncUpdateNodeLRO.java | 52 + .../tpu/v2/tpu/updatenode/SyncUpdateNode.java | 47 + .../SyncUpdateNodeNodeFieldmask.java | 43 + .../v2/tpusettings/getnode/SyncGetNode.java | 45 + .../tpu/createnode/AsyncCreateNode.java | 1 + .../tpu/createnode/AsyncCreateNodeLRO.java | 1 + .../tpu/createnode/SyncCreateNode.java | 1 + .../AsyncCreateQueuedResource.java | 53 + .../AsyncCreateQueuedResourceLRO.java | 54 + .../SyncCreateQueuedResource.java | 49 + ...ourceLocationnameQueuedresourceString.java | 45 + ...uedResourceStringQueuedresourceString.java | 45 + .../tpu/deletenode/AsyncDeleteNode.java | 3 +- .../tpu/deletenode/AsyncDeleteNodeLRO.java | 7 +- .../tpu/deletenode/SyncDeleteNode.java | 5 +- .../deletenode/SyncDeleteNodeNodename.java | 4 +- .../tpu/deletenode/SyncDeleteNodeString.java | 4 +- .../AsyncDeleteQueuedResource.java | 51 + .../AsyncDeleteQueuedResourceLRO.java | 53 + .../SyncDeleteQueuedResource.java | 48 + ...eleteQueuedResourceQueuedresourcename.java | 43 + .../SyncDeleteQueuedResourceString.java | 43 + .../tpu/getlocation/AsyncGetLocation.java | 45 + .../tpu/getlocation/SyncGetLocation.java | 42 + .../AsyncGetQueuedResource.java | 50 + .../SyncGetQueuedResource.java | 47 + ...ncGetQueuedResourceQueuedresourcename.java | 43 + .../SyncGetQueuedResourceString.java | 43 + .../AsyncListAcceleratorTypes.java | 6 +- .../AsyncListAcceleratorTypesPaged.java | 6 +- .../SyncListAcceleratorTypes.java | 6 +- ...SyncListAcceleratorTypesLocationname.java} | 15 +- .../SyncListAcceleratorTypesString.java | 5 +- .../tpu/listlocations/AsyncListLocations.java | 53 + .../AsyncListLocationsPaged.java | 61 + .../tpu/listlocations/SyncListLocations.java | 50 + .../tpu/listnodes/AsyncListNodes.java | 4 +- .../tpu/listnodes/AsyncListNodesPaged.java | 4 +- .../v2alpha1/tpu/listnodes/SyncListNodes.java | 4 +- ...me.java => SyncListNodesLocationname.java} | 14 +- .../tpu/listnodes/SyncListNodesString.java | 4 +- .../AsyncListQueuedResources.java | 54 + .../AsyncListQueuedResourcesPaged.java | 62 + .../SyncListQueuedResources.java | 50 + .../SyncListQueuedResourcesLocationname.java | 44 + .../SyncListQueuedResourcesString.java | 44 + .../AsyncListRuntimeVersions.java | 5 +- .../AsyncListRuntimeVersionsPaged.java | 5 +- .../SyncListRuntimeVersions.java | 5 +- ... SyncListRuntimeVersionsLocationname.java} | 15 +- .../SyncListRuntimeVersionsString.java | 5 +- .../AsyncSimulateMaintenanceEvent.java | 52 + .../AsyncSimulateMaintenanceEventLRO.java | 53 + .../SyncSimulateMaintenanceEvent.java | 48 + .../tpu/startnode/AsyncStartNode.java | 6 +- .../tpu/startnode/AsyncStartNodeLRO.java | 6 +- .../v2alpha1/tpu/startnode/SyncStartNode.java | 6 +- .../v2alpha1/tpu/stopnode/AsyncStopNode.java | 6 +- .../tpu/stopnode/AsyncStopNodeLRO.java | 6 +- .../v2alpha1/tpu/stopnode/SyncStopNode.java | 6 +- versions.txt | 2 + 290 files changed, 88696 insertions(+), 959 deletions(-) create mode 100644 java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/TpuClient.java create mode 100644 java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/TpuSettings.java create mode 100644 java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/gapic_metadata.json create mode 100644 java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/package-info.java create mode 100644 java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/GrpcTpuCallableFactory.java create mode 100644 java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/GrpcTpuStub.java create mode 100644 java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/HttpJsonTpuCallableFactory.java create mode 100644 java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/HttpJsonTpuStub.java create mode 100644 java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/TpuStub.java create mode 100644 java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/TpuStubSettings.java create mode 100644 java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/MockLocations.java create mode 100644 java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/MockLocationsImpl.java create mode 100644 java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/MockLocations.java create mode 100644 java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/MockLocationsImpl.java create mode 100644 java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/MockTpu.java create mode 100644 java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/MockTpuImpl.java create mode 100644 java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/TpuClientHttpJsonTest.java create mode 100644 java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/TpuClientTest.java create mode 100644 java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockLocations.java create mode 100644 java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockLocationsImpl.java create mode 100644 java-tpu/grpc-google-cloud-tpu-v2/pom.xml create mode 100644 java-tpu/grpc-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/TpuGrpc.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/clirr-ignored-differences.xml create mode 100644 java-tpu/proto-google-cloud-tpu-v2/pom.xml create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AcceleratorType.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AcceleratorTypeName.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AcceleratorTypeOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AccessConfig.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AccessConfigOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AttachedDisk.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AttachedDiskOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/CloudTpuProto.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/CreateNodeRequest.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/CreateNodeRequestOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/DeleteNodeRequest.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/DeleteNodeRequestOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GenerateServiceIdentityRequest.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GenerateServiceIdentityRequestOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GenerateServiceIdentityResponse.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GenerateServiceIdentityResponseOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetAcceleratorTypeRequest.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetAcceleratorTypeRequestOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetGuestAttributesRequest.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetGuestAttributesRequestOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetGuestAttributesResponse.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetGuestAttributesResponseOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetNodeRequest.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetNodeRequestOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetRuntimeVersionRequest.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetRuntimeVersionRequestOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributes.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributesEntry.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributesEntryOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributesOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributesValue.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributesValueOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListAcceleratorTypesRequest.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListAcceleratorTypesRequestOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListAcceleratorTypesResponse.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListAcceleratorTypesResponseOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListNodesRequest.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListNodesRequestOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListNodesResponse.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListNodesResponseOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListRuntimeVersionsRequest.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListRuntimeVersionsRequestOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListRuntimeVersionsResponse.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListRuntimeVersionsResponseOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/LocationName.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/NetworkConfig.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/NetworkConfigOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/NetworkEndpoint.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/NetworkEndpointOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/Node.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/NodeName.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/NodeOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/OperationMetadata.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/OperationMetadataOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/RuntimeVersion.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/RuntimeVersionName.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/RuntimeVersionOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/SchedulingConfig.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/SchedulingConfigOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ServiceAccount.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ServiceAccountOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ServiceIdentity.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ServiceIdentityOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ShieldedInstanceConfig.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ShieldedInstanceConfigOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/StartNodeRequest.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/StartNodeRequestOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/StopNodeRequest.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/StopNodeRequestOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/Symptom.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/SymptomOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/UpdateNodeRequest.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/UpdateNodeRequestOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2/src/main/proto/google/cloud/tpu/v2/cloud_tpu.proto create mode 100644 java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CreateQueuedResourceRequest.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CreateQueuedResourceRequestOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteQueuedResourceRequest.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteQueuedResourceRequestOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetQueuedResourceRequest.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetQueuedResourceRequestOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListQueuedResourcesRequest.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListQueuedResourcesRequestOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListQueuedResourcesResponse.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListQueuedResourcesResponseOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/QueuedResource.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/QueuedResourceName.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/QueuedResourceOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/QueuedResourceState.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/QueuedResourceStateOrBuilder.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SimulateMaintenanceEventRequest.java create mode 100644 java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SimulateMaintenanceEventRequestOrBuilder.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v1/tpu/getlocation/AsyncGetLocation.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v1/tpu/getlocation/SyncGetLocation.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v1/tpu/listlocations/AsyncListLocations.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v1/tpu/listlocations/AsyncListLocationsPaged.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v1/tpu/listlocations/SyncListLocations.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/stub/tpustubsettings/getnode/SyncGetNode.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/create/SyncCreateSetEndpoint.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/createnode/AsyncCreateNode.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/createnode/AsyncCreateNodeLRO.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/createnode/SyncCreateNode.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/createnode/SyncCreateNodeLocationnameNodeString.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/createnode/SyncCreateNodeStringNodeString.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/deletenode/AsyncDeleteNode.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/deletenode/AsyncDeleteNodeLRO.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/deletenode/SyncDeleteNode.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/deletenode/SyncDeleteNodeNodename.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/deletenode/SyncDeleteNodeString.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/generateserviceidentity/AsyncGenerateServiceIdentity.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/generateserviceidentity/SyncGenerateServiceIdentity.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getacceleratortype/AsyncGetAcceleratorType.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getacceleratortype/SyncGetAcceleratorType.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getacceleratortype/SyncGetAcceleratorTypeAcceleratortypename.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getacceleratortype/SyncGetAcceleratorTypeString.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getguestattributes/AsyncGetGuestAttributes.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getguestattributes/SyncGetGuestAttributes.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getlocation/AsyncGetLocation.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getlocation/SyncGetLocation.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getnode/AsyncGetNode.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getnode/SyncGetNode.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getnode/SyncGetNodeNodename.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getnode/SyncGetNodeString.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getruntimeversion/AsyncGetRuntimeVersion.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getruntimeversion/SyncGetRuntimeVersion.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getruntimeversion/SyncGetRuntimeVersionRuntimeversionname.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getruntimeversion/SyncGetRuntimeVersionString.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listacceleratortypes/AsyncListAcceleratorTypes.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listacceleratortypes/AsyncListAcceleratorTypesPaged.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listacceleratortypes/SyncListAcceleratorTypes.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listacceleratortypes/SyncListAcceleratorTypesLocationname.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listacceleratortypes/SyncListAcceleratorTypesString.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listlocations/AsyncListLocations.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listlocations/AsyncListLocationsPaged.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listlocations/SyncListLocations.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listnodes/AsyncListNodes.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listnodes/AsyncListNodesPaged.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listnodes/SyncListNodes.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listnodes/SyncListNodesLocationname.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listnodes/SyncListNodesString.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listruntimeversions/AsyncListRuntimeVersions.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listruntimeversions/AsyncListRuntimeVersionsPaged.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listruntimeversions/SyncListRuntimeVersions.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listruntimeversions/SyncListRuntimeVersionsLocationname.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listruntimeversions/SyncListRuntimeVersionsString.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/startnode/AsyncStartNode.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/startnode/AsyncStartNodeLRO.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/startnode/SyncStartNode.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/stopnode/AsyncStopNode.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/stopnode/AsyncStopNodeLRO.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/stopnode/SyncStopNode.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/updatenode/AsyncUpdateNode.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/updatenode/AsyncUpdateNodeLRO.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/updatenode/SyncUpdateNode.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/updatenode/SyncUpdateNodeNodeFieldmask.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpusettings/getnode/SyncGetNode.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createqueuedresource/AsyncCreateQueuedResource.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createqueuedresource/AsyncCreateQueuedResourceLRO.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createqueuedresource/SyncCreateQueuedResource.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createqueuedresource/SyncCreateQueuedResourceLocationnameQueuedresourceString.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createqueuedresource/SyncCreateQueuedResourceStringQueuedresourceString.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletequeuedresource/AsyncDeleteQueuedResource.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletequeuedresource/AsyncDeleteQueuedResourceLRO.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletequeuedresource/SyncDeleteQueuedResource.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletequeuedresource/SyncDeleteQueuedResourceQueuedresourcename.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletequeuedresource/SyncDeleteQueuedResourceString.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getlocation/AsyncGetLocation.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getlocation/SyncGetLocation.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getqueuedresource/AsyncGetQueuedResource.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getqueuedresource/SyncGetQueuedResource.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getqueuedresource/SyncGetQueuedResourceQueuedresourcename.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getqueuedresource/SyncGetQueuedResourceString.java rename java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listacceleratortypes/{SyncListAcceleratorTypesAcceleratortypename.java => SyncListAcceleratorTypesLocationname.java} (72%) create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listlocations/AsyncListLocations.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listlocations/AsyncListLocationsPaged.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listlocations/SyncListLocations.java rename java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listnodes/{SyncListNodesNodename.java => SyncListNodesLocationname.java} (77%) create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listqueuedresources/AsyncListQueuedResources.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listqueuedresources/AsyncListQueuedResourcesPaged.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listqueuedresources/SyncListQueuedResources.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listqueuedresources/SyncListQueuedResourcesLocationname.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listqueuedresources/SyncListQueuedResourcesString.java rename java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listruntimeversions/{SyncListRuntimeVersionsRuntimeversionname.java => SyncListRuntimeVersionsLocationname.java} (73%) create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/simulatemaintenanceevent/AsyncSimulateMaintenanceEvent.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/simulatemaintenanceevent/AsyncSimulateMaintenanceEventLRO.java create mode 100644 java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/simulatemaintenanceevent/SyncSimulateMaintenanceEvent.java diff --git a/java-tpu/README.md b/java-tpu/README.md index 9434aca4ea41..70f263757625 100644 --- a/java-tpu/README.md +++ b/java-tpu/README.md @@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file: com.google.cloud google-cloud-tpu - 2.6.0 + 2.7.0 ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-tpu:2.6.0' +implementation 'com.google.cloud:google-cloud-tpu:2.7.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-tpu" % "2.6.0" +libraryDependencies += "com.google.cloud" % "google-cloud-tpu" % "2.7.0" ``` ## Authentication @@ -159,16 +159,16 @@ Java is a registered trademark of Oracle and/or its affiliates. [product-docs]: https://cloud.google.com/tpu/docs [javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-tpu/latest/overview -[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-tpu/java7.svg -[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-tpu/java7.html -[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-tpu/java8.svg -[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-tpu/java8.html -[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-tpu/java8-osx.svg -[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-tpu/java8-osx.html -[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-tpu/java8-win.svg -[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-tpu/java8-win.html -[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-tpu/java11.svg -[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-tpu/java11.html +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-tpu.svg [maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-tpu&core=gav @@ -180,9 +180,9 @@ Java is a registered trademark of Oracle and/or its affiliates. [create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects [cloud-sdk]: https://cloud.google.com/sdk/ [troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting -[contributing]: https://github.com/googleapis/java-tpu/blob/main/CONTRIBUTING.md -[code-of-conduct]: https://github.com/googleapis/java-tpu/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct -[license]: https://github.com/googleapis/java-tpu/blob/main/LICENSE +[contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE [enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=tpu.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM diff --git a/java-tpu/google-cloud-tpu-bom/pom.xml b/java-tpu/google-cloud-tpu-bom/pom.xml index c0a79c13f974..3fb11032cdb6 100644 --- a/java-tpu/google-cloud-tpu-bom/pom.xml +++ b/java-tpu/google-cloud-tpu-bom/pom.xml @@ -39,6 +39,11 @@ grpc-google-cloud-tpu-v2alpha1 2.8.0-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-tpu-v2 + 2.8.0-SNAPSHOT + com.google.api.grpc proto-google-cloud-tpu-v1 @@ -49,6 +54,11 @@ proto-google-cloud-tpu-v2alpha1 2.8.0-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-tpu-v2 + 2.8.0-SNAPSHOT + diff --git a/java-tpu/google-cloud-tpu/pom.xml b/java-tpu/google-cloud-tpu/pom.xml index cbc91e59bfa4..7b0786b224fd 100644 --- a/java-tpu/google-cloud-tpu/pom.xml +++ b/java-tpu/google-cloud-tpu/pom.xml @@ -41,6 +41,10 @@ proto-google-common-protos + + com.google.api.grpc + proto-google-cloud-tpu-v2 + com.google.api.grpc proto-google-cloud-tpu-v2alpha1 @@ -57,6 +61,10 @@ com.google.api gax + + com.google.api + gax-httpjson + com.google.api gax-grpc @@ -78,17 +86,39 @@ grpc-google-cloud-tpu-v1 test + + com.google.api.grpc + grpc-google-cloud-tpu-v2 + test + com.google.api.grpc grpc-google-cloud-tpu-v2alpha1 test + + com.google.api.grpc + grpc-google-common-protos + test + + + com.google.api + gax + testlib + test + com.google.api gax-grpc testlib test + + com.google.api + gax-httpjson + testlib + test + diff --git a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuClient.java b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuClient.java index 6f541fed9c6f..e5d2469456c2 100644 --- a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuClient.java +++ b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuClient.java @@ -26,6 +26,10 @@ 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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.tpu.v1.stub.TpuStub; import com.google.cloud.tpu.v1.stub.TpuStubSettings; import com.google.common.util.concurrent.MoreExecutors; @@ -822,7 +826,7 @@ public final UnaryCallable reimageNodeCallable() // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Stops a node. + * Stops a node, this operation is only available with single TPU nodes. * *

Sample code: * @@ -847,7 +851,7 @@ public final OperationFuture stopNodeAsync(StopNodeRequ // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Stops a node. + * Stops a node, this operation is only available with single TPU nodes. * *

Sample code: * @@ -873,7 +877,7 @@ public final OperationFuture stopNodeAsync(StopNodeRequ // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Stops a node. + * Stops a node, this operation is only available with single TPU nodes. * *

Sample code: * @@ -1569,6 +1573,160 @@ public final AcceleratorType getAcceleratorType(GetAcceleratorTypeRequest reques return stub.getAcceleratorTypeCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : tpuClient.listLocations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated 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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = tpuClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated 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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = tpuClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated 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()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = tpuClient.getLocation(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated 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()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = tpuClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + @Override public final void close() { stub.close(); @@ -1835,4 +1993,80 @@ protected ListAcceleratorTypesFixedSizeCollection createCollection( return new ListAcceleratorTypesFixedSizeCollection(pages, collectionSize); } } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } } diff --git a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuSettings.java b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuSettings.java index 6ad65f50eef2..ecc8d3709c05 100644 --- a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuSettings.java +++ b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuSettings.java @@ -17,6 +17,7 @@ package com.google.cloud.tpu.v1; import static com.google.cloud.tpu.v1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListLocationsPagedResponse; import static com.google.cloud.tpu.v1.TpuClient.ListNodesPagedResponse; import static com.google.cloud.tpu.v1.TpuClient.ListTensorFlowVersionsPagedResponse; @@ -32,6 +33,10 @@ import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.tpu.v1.stub.TpuStubSettings; import com.google.longrunning.Operation; import java.io.IOException; @@ -170,6 +175,17 @@ public UnaryCallSettings startNodeSettings() { return ((TpuStubSettings) getStubSettings()).getAcceleratorTypeSettings(); } + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((TpuStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((TpuStubSettings) getStubSettings()).getLocationSettings(); + } + public static final TpuSettings create(TpuStubSettings stub) throws IOException { return new TpuSettings.Builder(stub.toBuilder()).build(); } @@ -362,6 +378,18 @@ public UnaryCallSettings.Builder startNodeSettings( return getStubSettingsBuilder().getAcceleratorTypeSettings(); } + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + @Override public TpuSettings build() throws IOException { return new TpuSettings(this); diff --git a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/gapic_metadata.json b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/gapic_metadata.json index 6226bd981dce..9a19c0e0a7a4 100644 --- a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/gapic_metadata.json +++ b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/gapic_metadata.json @@ -19,6 +19,9 @@ "GetAcceleratorType": { "methods": ["getAcceleratorType", "getAcceleratorType", "getAcceleratorType", "getAcceleratorTypeCallable"] }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, "GetNode": { "methods": ["getNode", "getNode", "getNode", "getNodeCallable"] }, @@ -28,6 +31,9 @@ "ListAcceleratorTypes": { "methods": ["listAcceleratorTypes", "listAcceleratorTypes", "listAcceleratorTypes", "listAcceleratorTypesPagedCallable", "listAcceleratorTypesCallable"] }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, "ListNodes": { "methods": ["listNodes", "listNodes", "listNodes", "listNodesPagedCallable", "listNodesCallable"] }, diff --git a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/package-info.java b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/package-info.java index 98f17162ac91..0910dee452e2 100644 --- a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/package-info.java +++ b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/package-info.java @@ -15,7 +15,9 @@ */ /** - * The interfaces provided are listed below, along with usage samples. + * A client to Cloud TPU API + * + *

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

======================= TpuClient ======================= * diff --git a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/GrpcTpuStub.java b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/GrpcTpuStub.java index 6e351b835616..d6b4c7cb878a 100644 --- a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/GrpcTpuStub.java +++ b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/GrpcTpuStub.java @@ -17,6 +17,7 @@ package com.google.cloud.tpu.v1.stub; import static com.google.cloud.tpu.v1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListLocationsPagedResponse; import static com.google.cloud.tpu.v1.TpuClient.ListNodesPagedResponse; import static com.google.cloud.tpu.v1.TpuClient.ListTensorFlowVersionsPagedResponse; @@ -27,6 +28,10 @@ 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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.tpu.v1.AcceleratorType; import com.google.cloud.tpu.v1.CreateNodeRequest; import com.google.cloud.tpu.v1.DeleteNodeRequest; @@ -163,6 +168,25 @@ public class GrpcTpuStub extends TpuStub { .setResponseMarshaller(ProtoUtils.marshaller(AcceleratorType.getDefaultInstance())) .build(); + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + private final UnaryCallable listNodesCallable; private final UnaryCallable listNodesPagedCallable; private final UnaryCallable getNodeCallable; @@ -193,6 +217,10 @@ public class GrpcTpuStub extends TpuStub { listAcceleratorTypesPagedCallable; private final UnaryCallable getAcceleratorTypeCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -346,6 +374,26 @@ protected GrpcTpuStub( return params.build(); }) .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); this.listNodesCallable = callableFactory.createUnaryCallable( @@ -431,6 +479,15 @@ protected GrpcTpuStub( getAcceleratorTypeTransportSettings, settings.getAcceleratorTypeSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -543,6 +600,22 @@ public UnaryCallable getAcceleratorT return getAcceleratorTypeCallable; } + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + @Override public final void close() { try { diff --git a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStub.java b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStub.java index 588921956a6a..68a151e21743 100644 --- a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStub.java +++ b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStub.java @@ -17,12 +17,17 @@ package com.google.cloud.tpu.v1.stub; import static com.google.cloud.tpu.v1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListLocationsPagedResponse; 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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.tpu.v1.AcceleratorType; import com.google.cloud.tpu.v1.CreateNodeRequest; import com.google.cloud.tpu.v1.DeleteNodeRequest; @@ -143,6 +148,19 @@ public UnaryCallable getAcceleratorT throw new UnsupportedOperationException("Not implemented: getAcceleratorTypeCallable()"); } + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + @Override public abstract void close(); } diff --git a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStubSettings.java b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStubSettings.java index a527232ad04e..8eb353e6b2cf 100644 --- a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStubSettings.java +++ b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/stub/TpuStubSettings.java @@ -17,6 +17,7 @@ package com.google.cloud.tpu.v1.stub; import static com.google.cloud.tpu.v1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListLocationsPagedResponse; import static com.google.cloud.tpu.v1.TpuClient.ListNodesPagedResponse; import static com.google.cloud.tpu.v1.TpuClient.ListTensorFlowVersionsPagedResponse; @@ -46,6 +47,10 @@ 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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.tpu.v1.AcceleratorType; import com.google.cloud.tpu.v1.CreateNodeRequest; import com.google.cloud.tpu.v1.DeleteNodeRequest; @@ -145,6 +150,10 @@ public class TpuStubSettings extends StubSettings { listAcceleratorTypesSettings; private final UnaryCallSettings getAcceleratorTypeSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; private static final PagedListDescriptor LIST_NODES_PAGE_STR_DESC = @@ -266,6 +275,42 @@ public Iterable extractResources( } }; + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + private static final PagedListResponseFactory< ListNodesRequest, ListNodesResponse, ListNodesPagedResponse> LIST_NODES_PAGE_STR_FACT = @@ -334,6 +379,23 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listNodes. */ public PagedCallSettings listNodesSettings() { @@ -430,6 +492,17 @@ public UnaryCallSettings startNodeSettings() { return getAcceleratorTypeSettings; } + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + public TpuStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -520,6 +593,8 @@ protected TpuStubSettings(Builder settingsBuilder) throws IOException { getTensorFlowVersionSettings = settingsBuilder.getTensorFlowVersionSettings().build(); listAcceleratorTypesSettings = settingsBuilder.listAcceleratorTypesSettings().build(); getAcceleratorTypeSettings = settingsBuilder.getAcceleratorTypeSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); } /** Builder for TpuStubSettings. */ @@ -558,6 +633,10 @@ public static class Builder extends StubSettings.Builder getAcceleratorTypeSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -610,6 +689,8 @@ protected Builder(ClientContext clientContext) { listAcceleratorTypesSettings = PagedCallSettings.newBuilder(LIST_ACCELERATOR_TYPES_PAGE_STR_FACT); getAcceleratorTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -623,7 +704,9 @@ protected Builder(ClientContext clientContext) { listTensorFlowVersionsSettings, getTensorFlowVersionSettings, listAcceleratorTypesSettings, - getAcceleratorTypeSettings); + getAcceleratorTypeSettings, + listLocationsSettings, + getLocationSettings); initDefaults(this); } @@ -646,6 +729,8 @@ protected Builder(TpuStubSettings settings) { getTensorFlowVersionSettings = settings.getTensorFlowVersionSettings.toBuilder(); listAcceleratorTypesSettings = settings.listAcceleratorTypesSettings.toBuilder(); getAcceleratorTypeSettings = settings.getAcceleratorTypeSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -659,7 +744,9 @@ protected Builder(TpuStubSettings settings) { listTensorFlowVersionsSettings, getTensorFlowVersionSettings, listAcceleratorTypesSettings, - getAcceleratorTypeSettings); + getAcceleratorTypeSettings, + listLocationsSettings, + getLocationSettings); } private static Builder createDefault() { @@ -731,6 +818,16 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + builder .createNodeOperationSettings() .setInitialCallSettings( @@ -965,6 +1062,18 @@ public UnaryCallSettings.Builder startNodeSettings( return getAcceleratorTypeSettings; } + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + @Override public TpuStubSettings build() throws IOException { return new TpuStubSettings(this); diff --git a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/TpuClient.java b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/TpuClient.java new file mode 100644 index 000000000000..8b87de0d67d4 --- /dev/null +++ b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/TpuClient.java @@ -0,0 +1,2244 @@ +/* + * 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.v2; + +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.httpjson.longrunning.OperationsClient; +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.tpu.v2.stub.TpuStub; +import com.google.cloud.tpu.v2.stub.TpuStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +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 v2 + * + *

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);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@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.newHttpJsonBuilder().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 httpJsonOperationsClient; + private final com.google.longrunning.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 = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected TpuClient(TpuStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + 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 com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // 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]");
+   *   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();
+   *   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();
+   *   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.
+   *   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.
+   *   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(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
+   *           .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(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
+   *           .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(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
+   *           .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(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
+   *           .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(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
+   *           .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(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
+   *           .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: + * [description, tags, labels, metadata, network_config.enable_external_ips]. + * @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()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   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(LocationName 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 = LocationName.of("[PROJECT]", "[LOCATION]").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(LocationName.of("[PROJECT]", "[LOCATION]").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(LocationName.of("[PROJECT]", "[LOCATION]").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(LocationName.of("[PROJECT]", "[LOCATION]").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()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   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(LocationName 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 = LocationName.of("[PROJECT]", "[LOCATION]").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(LocationName.of("[PROJECT]", "[LOCATION]").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(LocationName.of("[PROJECT]", "[LOCATION]").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(LocationName.of("[PROJECT]", "[LOCATION]").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(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : tpuClient.listLocations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated 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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = tpuClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated 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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = tpuClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated 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()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = tpuClient.getLocation(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated 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()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = tpuClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + @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); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/TpuSettings.java b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/TpuSettings.java new file mode 100644 index 000000000000..0b5d389e57fb --- /dev/null +++ b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/TpuSettings.java @@ -0,0 +1,440 @@ +/* + * 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.v2; + +import static com.google.cloud.tpu.v2.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v2.TpuClient.ListLocationsPagedResponse; +import static com.google.cloud.tpu.v2.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v2.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.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.tpu.v2.stub.TpuStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link 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 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(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((TpuStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((TpuStubSettings) getStubSettings()).getLocationSettings(); + } + + 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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return TpuStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return TpuStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + 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 gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(TpuStubSettings.newHttpJsonBuilder()); + } + + 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(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + @Override + public TpuSettings build() throws IOException { + return new TpuSettings(this); + } + } +} diff --git a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/gapic_metadata.json b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/gapic_metadata.json new file mode 100644 index 000000000000..fe300048387b --- /dev/null +++ b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/gapic_metadata.json @@ -0,0 +1,63 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.tpu.v2", + "libraryPackage": "com.google.cloud.tpu.v2", + "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"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetNode": { + "methods": ["getNode", "getNode", "getNode", "getNodeCallable"] + }, + "GetRuntimeVersion": { + "methods": ["getRuntimeVersion", "getRuntimeVersion", "getRuntimeVersion", "getRuntimeVersionCallable"] + }, + "ListAcceleratorTypes": { + "methods": ["listAcceleratorTypes", "listAcceleratorTypes", "listAcceleratorTypes", "listAcceleratorTypesPagedCallable", "listAcceleratorTypesCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "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/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/package-info.java b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/package-info.java new file mode 100644 index 000000000000..f0a429235eaf --- /dev/null +++ b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/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 v2 + * + *

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.v2; + +import javax.annotation.Generated; diff --git a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/GrpcTpuCallableFactory.java b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/GrpcTpuCallableFactory.java new file mode 100644 index 000000000000..068d5163059d --- /dev/null +++ b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/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.v2.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/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/GrpcTpuStub.java b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/GrpcTpuStub.java new file mode 100644 index 000000000000..2837d3ea1b20 --- /dev/null +++ b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/GrpcTpuStub.java @@ -0,0 +1,726 @@ +/* + * 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.v2.stub; + +import static com.google.cloud.tpu.v2.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v2.TpuClient.ListLocationsPagedResponse; +import static com.google.cloud.tpu.v2.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v2.TpuClient.ListRuntimeVersionsPagedResponse; + +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.tpu.v2.AcceleratorType; +import com.google.cloud.tpu.v2.CreateNodeRequest; +import com.google.cloud.tpu.v2.DeleteNodeRequest; +import com.google.cloud.tpu.v2.GenerateServiceIdentityRequest; +import com.google.cloud.tpu.v2.GenerateServiceIdentityResponse; +import com.google.cloud.tpu.v2.GetAcceleratorTypeRequest; +import com.google.cloud.tpu.v2.GetGuestAttributesRequest; +import com.google.cloud.tpu.v2.GetGuestAttributesResponse; +import com.google.cloud.tpu.v2.GetNodeRequest; +import com.google.cloud.tpu.v2.GetRuntimeVersionRequest; +import com.google.cloud.tpu.v2.ListAcceleratorTypesRequest; +import com.google.cloud.tpu.v2.ListAcceleratorTypesResponse; +import com.google.cloud.tpu.v2.ListNodesRequest; +import com.google.cloud.tpu.v2.ListNodesResponse; +import com.google.cloud.tpu.v2.ListRuntimeVersionsRequest; +import com.google.cloud.tpu.v2.ListRuntimeVersionsResponse; +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.OperationMetadata; +import com.google.cloud.tpu.v2.RuntimeVersion; +import com.google.cloud.tpu.v2.StartNodeRequest; +import com.google.cloud.tpu.v2.StopNodeRequest; +import com.google.cloud.tpu.v2.UpdateNodeRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the 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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Tpu/GetGuestAttributes") + .setRequestMarshaller( + ProtoUtils.marshaller(GetGuestAttributesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GetGuestAttributesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private 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 UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + 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(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + + 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.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), 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 UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/HttpJsonTpuCallableFactory.java b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/HttpJsonTpuCallableFactory.java new file mode 100644 index 000000000000..68b0e22df8dd --- /dev/null +++ b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/HttpJsonTpuCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Tpu service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonTpuCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/HttpJsonTpuStub.java b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/HttpJsonTpuStub.java new file mode 100644 index 000000000000..09d996c00c5c --- /dev/null +++ b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/HttpJsonTpuStub.java @@ -0,0 +1,1117 @@ +/* + * 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.v2.stub; + +import static com.google.cloud.tpu.v2.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v2.TpuClient.ListLocationsPagedResponse; +import static com.google.cloud.tpu.v2.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v2.TpuClient.ListRuntimeVersionsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.tpu.v2.AcceleratorType; +import com.google.cloud.tpu.v2.CreateNodeRequest; +import com.google.cloud.tpu.v2.DeleteNodeRequest; +import com.google.cloud.tpu.v2.GenerateServiceIdentityRequest; +import com.google.cloud.tpu.v2.GenerateServiceIdentityResponse; +import com.google.cloud.tpu.v2.GetAcceleratorTypeRequest; +import com.google.cloud.tpu.v2.GetGuestAttributesRequest; +import com.google.cloud.tpu.v2.GetGuestAttributesResponse; +import com.google.cloud.tpu.v2.GetNodeRequest; +import com.google.cloud.tpu.v2.GetRuntimeVersionRequest; +import com.google.cloud.tpu.v2.ListAcceleratorTypesRequest; +import com.google.cloud.tpu.v2.ListAcceleratorTypesResponse; +import com.google.cloud.tpu.v2.ListNodesRequest; +import com.google.cloud.tpu.v2.ListNodesResponse; +import com.google.cloud.tpu.v2.ListRuntimeVersionsRequest; +import com.google.cloud.tpu.v2.ListRuntimeVersionsResponse; +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.OperationMetadata; +import com.google.cloud.tpu.v2.RuntimeVersion; +import com.google.cloud.tpu.v2.StartNodeRequest; +import com.google.cloud.tpu.v2.StopNodeRequest; +import com.google.cloud.tpu.v2.UpdateNodeRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Tpu service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonTpuStub extends TpuStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Empty.getDescriptor()) + .add(OperationMetadata.getDescriptor()) + .add(Node.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + listNodesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.tpu.v2.Tpu/ListNodes") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{parent=projects/*/locations/*}/nodes", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListNodesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getNodeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.tpu.v2.Tpu/GetNode") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{name=projects/*/locations/*/nodes/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Node.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createNodeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.tpu.v2.Tpu/CreateNode") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{parent=projects/*/locations/*}/nodes", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "nodeId", request.getNodeId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("node", request.getNode(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateNodeRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteNodeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.tpu.v2.Tpu/DeleteNode") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{name=projects/*/locations/*/nodes/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteNodeRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor stopNodeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.tpu.v2.Tpu/StopNode") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{name=projects/*/locations/*/nodes/*}:stop", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (StopNodeRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor startNodeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.tpu.v2.Tpu/StartNode") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{name=projects/*/locations/*/nodes/*}:start", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (StartNodeRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateNodeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.tpu.v2.Tpu/UpdateNode") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{node.name=projects/*/locations/*/nodes/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "node.name", request.getNode().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("node", request.getNode(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateNodeRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor< + GenerateServiceIdentityRequest, GenerateServiceIdentityResponse> + generateServiceIdentityMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("google.cloud.tpu.v2.Tpu/GenerateServiceIdentity") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{parent=projects/*/locations/*}:generateServiceIdentity", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GenerateServiceIdentityResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListAcceleratorTypesRequest, ListAcceleratorTypesResponse> + listAcceleratorTypesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("google.cloud.tpu.v2.Tpu/ListAcceleratorTypes") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{parent=projects/*/locations/*}/acceleratorTypes", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListAcceleratorTypesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getAcceleratorTypeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.tpu.v2.Tpu/GetAcceleratorType") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{name=projects/*/locations/*/acceleratorTypes/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(AcceleratorType.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listRuntimeVersionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.tpu.v2.Tpu/ListRuntimeVersions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{parent=projects/*/locations/*}/runtimeVersions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListRuntimeVersionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getRuntimeVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.tpu.v2.Tpu/GetRuntimeVersion") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{name=projects/*/locations/*/runtimeVersions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RuntimeVersion.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getGuestAttributesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.tpu.v2.Tpu/GetGuestAttributes") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{name=projects/*/locations/*/nodes/*}:getGuestAttributes", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GetGuestAttributesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1/{name=projects/*}/locations", + "/v2alpha1/{name=projects/*}/locations", + "/v2/{name=projects/*}/locations") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1/{name=projects/*/locations/*}", + "/v2alpha1/{name=projects/*/locations/*}", + "/v2/{name=projects/*/locations/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .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 UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonTpuStub create(TpuStubSettings settings) throws IOException { + return new HttpJsonTpuStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonTpuStub create(ClientContext clientContext) throws IOException { + return new HttpJsonTpuStub(TpuStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonTpuStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonTpuStub( + TpuStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonTpuStub, 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 HttpJsonTpuStub(TpuStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonTpuCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonTpuStub, 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 HttpJsonTpuStub( + TpuStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings listNodesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listNodesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getNodeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getNodeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createNodeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createNodeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteNodeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteNodeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings stopNodeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(stopNodeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings startNodeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(startNodeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateNodeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateNodeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + generateServiceIdentityTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(generateServiceIdentityMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listAcceleratorTypesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listAcceleratorTypesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + getAcceleratorTypeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getAcceleratorTypeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listRuntimeVersionsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listRuntimeVersionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + getRuntimeVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRuntimeVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + getGuestAttributesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getGuestAttributesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .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, + httpJsonOperationsStub); + this.deleteNodeCallable = + callableFactory.createUnaryCallable( + deleteNodeTransportSettings, settings.deleteNodeSettings(), clientContext); + this.deleteNodeOperationCallable = + callableFactory.createOperationCallable( + deleteNodeTransportSettings, + settings.deleteNodeOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.stopNodeCallable = + callableFactory.createUnaryCallable( + stopNodeTransportSettings, settings.stopNodeSettings(), clientContext); + this.stopNodeOperationCallable = + callableFactory.createOperationCallable( + stopNodeTransportSettings, + settings.stopNodeOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.startNodeCallable = + callableFactory.createUnaryCallable( + startNodeTransportSettings, settings.startNodeSettings(), clientContext); + this.startNodeOperationCallable = + callableFactory.createOperationCallable( + startNodeTransportSettings, + settings.startNodeOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateNodeCallable = + callableFactory.createUnaryCallable( + updateNodeTransportSettings, settings.updateNodeSettings(), clientContext); + this.updateNodeOperationCallable = + callableFactory.createOperationCallable( + updateNodeTransportSettings, + settings.updateNodeOperationSettings(), + clientContext, + httpJsonOperationsStub); + 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.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listNodesMethodDescriptor); + methodDescriptors.add(getNodeMethodDescriptor); + methodDescriptors.add(createNodeMethodDescriptor); + methodDescriptors.add(deleteNodeMethodDescriptor); + methodDescriptors.add(stopNodeMethodDescriptor); + methodDescriptors.add(startNodeMethodDescriptor); + methodDescriptors.add(updateNodeMethodDescriptor); + methodDescriptors.add(generateServiceIdentityMethodDescriptor); + methodDescriptors.add(listAcceleratorTypesMethodDescriptor); + methodDescriptors.add(getAcceleratorTypeMethodDescriptor); + methodDescriptors.add(listRuntimeVersionsMethodDescriptor); + methodDescriptors.add(getRuntimeVersionMethodDescriptor); + methodDescriptors.add(getGuestAttributesMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @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 UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/TpuStub.java b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/TpuStub.java new file mode 100644 index 000000000000..40e5b83b1807 --- /dev/null +++ b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/TpuStub.java @@ -0,0 +1,183 @@ +/* + * 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.v2.stub; + +import static com.google.cloud.tpu.v2.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v2.TpuClient.ListLocationsPagedResponse; +import static com.google.cloud.tpu.v2.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v2.TpuClient.ListRuntimeVersionsPagedResponse; + +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.tpu.v2.AcceleratorType; +import com.google.cloud.tpu.v2.CreateNodeRequest; +import com.google.cloud.tpu.v2.DeleteNodeRequest; +import com.google.cloud.tpu.v2.GenerateServiceIdentityRequest; +import com.google.cloud.tpu.v2.GenerateServiceIdentityResponse; +import com.google.cloud.tpu.v2.GetAcceleratorTypeRequest; +import com.google.cloud.tpu.v2.GetGuestAttributesRequest; +import com.google.cloud.tpu.v2.GetGuestAttributesResponse; +import com.google.cloud.tpu.v2.GetNodeRequest; +import com.google.cloud.tpu.v2.GetRuntimeVersionRequest; +import com.google.cloud.tpu.v2.ListAcceleratorTypesRequest; +import com.google.cloud.tpu.v2.ListAcceleratorTypesResponse; +import com.google.cloud.tpu.v2.ListNodesRequest; +import com.google.cloud.tpu.v2.ListNodesResponse; +import com.google.cloud.tpu.v2.ListRuntimeVersionsRequest; +import com.google.cloud.tpu.v2.ListRuntimeVersionsResponse; +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.OperationMetadata; +import com.google.cloud.tpu.v2.RuntimeVersion; +import com.google.cloud.tpu.v2.StartNodeRequest; +import com.google.cloud.tpu.v2.StopNodeRequest; +import com.google.cloud.tpu.v2.UpdateNodeRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the 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() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + 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()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/TpuStubSettings.java b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/TpuStubSettings.java new file mode 100644 index 000000000000..3612ad9e4435 --- /dev/null +++ b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/TpuStubSettings.java @@ -0,0 +1,1174 @@ +/* + * 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.v2.stub; + +import static com.google.cloud.tpu.v2.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v2.TpuClient.ListLocationsPagedResponse; +import static com.google.cloud.tpu.v2.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v2.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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.tpu.v2.AcceleratorType; +import com.google.cloud.tpu.v2.CreateNodeRequest; +import com.google.cloud.tpu.v2.DeleteNodeRequest; +import com.google.cloud.tpu.v2.GenerateServiceIdentityRequest; +import com.google.cloud.tpu.v2.GenerateServiceIdentityResponse; +import com.google.cloud.tpu.v2.GetAcceleratorTypeRequest; +import com.google.cloud.tpu.v2.GetGuestAttributesRequest; +import com.google.cloud.tpu.v2.GetGuestAttributesResponse; +import com.google.cloud.tpu.v2.GetNodeRequest; +import com.google.cloud.tpu.v2.GetRuntimeVersionRequest; +import com.google.cloud.tpu.v2.ListAcceleratorTypesRequest; +import com.google.cloud.tpu.v2.ListAcceleratorTypesResponse; +import com.google.cloud.tpu.v2.ListNodesRequest; +import com.google.cloud.tpu.v2.ListNodesResponse; +import com.google.cloud.tpu.v2.ListRuntimeVersionsRequest; +import com.google.cloud.tpu.v2.ListRuntimeVersionsResponse; +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.OperationMetadata; +import com.google.cloud.tpu.v2.RuntimeVersion; +import com.google.cloud.tpu.v2.StartNodeRequest; +import com.google.cloud.tpu.v2.StopNodeRequest; +import com.google.cloud.tpu.v2.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 com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link 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 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 final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + + 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 PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + 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); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to 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; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + public TpuStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcTpuStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonTpuStub.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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + 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 defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TpuStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TpuStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TpuStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().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 final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + 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(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listNodesSettings, + getNodeSettings, + createNodeSettings, + deleteNodeSettings, + stopNodeSettings, + startNodeSettings, + updateNodeSettings, + generateServiceIdentitySettings, + listAcceleratorTypesSettings, + getAcceleratorTypeSettings, + listRuntimeVersionsSettings, + getRuntimeVersionSettings, + getGuestAttributesSettings, + listLocationsSettings, + getLocationSettings); + 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(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listNodesSettings, + getNodeSettings, + createNodeSettings, + deleteNodeSettings, + stopNodeSettings, + startNodeSettings, + updateNodeSettings, + generateServiceIdentitySettings, + listAcceleratorTypesSettings, + getAcceleratorTypeSettings, + listRuntimeVersionsSettings, + getRuntimeVersionSettings, + getGuestAttributesSettings, + listLocationsSettings, + getLocationSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().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 + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getLocationSettings() + .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(Empty.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; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + @Override + public TpuStubSettings build() throws IOException { + return new TpuStubSettings(this); + } + } +} diff --git a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuClient.java b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuClient.java index 7a1fbd831549..e9f3f21dda6b 100644 --- a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuClient.java +++ b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuClient.java @@ -27,11 +27,16 @@ 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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; 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.Empty; import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; @@ -187,7 +192,7 @@ public final OperationsClient getOperationsClient() { * // - 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]"); + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); * for (Node element : tpuClient.listNodes(parent).iterateAll()) { * // doThingsWith(element); * } @@ -197,7 +202,7 @@ public final OperationsClient getOperationsClient() { * @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) { + public final ListNodesPagedResponse listNodes(LocationName parent) { ListNodesRequest request = ListNodesRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); return listNodes(request); @@ -216,7 +221,7 @@ public final ListNodesPagedResponse listNodes(NodeName parent) { * // - 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(); + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); * for (Node element : tpuClient.listNodes(parent).iterateAll()) { * // doThingsWith(element); * } @@ -246,7 +251,7 @@ public final ListNodesPagedResponse listNodes(String parent) { * try (TpuClient tpuClient = TpuClient.create()) { * ListNodesRequest request = * ListNodesRequest.newBuilder() - * .setParent(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); @@ -278,7 +283,7 @@ public final ListNodesPagedResponse listNodes(ListNodesRequest request) { * try (TpuClient tpuClient = TpuClient.create()) { * ListNodesRequest request = * ListNodesRequest.newBuilder() - * .setParent(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); @@ -309,7 +314,7 @@ public final UnaryCallable listNodesPa * try (TpuClient tpuClient = TpuClient.create()) { * ListNodesRequest request = * ListNodesRequest.newBuilder() - * .setParent(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); @@ -526,6 +531,7 @@ public final OperationFuture createNodeAsync( * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setNodeId("nodeId-1040171331") * .setNode(Node.newBuilder().build()) + * .setRequestId("requestId693933066") * .build(); * Node response = tpuClient.createNodeAsync(request).get(); * } @@ -556,6 +562,7 @@ public final OperationFuture createNodeAsync(CreateNode * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setNodeId("nodeId-1040171331") * .setNode(Node.newBuilder().build()) + * .setRequestId("requestId693933066") * .build(); * OperationFuture future = * tpuClient.createNodeOperationCallable().futureCall(request); @@ -587,6 +594,7 @@ public final OperationFuture createNodeAsync(CreateNode * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setNodeId("nodeId-1040171331") * .setNode(Node.newBuilder().build()) + * .setRequestId("requestId693933066") * .build(); * ApiFuture future = tpuClient.createNodeCallable().futureCall(request); * // Do something. @@ -612,14 +620,14 @@ public final UnaryCallable createNodeCallable() { * // 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(); + * 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) { + public final OperationFuture deleteNodeAsync(NodeName name) { DeleteNodeRequest request = DeleteNodeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return deleteNodeAsync(request); @@ -639,14 +647,14 @@ public final OperationFuture deleteNodeAsync(NodeName n * // 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(); + * 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) { + public final OperationFuture deleteNodeAsync(String name) { DeleteNodeRequest request = DeleteNodeRequest.newBuilder().setName(name).build(); return deleteNodeAsync(request); } @@ -667,15 +675,17 @@ public final OperationFuture deleteNodeAsync(String nam * DeleteNodeRequest request = * DeleteNodeRequest.newBuilder() * .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + * .setRequestId("requestId693933066") * .build(); - * Node response = tpuClient.deleteNodeAsync(request).get(); + * 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) { + public final OperationFuture deleteNodeAsync( + DeleteNodeRequest request) { return deleteNodeOperationCallable().futureCall(request); } @@ -695,15 +705,16 @@ public final OperationFuture deleteNodeAsync(DeleteNode * DeleteNodeRequest request = * DeleteNodeRequest.newBuilder() * .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + * .setRequestId("requestId693933066") * .build(); - * OperationFuture future = + * OperationFuture future = * tpuClient.deleteNodeOperationCallable().futureCall(request); * // Do something. - * Node response = future.get(); + * future.get(); * } * } */ - public final OperationCallable + public final OperationCallable deleteNodeOperationCallable() { return stub.deleteNodeOperationCallable(); } @@ -724,10 +735,11 @@ public final OperationFuture deleteNodeAsync(DeleteNode * DeleteNodeRequest request = * DeleteNodeRequest.newBuilder() * .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + * .setRequestId("requestId693933066") * .build(); * ApiFuture future = tpuClient.deleteNodeCallable().futureCall(request); * // Do something. - * Operation response = future.get(); + * future.get(); * } * } */ @@ -748,7 +760,10 @@ public final UnaryCallable deleteNodeCallable() { * // - 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(); + * StopNodeRequest request = + * StopNodeRequest.newBuilder() + * .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + * .build(); * Node response = tpuClient.stopNodeAsync(request).get(); * } * } @@ -773,7 +788,10 @@ public final OperationFuture stopNodeAsync(StopNodeRequ * // - 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(); + * StopNodeRequest request = + * StopNodeRequest.newBuilder() + * .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + * .build(); * OperationFuture future = * tpuClient.stopNodeOperationCallable().futureCall(request); * // Do something. @@ -799,7 +817,10 @@ public final OperationFuture stopNodeAsync(StopNodeRequ * // - 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(); + * StopNodeRequest request = + * StopNodeRequest.newBuilder() + * .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + * .build(); * ApiFuture future = tpuClient.stopNodeCallable().futureCall(request); * // Do something. * Operation response = future.get(); @@ -823,7 +844,10 @@ public final UnaryCallable stopNodeCallable() { * // - 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(); + * StartNodeRequest request = + * StartNodeRequest.newBuilder() + * .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + * .build(); * Node response = tpuClient.startNodeAsync(request).get(); * } * } @@ -848,7 +872,10 @@ public final OperationFuture startNodeAsync(StartNodeRe * // - 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(); + * StartNodeRequest request = + * StartNodeRequest.newBuilder() + * .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + * .build(); * OperationFuture future = * tpuClient.startNodeOperationCallable().futureCall(request); * // Do something. @@ -874,7 +901,10 @@ public final OperationFuture startNodeAsync(StartNodeRe * // - 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(); + * StartNodeRequest request = + * StartNodeRequest.newBuilder() + * .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + * .build(); * ApiFuture future = tpuClient.startNodeCallable().futureCall(request); * // Do something. * Operation response = future.get(); @@ -906,7 +936,7 @@ public final UnaryCallable startNodeCallable() { * * @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. + * [description, tags, labels, metadata, network_config.enable_external_ips]. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture updateNodeAsync( @@ -1005,65 +1035,7 @@ public final UnaryCallable 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. + * Lists queued resources. * *

Sample code: * @@ -1074,9 +1046,8 @@ public final GenerateServiceIdentityResponse generateServiceIdentity( * // - 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()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (QueuedResource element : tpuClient.listQueuedResources(parent).iterateAll()) { * // doThingsWith(element); * } * } @@ -1085,17 +1056,17 @@ public final GenerateServiceIdentityResponse generateServiceIdentity( * @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() + public final ListQueuedResourcesPagedResponse listQueuedResources(LocationName parent) { + ListQueuedResourcesRequest request = + ListQueuedResourcesRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build(); - return listAcceleratorTypes(request); + return listQueuedResources(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists accelerator types supported by this API. + * Lists queued resources. * *

Sample code: * @@ -1106,9 +1077,8 @@ public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(AcceleratorT * // - 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()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (QueuedResource element : tpuClient.listQueuedResources(parent).iterateAll()) { * // doThingsWith(element); * } * } @@ -1117,15 +1087,15 @@ public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(AcceleratorT * @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); + public final ListQueuedResourcesPagedResponse listQueuedResources(String parent) { + ListQueuedResourcesRequest request = + ListQueuedResourcesRequest.newBuilder().setParent(parent).build(); + return listQueuedResources(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists accelerator types supported by this API. + * Lists queued resources. * *

Sample code: * @@ -1136,17 +1106,13 @@ public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(String paren * // - 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()) + * ListQueuedResourcesRequest request = + * ListQueuedResourcesRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") - * .setFilter("filter-1274492040") - * .setOrderBy("orderBy-1207110587") * .build(); - * for (AcceleratorType element : tpuClient.listAcceleratorTypes(request).iterateAll()) { + * for (QueuedResource element : tpuClient.listQueuedResources(request).iterateAll()) { * // doThingsWith(element); * } * } @@ -1155,14 +1121,14 @@ public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(String paren * @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); + public final ListQueuedResourcesPagedResponse listQueuedResources( + ListQueuedResourcesRequest request) { + return listQueuedResourcesPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists accelerator types supported by this API. + * Lists queued resources. * *

Sample code: * @@ -1173,33 +1139,29 @@ public final ListAcceleratorTypesPagedResponse listAcceleratorTypes( * // - 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()) + * ListQueuedResourcesRequest request = + * ListQueuedResourcesRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") - * .setFilter("filter-1274492040") - * .setOrderBy("orderBy-1207110587") * .build(); - * ApiFuture future = - * tpuClient.listAcceleratorTypesPagedCallable().futureCall(request); + * ApiFuture future = + * tpuClient.listQueuedResourcesPagedCallable().futureCall(request); * // Do something. - * for (AcceleratorType element : future.get().iterateAll()) { + * for (QueuedResource element : future.get().iterateAll()) { * // doThingsWith(element); * } * } * } */ - public final UnaryCallable - listAcceleratorTypesPagedCallable() { - return stub.listAcceleratorTypesPagedCallable(); + public final UnaryCallable + listQueuedResourcesPagedCallable() { + return stub.listQueuedResourcesPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists accelerator types supported by this API. + * Lists queued resources. * *

Sample code: * @@ -1210,20 +1172,16 @@ public final ListAcceleratorTypesPagedResponse listAcceleratorTypes( * // - 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()) + * ListQueuedResourcesRequest request = + * ListQueuedResourcesRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").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()) { + * ListQueuedResourcesResponse response = + * tpuClient.listQueuedResourcesCallable().call(request); + * for (QueuedResource element : response.getQueuedResourcesList()) { * // doThingsWith(element); * } * String nextPageToken = response.getNextPageToken(); @@ -1236,14 +1194,14 @@ public final ListAcceleratorTypesPagedResponse listAcceleratorTypes( * } * } */ - public final UnaryCallable - listAcceleratorTypesCallable() { - return stub.listAcceleratorTypesCallable(); + public final UnaryCallable + listQueuedResourcesCallable() { + return stub.listQueuedResourcesCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets AcceleratorType. + * Gets details of a queued resource. * *

Sample code: * @@ -1254,26 +1212,26 @@ public final ListAcceleratorTypesPagedResponse listAcceleratorTypes( * // - 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); + * QueuedResourceName name = + * QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]"); + * QueuedResource response = tpuClient.getQueuedResource(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() + public final QueuedResource getQueuedResource(QueuedResourceName name) { + GetQueuedResourceRequest request = + GetQueuedResourceRequest.newBuilder() .setName(name == null ? null : name.toString()) .build(); - return getAcceleratorType(request); + return getQueuedResource(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets AcceleratorType. + * Gets details of a queued resource. * *

Sample code: * @@ -1285,23 +1243,22 @@ public final AcceleratorType getAcceleratorType(AcceleratorTypeName name) { * // 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); + * QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString(); + * QueuedResource response = tpuClient.getQueuedResource(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); + public final QueuedResource getQueuedResource(String name) { + GetQueuedResourceRequest request = GetQueuedResourceRequest.newBuilder().setName(name).build(); + return getQueuedResource(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets AcceleratorType. + * Gets details of a queued resource. * *

Sample code: * @@ -1312,26 +1269,25 @@ public final AcceleratorType getAcceleratorType(String name) { * // - 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() + * GetQueuedResourceRequest request = + * GetQueuedResourceRequest.newBuilder() * .setName( - * AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]") - * .toString()) + * QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString()) * .build(); - * AcceleratorType response = tpuClient.getAcceleratorType(request); + * QueuedResource response = tpuClient.getQueuedResource(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); + public final QueuedResource getQueuedResource(GetQueuedResourceRequest request) { + return getQueuedResourceCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets AcceleratorType. + * Gets details of a queued resource. * *

Sample code: * @@ -1342,27 +1298,24 @@ public final AcceleratorType getAcceleratorType(GetAcceleratorTypeRequest reques * // - 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() + * GetQueuedResourceRequest request = + * GetQueuedResourceRequest.newBuilder() * .setName( - * AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]") - * .toString()) + * QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString()) * .build(); - * ApiFuture future = - * tpuClient.getAcceleratorTypeCallable().futureCall(request); + * ApiFuture future = tpuClient.getQueuedResourceCallable().futureCall(request); * // Do something. - * AcceleratorType response = future.get(); + * QueuedResource response = future.get(); * } * } */ - public final UnaryCallable - getAcceleratorTypeCallable() { - return stub.getAcceleratorTypeCallable(); + public final UnaryCallable getQueuedResourceCallable() { + return stub.getQueuedResourceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists runtime versions supported by this API. + * Creates a QueuedResource TPU instance. * *

Sample code: * @@ -1373,28 +1326,34 @@ public final AcceleratorType getAcceleratorType(GetAcceleratorTypeRequest reques * // - 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); - * } + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * QueuedResource queuedResource = QueuedResource.newBuilder().build(); + * String queuedResourceId = "queuedResourceId437646236"; + * QueuedResource response = + * tpuClient.createQueuedResourceAsync(parent, queuedResource, queuedResourceId).get(); * } * } * * @param parent Required. The parent resource name. + * @param queuedResource Required. The queued resource. + * @param queuedResourceId The unqualified resource name. Should follow the ^[A-Za-z0-9_.~+%-]+$ + * regex format. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListRuntimeVersionsPagedResponse listRuntimeVersions(RuntimeVersionName parent) { - ListRuntimeVersionsRequest request = - ListRuntimeVersionsRequest.newBuilder() + public final OperationFuture createQueuedResourceAsync( + LocationName parent, QueuedResource queuedResource, String queuedResourceId) { + CreateQueuedResourceRequest request = + CreateQueuedResourceRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) + .setQueuedResource(queuedResource) + .setQueuedResourceId(queuedResourceId) .build(); - return listRuntimeVersions(request); + return createQueuedResourceAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists runtime versions supported by this API. + * Creates a QueuedResource TPU instance. * *

Sample code: * @@ -1405,26 +1364,34 @@ public final ListRuntimeVersionsPagedResponse listRuntimeVersions(RuntimeVersion * // - 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); - * } + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * QueuedResource queuedResource = QueuedResource.newBuilder().build(); + * String queuedResourceId = "queuedResourceId437646236"; + * QueuedResource response = + * tpuClient.createQueuedResourceAsync(parent, queuedResource, queuedResourceId).get(); * } * } * * @param parent Required. The parent resource name. + * @param queuedResource Required. The queued resource. + * @param queuedResourceId The unqualified resource name. Should follow the ^[A-Za-z0-9_.~+%-]+$ + * regex format. * @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); + public final OperationFuture createQueuedResourceAsync( + String parent, QueuedResource queuedResource, String queuedResourceId) { + CreateQueuedResourceRequest request = + CreateQueuedResourceRequest.newBuilder() + .setParent(parent) + .setQueuedResource(queuedResource) + .setQueuedResourceId(queuedResourceId) + .build(); + return createQueuedResourceAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists runtime versions supported by this API. + * Creates a QueuedResource TPU instance. * *

Sample code: * @@ -1435,32 +1402,28 @@ public final ListRuntimeVersionsPagedResponse listRuntimeVersions(String parent) * // - 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") + * CreateQueuedResourceRequest request = + * CreateQueuedResourceRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setQueuedResourceId("queuedResourceId437646236") + * .setQueuedResource(QueuedResource.newBuilder().build()) + * .setRequestId("requestId693933066") * .build(); - * for (RuntimeVersion element : tpuClient.listRuntimeVersions(request).iterateAll()) { - * // doThingsWith(element); - * } + * QueuedResource response = tpuClient.createQueuedResourceAsync(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 ListRuntimeVersionsPagedResponse listRuntimeVersions( - ListRuntimeVersionsRequest request) { - return listRuntimeVersionsPagedCallable().call(request); + public final OperationFuture createQueuedResourceAsync( + CreateQueuedResourceRequest request) { + return createQueuedResourceOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists runtime versions supported by this API. + * Creates a QueuedResource TPU instance. * *

Sample code: * @@ -1471,32 +1434,28 @@ public final ListRuntimeVersionsPagedResponse listRuntimeVersions( * // - 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") + * CreateQueuedResourceRequest request = + * CreateQueuedResourceRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setQueuedResourceId("queuedResourceId437646236") + * .setQueuedResource(QueuedResource.newBuilder().build()) + * .setRequestId("requestId693933066") * .build(); - * ApiFuture future = - * tpuClient.listRuntimeVersionsPagedCallable().futureCall(request); + * OperationFuture future = + * tpuClient.createQueuedResourceOperationCallable().futureCall(request); * // Do something. - * for (RuntimeVersion element : future.get().iterateAll()) { - * // doThingsWith(element); - * } + * QueuedResource response = future.get(); * } * } */ - public final UnaryCallable - listRuntimeVersionsPagedCallable() { - return stub.listRuntimeVersionsPagedCallable(); + public final OperationCallable + createQueuedResourceOperationCallable() { + return stub.createQueuedResourceOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists runtime versions supported by this API. + * Creates a QueuedResource TPU instance. * *

Sample code: * @@ -1507,39 +1466,27 @@ public final ListRuntimeVersionsPagedResponse listRuntimeVersions( * // - 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") + * CreateQueuedResourceRequest request = + * CreateQueuedResourceRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setQueuedResourceId("queuedResourceId437646236") + * .setQueuedResource(QueuedResource.newBuilder().build()) + * .setRequestId("requestId693933066") * .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; - * } - * } + * ApiFuture future = tpuClient.createQueuedResourceCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); * } * } */ - public final UnaryCallable - listRuntimeVersionsCallable() { - return stub.listRuntimeVersionsCallable(); + public final UnaryCallable + createQueuedResourceCallable() { + return stub.createQueuedResourceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets a runtime version. + * Deletes a QueuedResource TPU instance. * *

Sample code: * @@ -1550,26 +1497,27 @@ public final ListRuntimeVersionsPagedResponse listRuntimeVersions( * // - 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); + * QueuedResourceName name = + * QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]"); + * QueuedResource response = tpuClient.deleteQueuedResourceAsync(name).get(); * } * } * * @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() + public final OperationFuture deleteQueuedResourceAsync( + QueuedResourceName name) { + DeleteQueuedResourceRequest request = + DeleteQueuedResourceRequest.newBuilder() .setName(name == null ? null : name.toString()) .build(); - return getRuntimeVersion(request); + return deleteQueuedResourceAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets a runtime version. + * Deletes a QueuedResource TPU instance. * *

Sample code: * @@ -1581,22 +1529,781 @@ public final RuntimeVersion getRuntimeVersion(RuntimeVersionName name) { * // 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(); + * QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString(); + * QueuedResource response = tpuClient.deleteQueuedResourceAsync(name).get(); + * } + * } + * + * @param name Required. The resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteQueuedResourceAsync( + String name) { + DeleteQueuedResourceRequest request = + DeleteQueuedResourceRequest.newBuilder().setName(name).build(); + return deleteQueuedResourceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a QueuedResource TPU instance. + * + *

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()) {
+   *   DeleteQueuedResourceRequest request =
+   *       DeleteQueuedResourceRequest.newBuilder()
+   *           .setName(
+   *               QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   QueuedResource response = tpuClient.deleteQueuedResourceAsync(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 deleteQueuedResourceAsync( + DeleteQueuedResourceRequest request) { + return deleteQueuedResourceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a QueuedResource TPU instance. + * + *

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()) {
+   *   DeleteQueuedResourceRequest request =
+   *       DeleteQueuedResourceRequest.newBuilder()
+   *           .setName(
+   *               QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       tpuClient.deleteQueuedResourceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   QueuedResource response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteQueuedResourceOperationCallable() { + return stub.deleteQueuedResourceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a QueuedResource TPU instance. + * + *

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()) {
+   *   DeleteQueuedResourceRequest request =
+   *       DeleteQueuedResourceRequest.newBuilder()
+   *           .setName(
+   *               QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future = tpuClient.deleteQueuedResourceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + deleteQueuedResourceCallable() { + return stub.deleteQueuedResourceCallable(); + } + + // 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()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   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(LocationName 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 = LocationName.of("[PROJECT]", "[LOCATION]").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(LocationName.of("[PROJECT]", "[LOCATION]").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(LocationName.of("[PROJECT]", "[LOCATION]").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(LocationName.of("[PROJECT]", "[LOCATION]").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()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   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(LocationName 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 = LocationName.of("[PROJECT]", "[LOCATION]").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(LocationName.of("[PROJECT]", "[LOCATION]").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(LocationName.of("[PROJECT]", "[LOCATION]").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(LocationName.of("[PROJECT]", "[LOCATION]").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. + * @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 RuntimeVersion getRuntimeVersion(String name) { - GetRuntimeVersionRequest request = GetRuntimeVersionRequest.newBuilder().setName(name).build(); - return getRuntimeVersion(request); + public final GetGuestAttributesResponse getGuestAttributes(GetGuestAttributesRequest request) { + return getGuestAttributesCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets a runtime version. + * Retrieves the guest attributes for the node. * *

Sample code: * @@ -1607,25 +2314,57 @@ public final RuntimeVersion getRuntimeVersion(String name) { * // - 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()) + * GetGuestAttributesRequest request = + * GetGuestAttributesRequest.newBuilder() + * .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + * .setQueryPath("queryPath-1807004403") + * .addAllWorkerIds(new ArrayList()) * .build(); - * RuntimeVersion response = tpuClient.getRuntimeVersion(request); + * ApiFuture future = + * tpuClient.getGuestAttributesCallable().futureCall(request); + * // Do something. + * GetGuestAttributesResponse response = future.get(); + * } + * } + */ + public final UnaryCallable + getGuestAttributesCallable() { + return stub.getGuestAttributesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Simulates a maintenance event. + * + *

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()) {
+   *   SimulateMaintenanceEventRequest request =
+   *       SimulateMaintenanceEventRequest.newBuilder()
+   *           .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
+   *           .addAllWorkerIds(new ArrayList())
+   *           .build();
+   *   Node response = tpuClient.simulateMaintenanceEventAsync(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 RuntimeVersion getRuntimeVersion(GetRuntimeVersionRequest request) { - return getRuntimeVersionCallable().call(request); + public final OperationFuture simulateMaintenanceEventAsync( + SimulateMaintenanceEventRequest request) { + return simulateMaintenanceEventOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets a runtime version. + * Simulates a maintenance event. * *

Sample code: * @@ -1636,24 +2375,26 @@ public final RuntimeVersion getRuntimeVersion(GetRuntimeVersionRequest request) * // - 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()) + * SimulateMaintenanceEventRequest request = + * SimulateMaintenanceEventRequest.newBuilder() + * .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + * .addAllWorkerIds(new ArrayList()) * .build(); - * ApiFuture future = tpuClient.getRuntimeVersionCallable().futureCall(request); + * OperationFuture future = + * tpuClient.simulateMaintenanceEventOperationCallable().futureCall(request); * // Do something. - * RuntimeVersion response = future.get(); + * Node response = future.get(); * } * } */ - public final UnaryCallable getRuntimeVersionCallable() { - return stub.getRuntimeVersionCallable(); + public final OperationCallable + simulateMaintenanceEventOperationCallable() { + return stub.simulateMaintenanceEventOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Retrieves the guest attributes for the node. + * Simulates a maintenance event. * *

Sample code: * @@ -1664,26 +2405,59 @@ public final UnaryCallable getRuntimeV * // - 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() + * SimulateMaintenanceEventRequest request = + * SimulateMaintenanceEventRequest.newBuilder() * .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) - * .setQueryPath("queryPath-1807004403") * .addAllWorkerIds(new ArrayList()) * .build(); - * GetGuestAttributesResponse response = tpuClient.getGuestAttributes(request); + * ApiFuture future = + * tpuClient.simulateMaintenanceEventCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * } + */ + public final UnaryCallable + simulateMaintenanceEventCallable() { + return stub.simulateMaintenanceEventCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : tpuClient.listLocations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final GetGuestAttributesResponse getGuestAttributes(GetGuestAttributesRequest request) { - return getGuestAttributesCallable().call(request); + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Retrieves the guest attributes for the node. + * Lists information about the supported locations for this service. * *

Sample code: * @@ -1694,22 +2468,112 @@ public final GetGuestAttributesResponse getGuestAttributes(GetGuestAttributesReq * // - 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()) + * ListLocationsRequest request = + * ListLocationsRequest.newBuilder() + * .setName("name3373707") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") * .build(); - * ApiFuture future = - * tpuClient.getGuestAttributesCallable().futureCall(request); + * ApiFuture future = tpuClient.listLocationsPagedCallable().futureCall(request); * // Do something. - * GetGuestAttributesResponse response = future.get(); + * for (Location element : future.get().iterateAll()) { + * // doThingsWith(element); + * } * } * } */ - public final UnaryCallable - getGuestAttributesCallable() { - return stub.getGuestAttributesCallable(); + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated 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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = tpuClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated 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()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = tpuClient.getLocation(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated 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()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = tpuClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); } @Override @@ -1807,6 +2671,90 @@ protected ListNodesFixedSizeCollection createCollection( } } + public static class ListQueuedResourcesPagedResponse + extends AbstractPagedListResponse< + ListQueuedResourcesRequest, + ListQueuedResourcesResponse, + QueuedResource, + ListQueuedResourcesPage, + ListQueuedResourcesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListQueuedResourcesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListQueuedResourcesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListQueuedResourcesPagedResponse(ListQueuedResourcesPage page) { + super(page, ListQueuedResourcesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListQueuedResourcesPage + extends AbstractPage< + ListQueuedResourcesRequest, + ListQueuedResourcesResponse, + QueuedResource, + ListQueuedResourcesPage> { + + private ListQueuedResourcesPage( + PageContext + context, + ListQueuedResourcesResponse response) { + super(context, response); + } + + private static ListQueuedResourcesPage createEmptyPage() { + return new ListQueuedResourcesPage(null, null); + } + + @Override + protected ListQueuedResourcesPage createPage( + PageContext + context, + ListQueuedResourcesResponse response) { + return new ListQueuedResourcesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListQueuedResourcesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListQueuedResourcesRequest, + ListQueuedResourcesResponse, + QueuedResource, + ListQueuedResourcesPage, + ListQueuedResourcesFixedSizeCollection> { + + private ListQueuedResourcesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListQueuedResourcesFixedSizeCollection createEmptyCollection() { + return new ListQueuedResourcesFixedSizeCollection(null, 0); + } + + @Override + protected ListQueuedResourcesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListQueuedResourcesFixedSizeCollection(pages, collectionSize); + } + } + public static class ListAcceleratorTypesPagedResponse extends AbstractPagedListResponse< ListAcceleratorTypesRequest, @@ -1974,4 +2922,80 @@ protected ListRuntimeVersionsFixedSizeCollection createCollection( return new ListRuntimeVersionsFixedSizeCollection(pages, collectionSize); } } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } } diff --git a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuSettings.java b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuSettings.java index 84b03976c4e3..d5c51bed9d59 100644 --- a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuSettings.java +++ b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuSettings.java @@ -17,7 +17,9 @@ package com.google.cloud.tpu.v2alpha1; import static com.google.cloud.tpu.v2alpha1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListLocationsPagedResponse; import static com.google.cloud.tpu.v2alpha1.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListQueuedResourcesPagedResponse; import static com.google.cloud.tpu.v2alpha1.TpuClient.ListRuntimeVersionsPagedResponse; import com.google.api.core.ApiFunction; @@ -32,8 +34,13 @@ import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.tpu.v2alpha1.stub.TpuStubSettings; import com.google.longrunning.Operation; +import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; import javax.annotation.Generated; @@ -103,7 +110,7 @@ public UnaryCallSettings deleteNodeSettings() { } /** Returns the object with the settings used for calls to deleteNode. */ - public OperationCallSettings + public OperationCallSettings deleteNodeOperationSettings() { return ((TpuStubSettings) getStubSettings()).deleteNodeOperationSettings(); } @@ -141,6 +148,40 @@ public UnaryCallSettings updateNodeSettings() { return ((TpuStubSettings) getStubSettings()).updateNodeOperationSettings(); } + /** Returns the object with the settings used for calls to listQueuedResources. */ + public PagedCallSettings< + ListQueuedResourcesRequest, ListQueuedResourcesResponse, ListQueuedResourcesPagedResponse> + listQueuedResourcesSettings() { + return ((TpuStubSettings) getStubSettings()).listQueuedResourcesSettings(); + } + + /** Returns the object with the settings used for calls to getQueuedResource. */ + public UnaryCallSettings getQueuedResourceSettings() { + return ((TpuStubSettings) getStubSettings()).getQueuedResourceSettings(); + } + + /** Returns the object with the settings used for calls to createQueuedResource. */ + public UnaryCallSettings createQueuedResourceSettings() { + return ((TpuStubSettings) getStubSettings()).createQueuedResourceSettings(); + } + + /** Returns the object with the settings used for calls to createQueuedResource. */ + public OperationCallSettings + createQueuedResourceOperationSettings() { + return ((TpuStubSettings) getStubSettings()).createQueuedResourceOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteQueuedResource. */ + public UnaryCallSettings deleteQueuedResourceSettings() { + return ((TpuStubSettings) getStubSettings()).deleteQueuedResourceSettings(); + } + + /** Returns the object with the settings used for calls to deleteQueuedResource. */ + public OperationCallSettings + deleteQueuedResourceOperationSettings() { + return ((TpuStubSettings) getStubSettings()).deleteQueuedResourceOperationSettings(); + } + /** Returns the object with the settings used for calls to generateServiceIdentity. */ public UnaryCallSettings generateServiceIdentitySettings() { @@ -180,6 +221,29 @@ public UnaryCallSettings getRuntimeVer return ((TpuStubSettings) getStubSettings()).getGuestAttributesSettings(); } + /** Returns the object with the settings used for calls to simulateMaintenanceEvent. */ + public UnaryCallSettings + simulateMaintenanceEventSettings() { + return ((TpuStubSettings) getStubSettings()).simulateMaintenanceEventSettings(); + } + + /** Returns the object with the settings used for calls to simulateMaintenanceEvent. */ + public OperationCallSettings + simulateMaintenanceEventOperationSettings() { + return ((TpuStubSettings) getStubSettings()).simulateMaintenanceEventOperationSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((TpuStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((TpuStubSettings) getStubSettings()).getLocationSettings(); + } + public static final TpuSettings create(TpuStubSettings stub) throws IOException { return new TpuSettings.Builder(stub.toBuilder()).build(); } @@ -304,7 +368,7 @@ public UnaryCallSettings.Builder deleteNodeSetting } /** Returns the builder for the settings used for calls to deleteNode. */ - public OperationCallSettings.Builder + public OperationCallSettings.Builder deleteNodeOperationSettings() { return getStubSettingsBuilder().deleteNodeOperationSettings(); } @@ -342,6 +406,47 @@ public UnaryCallSettings.Builder updateNodeSetting return getStubSettingsBuilder().updateNodeOperationSettings(); } + /** Returns the builder for the settings used for calls to listQueuedResources. */ + public PagedCallSettings.Builder< + ListQueuedResourcesRequest, + ListQueuedResourcesResponse, + ListQueuedResourcesPagedResponse> + listQueuedResourcesSettings() { + return getStubSettingsBuilder().listQueuedResourcesSettings(); + } + + /** Returns the builder for the settings used for calls to getQueuedResource. */ + public UnaryCallSettings.Builder + getQueuedResourceSettings() { + return getStubSettingsBuilder().getQueuedResourceSettings(); + } + + /** Returns the builder for the settings used for calls to createQueuedResource. */ + public UnaryCallSettings.Builder + createQueuedResourceSettings() { + return getStubSettingsBuilder().createQueuedResourceSettings(); + } + + /** Returns the builder for the settings used for calls to createQueuedResource. */ + public OperationCallSettings.Builder< + CreateQueuedResourceRequest, QueuedResource, OperationMetadata> + createQueuedResourceOperationSettings() { + return getStubSettingsBuilder().createQueuedResourceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteQueuedResource. */ + public UnaryCallSettings.Builder + deleteQueuedResourceSettings() { + return getStubSettingsBuilder().deleteQueuedResourceSettings(); + } + + /** Returns the builder for the settings used for calls to deleteQueuedResource. */ + public OperationCallSettings.Builder< + DeleteQueuedResourceRequest, QueuedResource, OperationMetadata> + deleteQueuedResourceOperationSettings() { + return getStubSettingsBuilder().deleteQueuedResourceOperationSettings(); + } + /** Returns the builder for the settings used for calls to generateServiceIdentity. */ public UnaryCallSettings.Builder< GenerateServiceIdentityRequest, GenerateServiceIdentityResponse> @@ -385,6 +490,30 @@ public UnaryCallSettings.Builder updateNodeSetting return getStubSettingsBuilder().getGuestAttributesSettings(); } + /** Returns the builder for the settings used for calls to simulateMaintenanceEvent. */ + public UnaryCallSettings.Builder + simulateMaintenanceEventSettings() { + return getStubSettingsBuilder().simulateMaintenanceEventSettings(); + } + + /** Returns the builder for the settings used for calls to simulateMaintenanceEvent. */ + public OperationCallSettings.Builder + simulateMaintenanceEventOperationSettings() { + return getStubSettingsBuilder().simulateMaintenanceEventOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + @Override public TpuSettings build() throws IOException { return new TpuSettings(this); diff --git a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/gapic_metadata.json b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/gapic_metadata.json index db678f19cbc3..c0c8ee5f3d5d 100644 --- a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/gapic_metadata.json +++ b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/gapic_metadata.json @@ -13,9 +13,15 @@ "CreateNode": { "methods": ["createNodeAsync", "createNodeAsync", "createNodeAsync", "createNodeOperationCallable", "createNodeCallable"] }, + "CreateQueuedResource": { + "methods": ["createQueuedResourceAsync", "createQueuedResourceAsync", "createQueuedResourceAsync", "createQueuedResourceOperationCallable", "createQueuedResourceCallable"] + }, "DeleteNode": { "methods": ["deleteNodeAsync", "deleteNodeAsync", "deleteNodeAsync", "deleteNodeOperationCallable", "deleteNodeCallable"] }, + "DeleteQueuedResource": { + "methods": ["deleteQueuedResourceAsync", "deleteQueuedResourceAsync", "deleteQueuedResourceAsync", "deleteQueuedResourceOperationCallable", "deleteQueuedResourceCallable"] + }, "GenerateServiceIdentity": { "methods": ["generateServiceIdentity", "generateServiceIdentityCallable"] }, @@ -25,21 +31,36 @@ "GetGuestAttributes": { "methods": ["getGuestAttributes", "getGuestAttributesCallable"] }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, "GetNode": { "methods": ["getNode", "getNode", "getNode", "getNodeCallable"] }, + "GetQueuedResource": { + "methods": ["getQueuedResource", "getQueuedResource", "getQueuedResource", "getQueuedResourceCallable"] + }, "GetRuntimeVersion": { "methods": ["getRuntimeVersion", "getRuntimeVersion", "getRuntimeVersion", "getRuntimeVersionCallable"] }, "ListAcceleratorTypes": { "methods": ["listAcceleratorTypes", "listAcceleratorTypes", "listAcceleratorTypes", "listAcceleratorTypesPagedCallable", "listAcceleratorTypesCallable"] }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, "ListNodes": { "methods": ["listNodes", "listNodes", "listNodes", "listNodesPagedCallable", "listNodesCallable"] }, + "ListQueuedResources": { + "methods": ["listQueuedResources", "listQueuedResources", "listQueuedResources", "listQueuedResourcesPagedCallable", "listQueuedResourcesCallable"] + }, "ListRuntimeVersions": { "methods": ["listRuntimeVersions", "listRuntimeVersions", "listRuntimeVersions", "listRuntimeVersionsPagedCallable", "listRuntimeVersionsCallable"] }, + "SimulateMaintenanceEvent": { + "methods": ["simulateMaintenanceEventAsync", "simulateMaintenanceEventOperationCallable", "simulateMaintenanceEventCallable"] + }, "StartNode": { "methods": ["startNodeAsync", "startNodeOperationCallable", "startNodeCallable"] }, diff --git a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/GrpcTpuStub.java b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/GrpcTpuStub.java index cd2c7d7fd0fc..5760526c4511 100644 --- a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/GrpcTpuStub.java +++ b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/GrpcTpuStub.java @@ -17,7 +17,9 @@ package com.google.cloud.tpu.v2alpha1.stub; import static com.google.cloud.tpu.v2alpha1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListLocationsPagedResponse; import static com.google.cloud.tpu.v2alpha1.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListQueuedResourcesPagedResponse; import static com.google.cloud.tpu.v2alpha1.TpuClient.ListRuntimeVersionsPagedResponse; import com.google.api.core.BetaApi; @@ -28,31 +30,43 @@ 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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.tpu.v2alpha1.AcceleratorType; import com.google.cloud.tpu.v2alpha1.CreateNodeRequest; +import com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest; import com.google.cloud.tpu.v2alpha1.DeleteNodeRequest; +import com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest; 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.GetQueuedResourceRequest; 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.ListQueuedResourcesRequest; +import com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse; 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.QueuedResource; import com.google.cloud.tpu.v2alpha1.RuntimeVersion; +import com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest; 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 com.google.protobuf.Empty; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; import java.io.IOException; @@ -125,6 +139,47 @@ public class GrpcTpuStub extends TpuStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + listQueuedResourcesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v2alpha1.Tpu/ListQueuedResources") + .setRequestMarshaller( + ProtoUtils.marshaller(ListQueuedResourcesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListQueuedResourcesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getQueuedResourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v2alpha1.Tpu/GetQueuedResource") + .setRequestMarshaller( + ProtoUtils.marshaller(GetQueuedResourceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(QueuedResource.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createQueuedResourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v2alpha1.Tpu/CreateQueuedResource") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateQueuedResourceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteQueuedResourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v2alpha1.Tpu/DeleteQueuedResource") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteQueuedResourceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor< GenerateServiceIdentityRequest, GenerateServiceIdentityResponse> generateServiceIdentityMethodDescriptor = @@ -191,6 +246,35 @@ public class GrpcTpuStub extends TpuStub { ProtoUtils.marshaller(GetGuestAttributesResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor + simulateMaintenanceEventMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.tpu.v2alpha1.Tpu/SimulateMaintenanceEvent") + .setRequestMarshaller( + ProtoUtils.marshaller(SimulateMaintenanceEventRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + private final UnaryCallable listNodesCallable; private final UnaryCallable listNodesPagedCallable; private final UnaryCallable getNodeCallable; @@ -198,7 +282,7 @@ public class GrpcTpuStub extends TpuStub { private final OperationCallable createNodeOperationCallable; private final UnaryCallable deleteNodeCallable; - private final OperationCallable + private final OperationCallable deleteNodeOperationCallable; private final UnaryCallable stopNodeCallable; private final OperationCallable @@ -209,6 +293,17 @@ public class GrpcTpuStub extends TpuStub { private final UnaryCallable updateNodeCallable; private final OperationCallable updateNodeOperationCallable; + private final UnaryCallable + listQueuedResourcesCallable; + private final UnaryCallable + listQueuedResourcesPagedCallable; + private final UnaryCallable getQueuedResourceCallable; + private final UnaryCallable createQueuedResourceCallable; + private final OperationCallable + createQueuedResourceOperationCallable; + private final UnaryCallable deleteQueuedResourceCallable; + private final OperationCallable + deleteQueuedResourceOperationCallable; private final UnaryCallable generateServiceIdentityCallable; private final UnaryCallable @@ -224,6 +319,14 @@ public class GrpcTpuStub extends TpuStub { private final UnaryCallable getRuntimeVersionCallable; private final UnaryCallable getGuestAttributesCallable; + private final UnaryCallable + simulateMaintenanceEventCallable; + private final OperationCallable + simulateMaintenanceEventOperationCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -332,6 +435,47 @@ protected GrpcTpuStub( return params.build(); }) .build(); + GrpcCallSettings + listQueuedResourcesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listQueuedResourcesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getQueuedResourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getQueuedResourceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createQueuedResourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createQueuedResourceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteQueuedResourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteQueuedResourceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); GrpcCallSettings generateServiceIdentityTransportSettings = GrpcCallSettings @@ -398,6 +542,37 @@ protected GrpcTpuStub( return params.build(); }) .build(); + GrpcCallSettings + simulateMaintenanceEventTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(simulateMaintenanceEventMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); this.listNodesCallable = callableFactory.createUnaryCallable( @@ -453,6 +628,43 @@ protected GrpcTpuStub( settings.updateNodeOperationSettings(), clientContext, operationsStub); + this.listQueuedResourcesCallable = + callableFactory.createUnaryCallable( + listQueuedResourcesTransportSettings, + settings.listQueuedResourcesSettings(), + clientContext); + this.listQueuedResourcesPagedCallable = + callableFactory.createPagedCallable( + listQueuedResourcesTransportSettings, + settings.listQueuedResourcesSettings(), + clientContext); + this.getQueuedResourceCallable = + callableFactory.createUnaryCallable( + getQueuedResourceTransportSettings, + settings.getQueuedResourceSettings(), + clientContext); + this.createQueuedResourceCallable = + callableFactory.createUnaryCallable( + createQueuedResourceTransportSettings, + settings.createQueuedResourceSettings(), + clientContext); + this.createQueuedResourceOperationCallable = + callableFactory.createOperationCallable( + createQueuedResourceTransportSettings, + settings.createQueuedResourceOperationSettings(), + clientContext, + operationsStub); + this.deleteQueuedResourceCallable = + callableFactory.createUnaryCallable( + deleteQueuedResourceTransportSettings, + settings.deleteQueuedResourceSettings(), + clientContext); + this.deleteQueuedResourceOperationCallable = + callableFactory.createOperationCallable( + deleteQueuedResourceTransportSettings, + settings.deleteQueuedResourceOperationSettings(), + clientContext, + operationsStub); this.generateServiceIdentityCallable = callableFactory.createUnaryCallable( generateServiceIdentityTransportSettings, @@ -493,6 +705,26 @@ protected GrpcTpuStub( getGuestAttributesTransportSettings, settings.getGuestAttributesSettings(), clientContext); + this.simulateMaintenanceEventCallable = + callableFactory.createUnaryCallable( + simulateMaintenanceEventTransportSettings, + settings.simulateMaintenanceEventSettings(), + clientContext); + this.simulateMaintenanceEventOperationCallable = + callableFactory.createOperationCallable( + simulateMaintenanceEventTransportSettings, + settings.simulateMaintenanceEventOperationSettings(), + clientContext, + operationsStub); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -534,7 +766,7 @@ public UnaryCallable deleteNodeCallable() { } @Override - public OperationCallable + public OperationCallable deleteNodeOperationCallable() { return deleteNodeOperationCallable; } @@ -570,6 +802,45 @@ public UnaryCallable updateNodeCallable() { return updateNodeOperationCallable; } + @Override + public UnaryCallable + listQueuedResourcesCallable() { + return listQueuedResourcesCallable; + } + + @Override + public UnaryCallable + listQueuedResourcesPagedCallable() { + return listQueuedResourcesPagedCallable; + } + + @Override + public UnaryCallable getQueuedResourceCallable() { + return getQueuedResourceCallable; + } + + @Override + public UnaryCallable createQueuedResourceCallable() { + return createQueuedResourceCallable; + } + + @Override + public OperationCallable + createQueuedResourceOperationCallable() { + return createQueuedResourceOperationCallable; + } + + @Override + public UnaryCallable deleteQueuedResourceCallable() { + return deleteQueuedResourceCallable; + } + + @Override + public OperationCallable + deleteQueuedResourceOperationCallable() { + return deleteQueuedResourceOperationCallable; + } + @Override public UnaryCallable generateServiceIdentityCallable() { @@ -616,6 +887,34 @@ public UnaryCallable getRuntimeVersion return getGuestAttributesCallable; } + @Override + public UnaryCallable + simulateMaintenanceEventCallable() { + return simulateMaintenanceEventCallable; + } + + @Override + public OperationCallable + simulateMaintenanceEventOperationCallable() { + return simulateMaintenanceEventOperationCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + @Override public final void close() { try { diff --git a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStub.java b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStub.java index 02185bf703a8..5840bb723c1b 100644 --- a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStub.java +++ b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStub.java @@ -17,37 +17,51 @@ package com.google.cloud.tpu.v2alpha1.stub; import static com.google.cloud.tpu.v2alpha1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListLocationsPagedResponse; import static com.google.cloud.tpu.v2alpha1.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListQueuedResourcesPagedResponse; 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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.tpu.v2alpha1.AcceleratorType; import com.google.cloud.tpu.v2alpha1.CreateNodeRequest; +import com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest; import com.google.cloud.tpu.v2alpha1.DeleteNodeRequest; +import com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest; 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.GetQueuedResourceRequest; 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.ListQueuedResourcesRequest; +import com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse; 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.QueuedResource; import com.google.cloud.tpu.v2alpha1.RuntimeVersion; +import com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest; 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 com.google.protobuf.Empty; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS. @@ -85,7 +99,7 @@ public UnaryCallable createNodeCallable() { throw new UnsupportedOperationException("Not implemented: createNodeCallable()"); } - public OperationCallable + public OperationCallable deleteNodeOperationCallable() { throw new UnsupportedOperationException("Not implemented: deleteNodeOperationCallable()"); } @@ -119,6 +133,40 @@ public UnaryCallable updateNodeCallable() { throw new UnsupportedOperationException("Not implemented: updateNodeCallable()"); } + public UnaryCallable + listQueuedResourcesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listQueuedResourcesPagedCallable()"); + } + + public UnaryCallable + listQueuedResourcesCallable() { + throw new UnsupportedOperationException("Not implemented: listQueuedResourcesCallable()"); + } + + public UnaryCallable getQueuedResourceCallable() { + throw new UnsupportedOperationException("Not implemented: getQueuedResourceCallable()"); + } + + public OperationCallable + createQueuedResourceOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createQueuedResourceOperationCallable()"); + } + + public UnaryCallable createQueuedResourceCallable() { + throw new UnsupportedOperationException("Not implemented: createQueuedResourceCallable()"); + } + + public OperationCallable + deleteQueuedResourceOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteQueuedResourceOperationCallable()"); + } + + public UnaryCallable deleteQueuedResourceCallable() { + throw new UnsupportedOperationException("Not implemented: deleteQueuedResourceCallable()"); + } + public UnaryCallable generateServiceIdentityCallable() { throw new UnsupportedOperationException("Not implemented: generateServiceIdentityCallable()"); @@ -157,6 +205,30 @@ public UnaryCallable getRuntimeVersion throw new UnsupportedOperationException("Not implemented: getGuestAttributesCallable()"); } + public OperationCallable + simulateMaintenanceEventOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: simulateMaintenanceEventOperationCallable()"); + } + + public UnaryCallable + simulateMaintenanceEventCallable() { + throw new UnsupportedOperationException("Not implemented: simulateMaintenanceEventCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + @Override public abstract void close(); } diff --git a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStubSettings.java b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStubSettings.java index 726f0fec79ac..af12c9f326a2 100644 --- a/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStubSettings.java +++ b/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/stub/TpuStubSettings.java @@ -17,7 +17,9 @@ package com.google.cloud.tpu.v2alpha1.stub; import static com.google.cloud.tpu.v2alpha1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListLocationsPagedResponse; import static com.google.cloud.tpu.v2alpha1.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListQueuedResourcesPagedResponse; import static com.google.cloud.tpu.v2alpha1.TpuClient.ListRuntimeVersionsPagedResponse; import com.google.api.core.ApiFunction; @@ -46,25 +48,36 @@ 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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.tpu.v2alpha1.AcceleratorType; import com.google.cloud.tpu.v2alpha1.CreateNodeRequest; +import com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest; import com.google.cloud.tpu.v2alpha1.DeleteNodeRequest; +import com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest; 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.GetQueuedResourceRequest; 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.ListQueuedResourcesRequest; +import com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse; 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.QueuedResource; import com.google.cloud.tpu.v2alpha1.RuntimeVersion; +import com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest; import com.google.cloud.tpu.v2alpha1.StartNodeRequest; import com.google.cloud.tpu.v2alpha1.StopNodeRequest; import com.google.cloud.tpu.v2alpha1.UpdateNodeRequest; @@ -73,6 +86,7 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import com.google.longrunning.Operation; +import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; import javax.annotation.Generated; @@ -125,7 +139,7 @@ public class TpuStubSettings extends StubSettings { private final OperationCallSettings createNodeOperationSettings; private final UnaryCallSettings deleteNodeSettings; - private final OperationCallSettings + private final OperationCallSettings deleteNodeOperationSettings; private final UnaryCallSettings stopNodeSettings; private final OperationCallSettings @@ -136,6 +150,21 @@ public class TpuStubSettings extends StubSettings { private final UnaryCallSettings updateNodeSettings; private final OperationCallSettings updateNodeOperationSettings; + private final PagedCallSettings< + ListQueuedResourcesRequest, ListQueuedResourcesResponse, ListQueuedResourcesPagedResponse> + listQueuedResourcesSettings; + private final UnaryCallSettings + getQueuedResourceSettings; + private final UnaryCallSettings + createQueuedResourceSettings; + private final OperationCallSettings< + CreateQueuedResourceRequest, QueuedResource, OperationMetadata> + createQueuedResourceOperationSettings; + private final UnaryCallSettings + deleteQueuedResourceSettings; + private final OperationCallSettings< + DeleteQueuedResourceRequest, QueuedResource, OperationMetadata> + deleteQueuedResourceOperationSettings; private final UnaryCallSettings generateServiceIdentitySettings; private final PagedCallSettings< @@ -152,6 +181,14 @@ public class TpuStubSettings extends StubSettings { getRuntimeVersionSettings; private final UnaryCallSettings getGuestAttributesSettings; + private final UnaryCallSettings + simulateMaintenanceEventSettings; + private final OperationCallSettings + simulateMaintenanceEventOperationSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; private static final PagedListDescriptor LIST_NODES_PAGE_STR_DESC = @@ -189,6 +226,46 @@ public Iterable extractResources(ListNodesResponse payload) { } }; + private static final PagedListDescriptor< + ListQueuedResourcesRequest, ListQueuedResourcesResponse, QueuedResource> + LIST_QUEUED_RESOURCES_PAGE_STR_DESC = + new PagedListDescriptor< + ListQueuedResourcesRequest, ListQueuedResourcesResponse, QueuedResource>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListQueuedResourcesRequest injectToken( + ListQueuedResourcesRequest payload, String token) { + return ListQueuedResourcesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListQueuedResourcesRequest injectPageSize( + ListQueuedResourcesRequest payload, int pageSize) { + return ListQueuedResourcesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListQueuedResourcesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListQueuedResourcesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListQueuedResourcesResponse payload) { + return payload.getQueuedResourcesList() == null + ? ImmutableList.of() + : payload.getQueuedResourcesList(); + } + }; + private static final PagedListDescriptor< ListAcceleratorTypesRequest, ListAcceleratorTypesResponse, AcceleratorType> LIST_ACCELERATOR_TYPES_PAGE_STR_DESC = @@ -270,6 +347,42 @@ public Iterable extractResources(ListRuntimeVersionsResponse pay } }; + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + private static final PagedListResponseFactory< ListNodesRequest, ListNodesResponse, ListNodesPagedResponse> LIST_NODES_PAGE_STR_FACT = @@ -287,6 +400,27 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListQueuedResourcesRequest, ListQueuedResourcesResponse, ListQueuedResourcesPagedResponse> + LIST_QUEUED_RESOURCES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListQueuedResourcesRequest, + ListQueuedResourcesResponse, + ListQueuedResourcesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListQueuedResourcesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_QUEUED_RESOURCES_PAGE_STR_DESC, request, context); + return ListQueuedResourcesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + private static final PagedListResponseFactory< ListAcceleratorTypesRequest, ListAcceleratorTypesResponse, @@ -332,6 +466,23 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listNodes. */ public PagedCallSettings listNodesSettings() { @@ -360,7 +511,7 @@ public UnaryCallSettings deleteNodeSettings() { } /** Returns the object with the settings used for calls to deleteNode. */ - public OperationCallSettings + public OperationCallSettings deleteNodeOperationSettings() { return deleteNodeOperationSettings; } @@ -398,6 +549,40 @@ public UnaryCallSettings updateNodeSettings() { return updateNodeOperationSettings; } + /** Returns the object with the settings used for calls to listQueuedResources. */ + public PagedCallSettings< + ListQueuedResourcesRequest, ListQueuedResourcesResponse, ListQueuedResourcesPagedResponse> + listQueuedResourcesSettings() { + return listQueuedResourcesSettings; + } + + /** Returns the object with the settings used for calls to getQueuedResource. */ + public UnaryCallSettings getQueuedResourceSettings() { + return getQueuedResourceSettings; + } + + /** Returns the object with the settings used for calls to createQueuedResource. */ + public UnaryCallSettings createQueuedResourceSettings() { + return createQueuedResourceSettings; + } + + /** Returns the object with the settings used for calls to createQueuedResource. */ + public OperationCallSettings + createQueuedResourceOperationSettings() { + return createQueuedResourceOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteQueuedResource. */ + public UnaryCallSettings deleteQueuedResourceSettings() { + return deleteQueuedResourceSettings; + } + + /** Returns the object with the settings used for calls to deleteQueuedResource. */ + public OperationCallSettings + deleteQueuedResourceOperationSettings() { + return deleteQueuedResourceOperationSettings; + } + /** Returns the object with the settings used for calls to generateServiceIdentity. */ public UnaryCallSettings generateServiceIdentitySettings() { @@ -437,6 +622,29 @@ public UnaryCallSettings getRuntimeVer return getGuestAttributesSettings; } + /** Returns the object with the settings used for calls to simulateMaintenanceEvent. */ + public UnaryCallSettings + simulateMaintenanceEventSettings() { + return simulateMaintenanceEventSettings; + } + + /** Returns the object with the settings used for calls to simulateMaintenanceEvent. */ + public OperationCallSettings + simulateMaintenanceEventOperationSettings() { + return simulateMaintenanceEventOperationSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + public TpuStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -523,12 +731,25 @@ protected TpuStubSettings(Builder settingsBuilder) throws IOException { startNodeOperationSettings = settingsBuilder.startNodeOperationSettings().build(); updateNodeSettings = settingsBuilder.updateNodeSettings().build(); updateNodeOperationSettings = settingsBuilder.updateNodeOperationSettings().build(); + listQueuedResourcesSettings = settingsBuilder.listQueuedResourcesSettings().build(); + getQueuedResourceSettings = settingsBuilder.getQueuedResourceSettings().build(); + createQueuedResourceSettings = settingsBuilder.createQueuedResourceSettings().build(); + createQueuedResourceOperationSettings = + settingsBuilder.createQueuedResourceOperationSettings().build(); + deleteQueuedResourceSettings = settingsBuilder.deleteQueuedResourceSettings().build(); + deleteQueuedResourceOperationSettings = + settingsBuilder.deleteQueuedResourceOperationSettings().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(); + simulateMaintenanceEventSettings = settingsBuilder.simulateMaintenanceEventSettings().build(); + simulateMaintenanceEventOperationSettings = + settingsBuilder.simulateMaintenanceEventOperationSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); } /** Builder for TpuStubSettings. */ @@ -542,7 +763,7 @@ public static class Builder extends StubSettings.Builder createNodeOperationSettings; private final UnaryCallSettings.Builder deleteNodeSettings; - private final OperationCallSettings.Builder + private final OperationCallSettings.Builder deleteNodeOperationSettings; private final UnaryCallSettings.Builder stopNodeSettings; private final OperationCallSettings.Builder @@ -553,6 +774,23 @@ public static class Builder extends StubSettings.Builder updateNodeSettings; private final OperationCallSettings.Builder updateNodeOperationSettings; + private final PagedCallSettings.Builder< + ListQueuedResourcesRequest, + ListQueuedResourcesResponse, + ListQueuedResourcesPagedResponse> + listQueuedResourcesSettings; + private final UnaryCallSettings.Builder + getQueuedResourceSettings; + private final UnaryCallSettings.Builder + createQueuedResourceSettings; + private final OperationCallSettings.Builder< + CreateQueuedResourceRequest, QueuedResource, OperationMetadata> + createQueuedResourceOperationSettings; + private final UnaryCallSettings.Builder + deleteQueuedResourceSettings; + private final OperationCallSettings.Builder< + DeleteQueuedResourceRequest, QueuedResource, OperationMetadata> + deleteQueuedResourceOperationSettings; private final UnaryCallSettings.Builder< GenerateServiceIdentityRequest, GenerateServiceIdentityResponse> generateServiceIdentitySettings; @@ -572,6 +810,15 @@ public static class Builder extends StubSettings.Builder getGuestAttributesSettings; + private final UnaryCallSettings.Builder + simulateMaintenanceEventSettings; + private final OperationCallSettings.Builder< + SimulateMaintenanceEventRequest, Node, OperationMetadata> + simulateMaintenanceEventOperationSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -618,6 +865,13 @@ protected Builder(ClientContext clientContext) { startNodeOperationSettings = OperationCallSettings.newBuilder(); updateNodeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); updateNodeOperationSettings = OperationCallSettings.newBuilder(); + listQueuedResourcesSettings = + PagedCallSettings.newBuilder(LIST_QUEUED_RESOURCES_PAGE_STR_FACT); + getQueuedResourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createQueuedResourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createQueuedResourceOperationSettings = OperationCallSettings.newBuilder(); + deleteQueuedResourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteQueuedResourceOperationSettings = OperationCallSettings.newBuilder(); generateServiceIdentitySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listAcceleratorTypesSettings = PagedCallSettings.newBuilder(LIST_ACCELERATOR_TYPES_PAGE_STR_FACT); @@ -626,6 +880,10 @@ protected Builder(ClientContext clientContext) { PagedCallSettings.newBuilder(LIST_RUNTIME_VERSIONS_PAGE_STR_FACT); getRuntimeVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); getGuestAttributesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + simulateMaintenanceEventSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + simulateMaintenanceEventOperationSettings = OperationCallSettings.newBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -636,12 +894,19 @@ protected Builder(ClientContext clientContext) { stopNodeSettings, startNodeSettings, updateNodeSettings, + listQueuedResourcesSettings, + getQueuedResourceSettings, + createQueuedResourceSettings, + deleteQueuedResourceSettings, generateServiceIdentitySettings, listAcceleratorTypesSettings, getAcceleratorTypeSettings, listRuntimeVersionsSettings, getRuntimeVersionSettings, - getGuestAttributesSettings); + getGuestAttributesSettings, + simulateMaintenanceEventSettings, + listLocationsSettings, + getLocationSettings); initDefaults(this); } @@ -660,12 +925,25 @@ protected Builder(TpuStubSettings settings) { startNodeOperationSettings = settings.startNodeOperationSettings.toBuilder(); updateNodeSettings = settings.updateNodeSettings.toBuilder(); updateNodeOperationSettings = settings.updateNodeOperationSettings.toBuilder(); + listQueuedResourcesSettings = settings.listQueuedResourcesSettings.toBuilder(); + getQueuedResourceSettings = settings.getQueuedResourceSettings.toBuilder(); + createQueuedResourceSettings = settings.createQueuedResourceSettings.toBuilder(); + createQueuedResourceOperationSettings = + settings.createQueuedResourceOperationSettings.toBuilder(); + deleteQueuedResourceSettings = settings.deleteQueuedResourceSettings.toBuilder(); + deleteQueuedResourceOperationSettings = + settings.deleteQueuedResourceOperationSettings.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(); + simulateMaintenanceEventSettings = settings.simulateMaintenanceEventSettings.toBuilder(); + simulateMaintenanceEventOperationSettings = + settings.simulateMaintenanceEventOperationSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -676,12 +954,19 @@ protected Builder(TpuStubSettings settings) { stopNodeSettings, startNodeSettings, updateNodeSettings, + listQueuedResourcesSettings, + getQueuedResourceSettings, + createQueuedResourceSettings, + deleteQueuedResourceSettings, generateServiceIdentitySettings, listAcceleratorTypesSettings, getAcceleratorTypeSettings, listRuntimeVersionsSettings, getRuntimeVersionSettings, - getGuestAttributesSettings); + getGuestAttributesSettings, + simulateMaintenanceEventSettings, + listLocationsSettings, + getLocationSettings); } private static Builder createDefault() { @@ -733,6 +1018,26 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + builder + .listQueuedResourcesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getQueuedResourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .createQueuedResourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .deleteQueuedResourceSettings() + .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")) @@ -763,6 +1068,21 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + builder + .simulateMaintenanceEventSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + builder .createNodeOperationSettings() .setInitialCallSettings( @@ -792,7 +1112,8 @@ private static Builder initDefaults(Builder builder) { .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)) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( @@ -873,6 +1194,77 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder + .createQueuedResourceOperationSettings() + .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(QueuedResource.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 + .deleteQueuedResourceOperationSettings() + .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(QueuedResource.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 + .simulateMaintenanceEventOperationSettings() + .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; } @@ -923,7 +1315,7 @@ public UnaryCallSettings.Builder deleteNodeSetting /** 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 + public OperationCallSettings.Builder deleteNodeOperationSettings() { return deleteNodeOperationSettings; } @@ -967,6 +1359,51 @@ public UnaryCallSettings.Builder updateNodeSetting return updateNodeOperationSettings; } + /** Returns the builder for the settings used for calls to listQueuedResources. */ + public PagedCallSettings.Builder< + ListQueuedResourcesRequest, + ListQueuedResourcesResponse, + ListQueuedResourcesPagedResponse> + listQueuedResourcesSettings() { + return listQueuedResourcesSettings; + } + + /** Returns the builder for the settings used for calls to getQueuedResource. */ + public UnaryCallSettings.Builder + getQueuedResourceSettings() { + return getQueuedResourceSettings; + } + + /** Returns the builder for the settings used for calls to createQueuedResource. */ + public UnaryCallSettings.Builder + createQueuedResourceSettings() { + return createQueuedResourceSettings; + } + + /** Returns the builder for the settings used for calls to createQueuedResource. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + CreateQueuedResourceRequest, QueuedResource, OperationMetadata> + createQueuedResourceOperationSettings() { + return createQueuedResourceOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteQueuedResource. */ + public UnaryCallSettings.Builder + deleteQueuedResourceSettings() { + return deleteQueuedResourceSettings; + } + + /** Returns the builder for the settings used for calls to deleteQueuedResource. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + DeleteQueuedResourceRequest, QueuedResource, OperationMetadata> + deleteQueuedResourceOperationSettings() { + return deleteQueuedResourceOperationSettings; + } + /** Returns the builder for the settings used for calls to generateServiceIdentity. */ public UnaryCallSettings.Builder< GenerateServiceIdentityRequest, GenerateServiceIdentityResponse> @@ -1010,6 +1447,32 @@ public UnaryCallSettings.Builder updateNodeSetting return getGuestAttributesSettings; } + /** Returns the builder for the settings used for calls to simulateMaintenanceEvent. */ + public UnaryCallSettings.Builder + simulateMaintenanceEventSettings() { + return simulateMaintenanceEventSettings; + } + + /** Returns the builder for the settings used for calls to simulateMaintenanceEvent. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + simulateMaintenanceEventOperationSettings() { + return simulateMaintenanceEventOperationSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + @Override public TpuStubSettings build() throws IOException { return new TpuStubSettings(this); diff --git a/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/MockLocations.java b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/MockLocations.java new file mode 100644 index 000000000000..046feb03c20b --- /dev/null +++ b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.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 MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/MockLocationsImpl.java b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/MockLocationsImpl.java new file mode 100644 index 000000000000..fc4ff2a7282a --- /dev/null +++ b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/MockLocationsImpl.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/TpuClientTest.java b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/TpuClientTest.java index c5ed362951fb..25cd0a405eb0 100644 --- a/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/TpuClientTest.java +++ b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v1/TpuClientTest.java @@ -17,6 +17,7 @@ package com.google.cloud.tpu.v1; import static com.google.cloud.tpu.v1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v1.TpuClient.ListLocationsPagedResponse; import static com.google.cloud.tpu.v1.TpuClient.ListNodesPagedResponse; import static com.google.cloud.tpu.v1.TpuClient.ListTensorFlowVersionsPagedResponse; @@ -28,6 +29,10 @@ import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.common.collect.Lists; import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; @@ -51,6 +56,7 @@ @Generated("by gapic-generator-java") public class TpuClientTest { + private static MockLocations mockLocations; private static MockServiceHelper mockServiceHelper; private static MockTpu mockTpu; private LocalChannelProvider channelProvider; @@ -59,9 +65,10 @@ public class TpuClientTest { @BeforeClass public static void startStaticServer() { mockTpu = new MockTpu(); + mockLocations = new MockLocations(); mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockTpu)); + UUID.randomUUID().toString(), Arrays.asList(mockTpu, mockLocations)); mockServiceHelper.start(); } @@ -1080,4 +1087,105 @@ public void getAcceleratorTypeExceptionTest2() throws Exception { // Expected exception. } } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/MockLocations.java b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/MockLocations.java new file mode 100644 index 000000000000..6138e7cf8adf --- /dev/null +++ b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/MockLocationsImpl.java b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/MockLocationsImpl.java new file mode 100644 index 000000000000..65e856801dc1 --- /dev/null +++ b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/MockLocationsImpl.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/MockTpu.java b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/MockTpu.java new file mode 100644 index 000000000000..21fe2a3617ad --- /dev/null +++ b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/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.v2; + +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/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/MockTpuImpl.java b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/MockTpuImpl.java new file mode 100644 index 000000000000..69d56985205b --- /dev/null +++ b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/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.v2; + +import com.google.api.core.BetaApi; +import com.google.cloud.tpu.v2.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/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/TpuClientHttpJsonTest.java b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/TpuClientHttpJsonTest.java new file mode 100644 index 000000000000..00600782e421 --- /dev/null +++ b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/TpuClientHttpJsonTest.java @@ -0,0 +1,1406 @@ +/* + * 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.v2; + +import static com.google.cloud.tpu.v2.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v2.TpuClient.ListLocationsPagedResponse; +import static com.google.cloud.tpu.v2.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v2.TpuClient.ListRuntimeVersionsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.tpu.v2.stub.HttpJsonTpuStub; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 TpuClientHttpJsonTest { + private static MockHttpService mockService; + private static TpuClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonTpuStub.getMethodDescriptors(), TpuSettings.getDefaultEndpoint()); + TpuSettings settings = + TpuSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + TpuSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = TpuClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listNodesTest() throws Exception { + Node responsesElement = Node.newBuilder().build(); + ListNodesResponse expectedResponse = + ListNodesResponse.newBuilder() + .setNextPageToken("") + .addAllNodes(Arrays.asList(responsesElement)) + .build(); + mockService.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 = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listNodesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.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(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + 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 = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listNodesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + 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(); + mockService.addResponse(expectedResponse); + + NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); + + Node actualResponse = client.getNode(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getNodeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.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(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-8007/locations/location-8007/nodes/node-8007"; + + Node actualResponse = client.getNode(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getNodeExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-8007/locations/location-8007/nodes/node-8007"; + 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(); + mockService.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 = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createNodeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.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) { + } + } + + @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(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Node node = Node.newBuilder().build(); + String nodeId = "nodeId-1040171331"; + + Node actualResponse = client.createNodeAsync(parent, node, nodeId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createNodeExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Node node = Node.newBuilder().build(); + String nodeId = "nodeId-1040171331"; + client.createNodeAsync(parent, node, nodeId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteNodeTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteNodeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); + + client.deleteNodeAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteNodeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); + client.deleteNodeAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteNodeTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteNodeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-8007/locations/location-8007/nodes/node-8007"; + + client.deleteNodeAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteNodeExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-8007/locations/location-8007/nodes/node-8007"; + client.deleteNodeAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @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(); + mockService.addResponse(resultOperation); + + StopNodeRequest request = + StopNodeRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); + + Node actualResponse = client.stopNodeAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void stopNodeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + StopNodeRequest request = + StopNodeRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); + client.stopNodeAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @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(); + mockService.addResponse(resultOperation); + + StartNodeRequest request = + StartNodeRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); + + Node actualResponse = client.startNodeAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void startNodeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + StartNodeRequest request = + StartNodeRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); + client.startNodeAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @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(); + mockService.addResponse(resultOperation); + + Node node = + 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(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Node actualResponse = client.updateNodeAsync(node, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateNodeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Node node = + 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(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateNodeAsync(node, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void generateServiceIdentityTest() throws Exception { + GenerateServiceIdentityResponse expectedResponse = + GenerateServiceIdentityResponse.newBuilder() + .setIdentity(ServiceIdentity.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GenerateServiceIdentityRequest request = + GenerateServiceIdentityRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + + GenerateServiceIdentityResponse actualResponse = client.generateServiceIdentity(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void generateServiceIdentityExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.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(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + 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 = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listAcceleratorTypesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + 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(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + 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 = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listAcceleratorTypesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + 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(); + mockService.addResponse(expectedResponse); + + AcceleratorTypeName name = + AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]"); + + AcceleratorType actualResponse = client.getAcceleratorType(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getAcceleratorTypeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.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(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-7118/locations/location-7118/acceleratorTypes/acceleratorType-7118"; + + AcceleratorType actualResponse = client.getAcceleratorType(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getAcceleratorTypeExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-7118/locations/location-7118/acceleratorTypes/acceleratorType-7118"; + 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(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + 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 = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listRuntimeVersionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + 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(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + 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 = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listRuntimeVersionsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + 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(); + mockService.addResponse(expectedResponse); + + RuntimeVersionName name = RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]"); + + RuntimeVersion actualResponse = client.getRuntimeVersion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getRuntimeVersionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.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(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-5927/locations/location-5927/runtimeVersions/runtimeVersion-5927"; + + RuntimeVersion actualResponse = client.getRuntimeVersion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getRuntimeVersionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-5927/locations/location-5927/runtimeVersions/runtimeVersion-5927"; + 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(); + mockService.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 = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getGuestAttributesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.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. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/TpuClientTest.java b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/TpuClientTest.java new file mode 100644 index 000000000000..c1f2e4502e8d --- /dev/null +++ b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2/TpuClientTest.java @@ -0,0 +1,1259 @@ +/* + * 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.v2; + +import static com.google.cloud.tpu.v2.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v2.TpuClient.ListLocationsPagedResponse; +import static com.google.cloud.tpu.v2.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v2.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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class TpuClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockTpu mockTpu; + private LocalChannelProvider channelProvider; + private TpuClient client; + + @BeforeClass + public static void startStaticServer() { + mockTpu = new MockTpu(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockTpu, mockLocations)); + 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") + .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 { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteNodeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTpu.addResponse(resultOperation); + + NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); + + client.deleteNodeAsync(name).get(); + + 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 { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteNodeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTpu.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteNodeAsync(name).get(); + + 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(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .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(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .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(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .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(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .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); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + 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 { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + 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); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + 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 { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + 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. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockLocations.java b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockLocations.java new file mode 100644 index 000000000000..4ca0f78d1280 --- /dev/null +++ b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.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 MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockLocationsImpl.java b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockLocationsImpl.java new file mode 100644 index 000000000000..c0dddb930098 --- /dev/null +++ b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockLocationsImpl.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tpu.v2alpha1; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockTpuImpl.java b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockTpuImpl.java index 54096f705d73..110a7e2439ce 100644 --- a/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockTpuImpl.java +++ b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/MockTpuImpl.java @@ -200,6 +200,91 @@ public void updateNode(UpdateNodeRequest request, StreamObserver resp } } + @Override + public void listQueuedResources( + ListQueuedResourcesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListQueuedResourcesResponse) { + requests.add(request); + responseObserver.onNext(((ListQueuedResourcesResponse) 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 ListQueuedResources, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListQueuedResourcesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getQueuedResource( + GetQueuedResourceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof QueuedResource) { + requests.add(request); + responseObserver.onNext(((QueuedResource) 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 GetQueuedResource, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + QueuedResource.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createQueuedResource( + CreateQueuedResourceRequest 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 CreateQueuedResource, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteQueuedResource( + DeleteQueuedResourceRequest 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 DeleteQueuedResource, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + @Override public void generateServiceIdentity( GenerateServiceIdentityRequest request, @@ -329,4 +414,25 @@ public void getGuestAttributes( Exception.class.getName()))); } } + + @Override + public void simulateMaintenanceEvent( + SimulateMaintenanceEventRequest 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 SimulateMaintenanceEvent, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } } diff --git a/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/TpuClientTest.java b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/TpuClientTest.java index 79115b13271b..6a7b8f8dbc50 100644 --- a/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/TpuClientTest.java +++ b/java-tpu/google-cloud-tpu/src/test/java/com/google/cloud/tpu/v2alpha1/TpuClientTest.java @@ -17,7 +17,9 @@ package com.google.cloud.tpu.v2alpha1; import static com.google.cloud.tpu.v2alpha1.TpuClient.ListAcceleratorTypesPagedResponse; +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListLocationsPagedResponse; import static com.google.cloud.tpu.v2alpha1.TpuClient.ListNodesPagedResponse; +import static com.google.cloud.tpu.v2alpha1.TpuClient.ListQueuedResourcesPagedResponse; import static com.google.cloud.tpu.v2alpha1.TpuClient.ListRuntimeVersionsPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; @@ -28,10 +30,15 @@ import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.common.collect.Lists; import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; import com.google.protobuf.Any; +import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; import com.google.protobuf.Timestamp; import io.grpc.StatusRuntimeException; @@ -52,6 +59,7 @@ @Generated("by gapic-generator-java") public class TpuClientTest { + private static MockLocations mockLocations; private static MockServiceHelper mockServiceHelper; private static MockTpu mockTpu; private LocalChannelProvider channelProvider; @@ -60,9 +68,10 @@ public class TpuClientTest { @BeforeClass public static void startStaticServer() { mockTpu = new MockTpu(); + mockLocations = new MockLocations(); mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockTpu)); + UUID.randomUUID().toString(), Arrays.asList(mockTpu, mockLocations)); mockServiceHelper.start(); } @@ -98,7 +107,7 @@ public void listNodesTest() throws Exception { .build(); mockTpu.addResponse(expectedResponse); - NodeName parent = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); ListNodesPagedResponse pagedListResponse = client.listNodes(parent); @@ -124,7 +133,7 @@ public void listNodesExceptionTest() throws Exception { mockTpu.addException(exception); try { - NodeName parent = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); client.listNodes(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { @@ -197,6 +206,7 @@ public void getNodeTest() throws Exception { .setId(3355) .addAllDataDisks(new ArrayList()) .addAllSymptoms(new ArrayList()) + .setQueuedResource("queuedResource94310049") .setShieldedInstanceConfig(ShieldedInstanceConfig.newBuilder().build()) .build(); mockTpu.addResponse(expectedResponse); @@ -252,6 +262,7 @@ public void getNodeTest2() throws Exception { .setId(3355) .addAllDataDisks(new ArrayList()) .addAllSymptoms(new ArrayList()) + .setQueuedResource("queuedResource94310049") .setShieldedInstanceConfig(ShieldedInstanceConfig.newBuilder().build()) .build(); mockTpu.addResponse(expectedResponse); @@ -307,6 +318,7 @@ public void createNodeTest() throws Exception { .setId(3355) .addAllDataDisks(new ArrayList()) .addAllSymptoms(new ArrayList()) + .setQueuedResource("queuedResource94310049") .setShieldedInstanceConfig(ShieldedInstanceConfig.newBuilder().build()) .build(); Operation resultOperation = @@ -376,6 +388,7 @@ public void createNodeTest2() throws Exception { .setId(3355) .addAllDataDisks(new ArrayList()) .addAllSymptoms(new ArrayList()) + .setQueuedResource("queuedResource94310049") .setShieldedInstanceConfig(ShieldedInstanceConfig.newBuilder().build()) .build(); Operation resultOperation = @@ -426,27 +439,7 @@ public void createNodeExceptionTest2() throws Exception { @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(); + Empty expectedResponse = Empty.newBuilder().build(); Operation resultOperation = Operation.newBuilder() .setName("deleteNodeTest") @@ -457,8 +450,7 @@ public void deleteNodeTest() throws Exception { NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); - Node actualResponse = client.deleteNodeAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); + client.deleteNodeAsync(name).get(); List actualRequests = mockTpu.getRequests(); Assert.assertEquals(1, actualRequests.size()); @@ -489,27 +481,7 @@ public void deleteNodeExceptionTest() throws Exception { @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(); + Empty expectedResponse = Empty.newBuilder().build(); Operation resultOperation = Operation.newBuilder() .setName("deleteNodeTest") @@ -520,8 +492,7 @@ public void deleteNodeTest2() throws Exception { String name = "name3373707"; - Node actualResponse = client.deleteNodeAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); + client.deleteNodeAsync(name).get(); List actualRequests = mockTpu.getRequests(); Assert.assertEquals(1, actualRequests.size()); @@ -571,6 +542,7 @@ public void stopNodeTest() throws Exception { .setId(3355) .addAllDataDisks(new ArrayList()) .addAllSymptoms(new ArrayList()) + .setQueuedResource("queuedResource94310049") .setShieldedInstanceConfig(ShieldedInstanceConfig.newBuilder().build()) .build(); Operation resultOperation = @@ -581,7 +553,10 @@ public void stopNodeTest() throws Exception { .build(); mockTpu.addResponse(resultOperation); - StopNodeRequest request = StopNodeRequest.newBuilder().setName("name3373707").build(); + StopNodeRequest request = + StopNodeRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); Node actualResponse = client.stopNodeAsync(request).get(); Assert.assertEquals(expectedResponse, actualResponse); @@ -603,7 +578,10 @@ public void stopNodeExceptionTest() throws Exception { mockTpu.addException(exception); try { - StopNodeRequest request = StopNodeRequest.newBuilder().setName("name3373707").build(); + StopNodeRequest request = + StopNodeRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); client.stopNodeAsync(request).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { @@ -634,6 +612,7 @@ public void startNodeTest() throws Exception { .setId(3355) .addAllDataDisks(new ArrayList()) .addAllSymptoms(new ArrayList()) + .setQueuedResource("queuedResource94310049") .setShieldedInstanceConfig(ShieldedInstanceConfig.newBuilder().build()) .build(); Operation resultOperation = @@ -644,7 +623,10 @@ public void startNodeTest() throws Exception { .build(); mockTpu.addResponse(resultOperation); - StartNodeRequest request = StartNodeRequest.newBuilder().setName("name3373707").build(); + StartNodeRequest request = + StartNodeRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); Node actualResponse = client.startNodeAsync(request).get(); Assert.assertEquals(expectedResponse, actualResponse); @@ -666,7 +648,10 @@ public void startNodeExceptionTest() throws Exception { mockTpu.addException(exception); try { - StartNodeRequest request = StartNodeRequest.newBuilder().setName("name3373707").build(); + StartNodeRequest request = + StartNodeRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); client.startNodeAsync(request).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { @@ -697,6 +682,7 @@ public void updateNodeTest() throws Exception { .setId(3355) .addAllDataDisks(new ArrayList()) .addAllSymptoms(new ArrayList()) + .setQueuedResource("queuedResource94310049") .setShieldedInstanceConfig(ShieldedInstanceConfig.newBuilder().build()) .build(); Operation resultOperation = @@ -742,6 +728,392 @@ public void updateNodeExceptionTest() throws Exception { } } + @Test + public void listQueuedResourcesTest() throws Exception { + QueuedResource responsesElement = QueuedResource.newBuilder().build(); + ListQueuedResourcesResponse expectedResponse = + ListQueuedResourcesResponse.newBuilder() + .setNextPageToken("") + .addAllQueuedResources(Arrays.asList(responsesElement)) + .build(); + mockTpu.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListQueuedResourcesPagedResponse pagedListResponse = client.listQueuedResources(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getQueuedResourcesList().get(0), resources.get(0)); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListQueuedResourcesRequest actualRequest = ((ListQueuedResourcesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listQueuedResourcesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listQueuedResources(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listQueuedResourcesTest2() throws Exception { + QueuedResource responsesElement = QueuedResource.newBuilder().build(); + ListQueuedResourcesResponse expectedResponse = + ListQueuedResourcesResponse.newBuilder() + .setNextPageToken("") + .addAllQueuedResources(Arrays.asList(responsesElement)) + .build(); + mockTpu.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListQueuedResourcesPagedResponse pagedListResponse = client.listQueuedResources(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getQueuedResourcesList().get(0), resources.get(0)); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListQueuedResourcesRequest actualRequest = ((ListQueuedResourcesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listQueuedResourcesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + String parent = "parent-995424086"; + client.listQueuedResources(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getQueuedResourceTest() throws Exception { + QueuedResource expectedResponse = + QueuedResource.newBuilder() + .setName( + QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString()) + .setQueueingPolicy(QueuedResource.QueueingPolicy.newBuilder().build()) + .setState(QueuedResourceState.newBuilder().build()) + .build(); + mockTpu.addResponse(expectedResponse); + + QueuedResourceName name = QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]"); + + QueuedResource actualResponse = client.getQueuedResource(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetQueuedResourceRequest actualRequest = ((GetQueuedResourceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getQueuedResourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + QueuedResourceName name = + QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]"); + client.getQueuedResource(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getQueuedResourceTest2() throws Exception { + QueuedResource expectedResponse = + QueuedResource.newBuilder() + .setName( + QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString()) + .setQueueingPolicy(QueuedResource.QueueingPolicy.newBuilder().build()) + .setState(QueuedResourceState.newBuilder().build()) + .build(); + mockTpu.addResponse(expectedResponse); + + String name = "name3373707"; + + QueuedResource actualResponse = client.getQueuedResource(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetQueuedResourceRequest actualRequest = ((GetQueuedResourceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getQueuedResourceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + String name = "name3373707"; + client.getQueuedResource(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createQueuedResourceTest() throws Exception { + QueuedResource expectedResponse = + QueuedResource.newBuilder() + .setName( + QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString()) + .setQueueingPolicy(QueuedResource.QueueingPolicy.newBuilder().build()) + .setState(QueuedResourceState.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createQueuedResourceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTpu.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + QueuedResource queuedResource = QueuedResource.newBuilder().build(); + String queuedResourceId = "queuedResourceId437646236"; + + QueuedResource actualResponse = + client.createQueuedResourceAsync(parent, queuedResource, queuedResourceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateQueuedResourceRequest actualRequest = + ((CreateQueuedResourceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(queuedResource, actualRequest.getQueuedResource()); + Assert.assertEquals(queuedResourceId, actualRequest.getQueuedResourceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createQueuedResourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + QueuedResource queuedResource = QueuedResource.newBuilder().build(); + String queuedResourceId = "queuedResourceId437646236"; + client.createQueuedResourceAsync(parent, queuedResource, queuedResourceId).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 createQueuedResourceTest2() throws Exception { + QueuedResource expectedResponse = + QueuedResource.newBuilder() + .setName( + QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString()) + .setQueueingPolicy(QueuedResource.QueueingPolicy.newBuilder().build()) + .setState(QueuedResourceState.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createQueuedResourceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTpu.addResponse(resultOperation); + + String parent = "parent-995424086"; + QueuedResource queuedResource = QueuedResource.newBuilder().build(); + String queuedResourceId = "queuedResourceId437646236"; + + QueuedResource actualResponse = + client.createQueuedResourceAsync(parent, queuedResource, queuedResourceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateQueuedResourceRequest actualRequest = + ((CreateQueuedResourceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(queuedResource, actualRequest.getQueuedResource()); + Assert.assertEquals(queuedResourceId, actualRequest.getQueuedResourceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createQueuedResourceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + String parent = "parent-995424086"; + QueuedResource queuedResource = QueuedResource.newBuilder().build(); + String queuedResourceId = "queuedResourceId437646236"; + client.createQueuedResourceAsync(parent, queuedResource, queuedResourceId).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 deleteQueuedResourceTest() throws Exception { + QueuedResource expectedResponse = + QueuedResource.newBuilder() + .setName( + QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString()) + .setQueueingPolicy(QueuedResource.QueueingPolicy.newBuilder().build()) + .setState(QueuedResourceState.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteQueuedResourceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTpu.addResponse(resultOperation); + + QueuedResourceName name = QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]"); + + QueuedResource actualResponse = client.deleteQueuedResourceAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteQueuedResourceRequest actualRequest = + ((DeleteQueuedResourceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteQueuedResourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + QueuedResourceName name = + QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]"); + client.deleteQueuedResourceAsync(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 deleteQueuedResourceTest2() throws Exception { + QueuedResource expectedResponse = + QueuedResource.newBuilder() + .setName( + QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString()) + .setQueueingPolicy(QueuedResource.QueueingPolicy.newBuilder().build()) + .setState(QueuedResourceState.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteQueuedResourceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTpu.addResponse(resultOperation); + + String name = "name3373707"; + + QueuedResource actualResponse = client.deleteQueuedResourceAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteQueuedResourceRequest actualRequest = + ((DeleteQueuedResourceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteQueuedResourceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + String name = "name3373707"; + client.deleteQueuedResourceAsync(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 generateServiceIdentityTest() throws Exception { GenerateServiceIdentityResponse expectedResponse = @@ -797,8 +1169,7 @@ public void listAcceleratorTypesTest() throws Exception { .build(); mockTpu.addResponse(expectedResponse); - AcceleratorTypeName parent = - AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]"); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); ListAcceleratorTypesPagedResponse pagedListResponse = client.listAcceleratorTypes(parent); @@ -825,8 +1196,7 @@ public void listAcceleratorTypesExceptionTest() throws Exception { mockTpu.addException(exception); try { - AcceleratorTypeName parent = - AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]"); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); client.listAcceleratorTypes(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { @@ -971,8 +1341,7 @@ public void listRuntimeVersionsTest() throws Exception { .build(); mockTpu.addResponse(expectedResponse); - RuntimeVersionName parent = - RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]"); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); ListRuntimeVersionsPagedResponse pagedListResponse = client.listRuntimeVersions(parent); @@ -998,8 +1367,7 @@ public void listRuntimeVersionsExceptionTest() throws Exception { mockTpu.addException(exception); try { - RuntimeVersionName parent = - RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]"); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); client.listRuntimeVersions(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { @@ -1181,4 +1549,179 @@ public void getGuestAttributesExceptionTest() throws Exception { // Expected exception. } } + + @Test + public void simulateMaintenanceEventTest() 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()) + .setQueuedResource("queuedResource94310049") + .setShieldedInstanceConfig(ShieldedInstanceConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("simulateMaintenanceEventTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTpu.addResponse(resultOperation); + + SimulateMaintenanceEventRequest request = + SimulateMaintenanceEventRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .addAllWorkerIds(new ArrayList()) + .build(); + + Node actualResponse = client.simulateMaintenanceEventAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTpu.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SimulateMaintenanceEventRequest actualRequest = + ((SimulateMaintenanceEventRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getWorkerIdsList(), actualRequest.getWorkerIdsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void simulateMaintenanceEventExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTpu.addException(exception); + + try { + SimulateMaintenanceEventRequest request = + SimulateMaintenanceEventRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .addAllWorkerIds(new ArrayList()) + .build(); + client.simulateMaintenanceEventAsync(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 listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/java-tpu/grpc-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TpuGrpc.java b/java-tpu/grpc-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TpuGrpc.java index 45ac81317206..9820ab5a867f 100644 --- a/java-tpu/grpc-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TpuGrpc.java +++ b/java-tpu/grpc-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/TpuGrpc.java @@ -621,7 +621,7 @@ public void reimageNode( * * *
-     * Stops a node.
+     * Stops a node, this operation is only available with single TPU nodes.
      * 
*/ public void stopNode( @@ -872,7 +872,7 @@ public void reimageNode( * * *
-     * Stops a node.
+     * Stops a node, this operation is only available with single TPU nodes.
      * 
*/ public void stopNode( @@ -1050,7 +1050,7 @@ public com.google.longrunning.Operation reimageNode( * * *
-     * Stops a node.
+     * Stops a node, this operation is only available with single TPU nodes.
      * 
*/ public com.google.longrunning.Operation stopNode( @@ -1213,7 +1213,7 @@ public com.google.common.util.concurrent.ListenableFuture - * Stops a node. + * Stops a node, this operation is only available with single TPU nodes. * */ public com.google.common.util.concurrent.ListenableFuture diff --git a/java-tpu/grpc-google-cloud-tpu-v2/pom.xml b/java-tpu/grpc-google-cloud-tpu-v2/pom.xml new file mode 100644 index 000000000000..1ae1a00d00c2 --- /dev/null +++ b/java-tpu/grpc-google-cloud-tpu-v2/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-tpu-v2 + 2.8.0-SNAPSHOT + grpc-google-cloud-tpu-v2 + GRPC library for google-cloud-tpu + + com.google.cloud + google-cloud-tpu-parent + 2.8.0-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-tpu-v2 + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/java-tpu/grpc-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/TpuGrpc.java b/java-tpu/grpc-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/TpuGrpc.java new file mode 100644 index 000000000000..97342624abb5 --- /dev/null +++ b/java-tpu/grpc-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/TpuGrpc.java @@ -0,0 +1,1696 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.tpu.v2; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Manages TPU nodes and other resources
+ * TPU API v2
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/tpu/v2/cloud_tpu.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class TpuGrpc { + + private TpuGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.tpu.v2.Tpu"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.ListNodesRequest, com.google.cloud.tpu.v2.ListNodesResponse> + getListNodesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListNodes", + requestType = com.google.cloud.tpu.v2.ListNodesRequest.class, + responseType = com.google.cloud.tpu.v2.ListNodesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.ListNodesRequest, com.google.cloud.tpu.v2.ListNodesResponse> + getListNodesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.ListNodesRequest, com.google.cloud.tpu.v2.ListNodesResponse> + getListNodesMethod; + if ((getListNodesMethod = TpuGrpc.getListNodesMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getListNodesMethod = TpuGrpc.getListNodesMethod) == null) { + TpuGrpc.getListNodesMethod = + getListNodesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListNodes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2.ListNodesRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2.ListNodesResponse.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("ListNodes")) + .build(); + } + } + } + return getListNodesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.GetNodeRequest, com.google.cloud.tpu.v2.Node> + getGetNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetNode", + requestType = com.google.cloud.tpu.v2.GetNodeRequest.class, + responseType = com.google.cloud.tpu.v2.Node.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.GetNodeRequest, com.google.cloud.tpu.v2.Node> + getGetNodeMethod() { + io.grpc.MethodDescriptor + getGetNodeMethod; + if ((getGetNodeMethod = TpuGrpc.getGetNodeMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getGetNodeMethod = TpuGrpc.getGetNodeMethod) == null) { + TpuGrpc.getGetNodeMethod = + getGetNodeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetNode")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2.GetNodeRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2.Node.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("GetNode")) + .build(); + } + } + } + return getGetNodeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.CreateNodeRequest, com.google.longrunning.Operation> + getCreateNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateNode", + requestType = com.google.cloud.tpu.v2.CreateNodeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.CreateNodeRequest, com.google.longrunning.Operation> + getCreateNodeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.CreateNodeRequest, com.google.longrunning.Operation> + getCreateNodeMethod; + if ((getCreateNodeMethod = TpuGrpc.getCreateNodeMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getCreateNodeMethod = TpuGrpc.getCreateNodeMethod) == null) { + TpuGrpc.getCreateNodeMethod = + getCreateNodeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateNode")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2.CreateNodeRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("CreateNode")) + .build(); + } + } + } + return getCreateNodeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.DeleteNodeRequest, com.google.longrunning.Operation> + getDeleteNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteNode", + requestType = com.google.cloud.tpu.v2.DeleteNodeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.DeleteNodeRequest, com.google.longrunning.Operation> + getDeleteNodeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.DeleteNodeRequest, com.google.longrunning.Operation> + getDeleteNodeMethod; + if ((getDeleteNodeMethod = TpuGrpc.getDeleteNodeMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getDeleteNodeMethod = TpuGrpc.getDeleteNodeMethod) == null) { + TpuGrpc.getDeleteNodeMethod = + getDeleteNodeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteNode")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2.DeleteNodeRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("DeleteNode")) + .build(); + } + } + } + return getDeleteNodeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.StopNodeRequest, com.google.longrunning.Operation> + getStopNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StopNode", + requestType = com.google.cloud.tpu.v2.StopNodeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.StopNodeRequest, com.google.longrunning.Operation> + getStopNodeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.StopNodeRequest, com.google.longrunning.Operation> + getStopNodeMethod; + if ((getStopNodeMethod = TpuGrpc.getStopNodeMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getStopNodeMethod = TpuGrpc.getStopNodeMethod) == null) { + TpuGrpc.getStopNodeMethod = + getStopNodeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StopNode")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2.StopNodeRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("StopNode")) + .build(); + } + } + } + return getStopNodeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.StartNodeRequest, com.google.longrunning.Operation> + getStartNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StartNode", + requestType = com.google.cloud.tpu.v2.StartNodeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.StartNodeRequest, com.google.longrunning.Operation> + getStartNodeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.StartNodeRequest, com.google.longrunning.Operation> + getStartNodeMethod; + if ((getStartNodeMethod = TpuGrpc.getStartNodeMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getStartNodeMethod = TpuGrpc.getStartNodeMethod) == null) { + TpuGrpc.getStartNodeMethod = + getStartNodeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StartNode")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2.StartNodeRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("StartNode")) + .build(); + } + } + } + return getStartNodeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.UpdateNodeRequest, com.google.longrunning.Operation> + getUpdateNodeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateNode", + requestType = com.google.cloud.tpu.v2.UpdateNodeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.UpdateNodeRequest, com.google.longrunning.Operation> + getUpdateNodeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.UpdateNodeRequest, com.google.longrunning.Operation> + getUpdateNodeMethod; + if ((getUpdateNodeMethod = TpuGrpc.getUpdateNodeMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getUpdateNodeMethod = TpuGrpc.getUpdateNodeMethod) == null) { + TpuGrpc.getUpdateNodeMethod = + getUpdateNodeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateNode")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2.UpdateNodeRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("UpdateNode")) + .build(); + } + } + } + return getUpdateNodeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.GenerateServiceIdentityRequest, + com.google.cloud.tpu.v2.GenerateServiceIdentityResponse> + getGenerateServiceIdentityMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GenerateServiceIdentity", + requestType = com.google.cloud.tpu.v2.GenerateServiceIdentityRequest.class, + responseType = com.google.cloud.tpu.v2.GenerateServiceIdentityResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.GenerateServiceIdentityRequest, + com.google.cloud.tpu.v2.GenerateServiceIdentityResponse> + getGenerateServiceIdentityMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.GenerateServiceIdentityRequest, + com.google.cloud.tpu.v2.GenerateServiceIdentityResponse> + getGenerateServiceIdentityMethod; + if ((getGenerateServiceIdentityMethod = TpuGrpc.getGenerateServiceIdentityMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getGenerateServiceIdentityMethod = TpuGrpc.getGenerateServiceIdentityMethod) == null) { + TpuGrpc.getGenerateServiceIdentityMethod = + getGenerateServiceIdentityMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GenerateServiceIdentity")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2.GenerateServiceIdentityRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2.GenerateServiceIdentityResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new TpuMethodDescriptorSupplier("GenerateServiceIdentity")) + .build(); + } + } + } + return getGenerateServiceIdentityMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.ListAcceleratorTypesRequest, + com.google.cloud.tpu.v2.ListAcceleratorTypesResponse> + getListAcceleratorTypesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListAcceleratorTypes", + requestType = com.google.cloud.tpu.v2.ListAcceleratorTypesRequest.class, + responseType = com.google.cloud.tpu.v2.ListAcceleratorTypesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.ListAcceleratorTypesRequest, + com.google.cloud.tpu.v2.ListAcceleratorTypesResponse> + getListAcceleratorTypesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.ListAcceleratorTypesRequest, + com.google.cloud.tpu.v2.ListAcceleratorTypesResponse> + getListAcceleratorTypesMethod; + if ((getListAcceleratorTypesMethod = TpuGrpc.getListAcceleratorTypesMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getListAcceleratorTypesMethod = TpuGrpc.getListAcceleratorTypesMethod) == null) { + TpuGrpc.getListAcceleratorTypesMethod = + getListAcceleratorTypesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListAcceleratorTypes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2.ListAcceleratorTypesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2.ListAcceleratorTypesResponse + .getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("ListAcceleratorTypes")) + .build(); + } + } + } + return getListAcceleratorTypesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.GetAcceleratorTypeRequest, + com.google.cloud.tpu.v2.AcceleratorType> + getGetAcceleratorTypeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAcceleratorType", + requestType = com.google.cloud.tpu.v2.GetAcceleratorTypeRequest.class, + responseType = com.google.cloud.tpu.v2.AcceleratorType.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.GetAcceleratorTypeRequest, + com.google.cloud.tpu.v2.AcceleratorType> + getGetAcceleratorTypeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.GetAcceleratorTypeRequest, + com.google.cloud.tpu.v2.AcceleratorType> + getGetAcceleratorTypeMethod; + if ((getGetAcceleratorTypeMethod = TpuGrpc.getGetAcceleratorTypeMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getGetAcceleratorTypeMethod = TpuGrpc.getGetAcceleratorTypeMethod) == null) { + TpuGrpc.getGetAcceleratorTypeMethod = + getGetAcceleratorTypeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetAcceleratorType")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2.GetAcceleratorTypeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2.AcceleratorType.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("GetAcceleratorType")) + .build(); + } + } + } + return getGetAcceleratorTypeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.ListRuntimeVersionsRequest, + com.google.cloud.tpu.v2.ListRuntimeVersionsResponse> + getListRuntimeVersionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListRuntimeVersions", + requestType = com.google.cloud.tpu.v2.ListRuntimeVersionsRequest.class, + responseType = com.google.cloud.tpu.v2.ListRuntimeVersionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.ListRuntimeVersionsRequest, + com.google.cloud.tpu.v2.ListRuntimeVersionsResponse> + getListRuntimeVersionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.ListRuntimeVersionsRequest, + com.google.cloud.tpu.v2.ListRuntimeVersionsResponse> + getListRuntimeVersionsMethod; + if ((getListRuntimeVersionsMethod = TpuGrpc.getListRuntimeVersionsMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getListRuntimeVersionsMethod = TpuGrpc.getListRuntimeVersionsMethod) == null) { + TpuGrpc.getListRuntimeVersionsMethod = + getListRuntimeVersionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListRuntimeVersions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2.ListRuntimeVersionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2.ListRuntimeVersionsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("ListRuntimeVersions")) + .build(); + } + } + } + return getListRuntimeVersionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.GetRuntimeVersionRequest, com.google.cloud.tpu.v2.RuntimeVersion> + getGetRuntimeVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetRuntimeVersion", + requestType = com.google.cloud.tpu.v2.GetRuntimeVersionRequest.class, + responseType = com.google.cloud.tpu.v2.RuntimeVersion.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.GetRuntimeVersionRequest, com.google.cloud.tpu.v2.RuntimeVersion> + getGetRuntimeVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.GetRuntimeVersionRequest, + com.google.cloud.tpu.v2.RuntimeVersion> + getGetRuntimeVersionMethod; + if ((getGetRuntimeVersionMethod = TpuGrpc.getGetRuntimeVersionMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getGetRuntimeVersionMethod = TpuGrpc.getGetRuntimeVersionMethod) == null) { + TpuGrpc.getGetRuntimeVersionMethod = + getGetRuntimeVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetRuntimeVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2.GetRuntimeVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2.RuntimeVersion.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("GetRuntimeVersion")) + .build(); + } + } + } + return getGetRuntimeVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.GetGuestAttributesRequest, + com.google.cloud.tpu.v2.GetGuestAttributesResponse> + getGetGuestAttributesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetGuestAttributes", + requestType = com.google.cloud.tpu.v2.GetGuestAttributesRequest.class, + responseType = com.google.cloud.tpu.v2.GetGuestAttributesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.GetGuestAttributesRequest, + com.google.cloud.tpu.v2.GetGuestAttributesResponse> + getGetGuestAttributesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2.GetGuestAttributesRequest, + com.google.cloud.tpu.v2.GetGuestAttributesResponse> + getGetGuestAttributesMethod; + if ((getGetGuestAttributesMethod = TpuGrpc.getGetGuestAttributesMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getGetGuestAttributesMethod = TpuGrpc.getGetGuestAttributesMethod) == null) { + TpuGrpc.getGetGuestAttributesMethod = + getGetGuestAttributesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetGuestAttributes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2.GetGuestAttributesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2.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 v2
+   * 
+ */ + public abstract static class TpuImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists nodes.
+     * 
+ */ + public void listNodes( + com.google.cloud.tpu.v2.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.v2.GetNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetNodeMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a node.
+     * 
+ */ + public void createNode( + com.google.cloud.tpu.v2.CreateNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateNodeMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a node.
+     * 
+ */ + public void deleteNode( + com.google.cloud.tpu.v2.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.v2.StopNodeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStopNodeMethod(), responseObserver); + } + + /** + * + * + *
+     * Starts a node.
+     * 
+ */ + public void startNode( + com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.ListAcceleratorTypesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListAcceleratorTypesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets AcceleratorType.
+     * 
+ */ + public void getAcceleratorType( + com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.ListNodesRequest, + com.google.cloud.tpu.v2.ListNodesResponse>(this, METHODID_LIST_NODES))) + .addMethod( + getGetNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2.GetNodeRequest, com.google.cloud.tpu.v2.Node>( + this, METHODID_GET_NODE))) + .addMethod( + getCreateNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2.CreateNodeRequest, com.google.longrunning.Operation>( + this, METHODID_CREATE_NODE))) + .addMethod( + getDeleteNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2.DeleteNodeRequest, com.google.longrunning.Operation>( + this, METHODID_DELETE_NODE))) + .addMethod( + getStopNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2.StopNodeRequest, com.google.longrunning.Operation>( + this, METHODID_STOP_NODE))) + .addMethod( + getStartNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2.StartNodeRequest, com.google.longrunning.Operation>( + this, METHODID_START_NODE))) + .addMethod( + getUpdateNodeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2.UpdateNodeRequest, com.google.longrunning.Operation>( + this, METHODID_UPDATE_NODE))) + .addMethod( + getGenerateServiceIdentityMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2.GenerateServiceIdentityRequest, + com.google.cloud.tpu.v2.GenerateServiceIdentityResponse>( + this, METHODID_GENERATE_SERVICE_IDENTITY))) + .addMethod( + getListAcceleratorTypesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2.ListAcceleratorTypesRequest, + com.google.cloud.tpu.v2.ListAcceleratorTypesResponse>( + this, METHODID_LIST_ACCELERATOR_TYPES))) + .addMethod( + getGetAcceleratorTypeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2.GetAcceleratorTypeRequest, + com.google.cloud.tpu.v2.AcceleratorType>( + this, METHODID_GET_ACCELERATOR_TYPE))) + .addMethod( + getListRuntimeVersionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2.ListRuntimeVersionsRequest, + com.google.cloud.tpu.v2.ListRuntimeVersionsResponse>( + this, METHODID_LIST_RUNTIME_VERSIONS))) + .addMethod( + getGetRuntimeVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2.GetRuntimeVersionRequest, + com.google.cloud.tpu.v2.RuntimeVersion>(this, METHODID_GET_RUNTIME_VERSION))) + .addMethod( + getGetGuestAttributesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2.GetGuestAttributesRequest, + com.google.cloud.tpu.v2.GetGuestAttributesResponse>( + this, METHODID_GET_GUEST_ATTRIBUTES))) + .build(); + } + } + + /** + * + * + *
+   * Manages TPU nodes and other resources
+   * TPU API v2
+   * 
+ */ + 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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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 v2
+   * 
+ */ + 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.v2.ListNodesResponse listNodes( + com.google.cloud.tpu.v2.ListNodesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListNodesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the details of a node.
+     * 
+ */ + public com.google.cloud.tpu.v2.Node getNode(com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.GenerateServiceIdentityResponse generateServiceIdentity( + com.google.cloud.tpu.v2.GenerateServiceIdentityRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGenerateServiceIdentityMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists accelerator types supported by this API.
+     * 
+ */ + public com.google.cloud.tpu.v2.ListAcceleratorTypesResponse listAcceleratorTypes( + com.google.cloud.tpu.v2.ListAcceleratorTypesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListAcceleratorTypesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets AcceleratorType.
+     * 
+ */ + public com.google.cloud.tpu.v2.AcceleratorType getAcceleratorType( + com.google.cloud.tpu.v2.GetAcceleratorTypeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetAcceleratorTypeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists runtime versions supported by this API.
+     * 
+ */ + public com.google.cloud.tpu.v2.ListRuntimeVersionsResponse listRuntimeVersions( + com.google.cloud.tpu.v2.ListRuntimeVersionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListRuntimeVersionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a runtime version.
+     * 
+ */ + public com.google.cloud.tpu.v2.RuntimeVersion getRuntimeVersion( + com.google.cloud.tpu.v2.GetRuntimeVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetRuntimeVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves the guest attributes for the node.
+     * 
+ */ + public com.google.cloud.tpu.v2.GetGuestAttributesResponse getGuestAttributes( + com.google.cloud.tpu.v2.GetGuestAttributesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetGuestAttributesMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Manages TPU nodes and other resources
+   * TPU API v2
+   * 
+ */ + public static final class TpuFutureStub extends io.grpc.stub.AbstractFutureStub { + private TpuFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TpuFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TpuFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists nodes.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.tpu.v2.ListNodesResponse> + listNodes(com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.UpdateNodeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateNodeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Generates the Cloud TPU service identity for the project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.tpu.v2.GenerateServiceIdentityResponse> + generateServiceIdentity(com.google.cloud.tpu.v2.GenerateServiceIdentityRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGenerateServiceIdentityMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists accelerator types supported by this API.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.tpu.v2.ListAcceleratorTypesResponse> + listAcceleratorTypes(com.google.cloud.tpu.v2.ListAcceleratorTypesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListAcceleratorTypesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets AcceleratorType.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.tpu.v2.AcceleratorType> + getAcceleratorType(com.google.cloud.tpu.v2.GetAcceleratorTypeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetAcceleratorTypeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists runtime versions supported by this API.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.tpu.v2.ListRuntimeVersionsResponse> + listRuntimeVersions(com.google.cloud.tpu.v2.ListRuntimeVersionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListRuntimeVersionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a runtime version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.tpu.v2.RuntimeVersion> + getRuntimeVersion(com.google.cloud.tpu.v2.GetRuntimeVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetRuntimeVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves the guest attributes for the node.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.tpu.v2.GetGuestAttributesResponse> + getGuestAttributes(com.google.cloud.tpu.v2.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.v2.ListNodesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_NODE: + serviceImpl.getNode( + (com.google.cloud.tpu.v2.GetNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_NODE: + serviceImpl.createNode( + (com.google.cloud.tpu.v2.CreateNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_NODE: + serviceImpl.deleteNode( + (com.google.cloud.tpu.v2.DeleteNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_STOP_NODE: + serviceImpl.stopNode( + (com.google.cloud.tpu.v2.StopNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_START_NODE: + serviceImpl.startNode( + (com.google.cloud.tpu.v2.StartNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_NODE: + serviceImpl.updateNode( + (com.google.cloud.tpu.v2.UpdateNodeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GENERATE_SERVICE_IDENTITY: + serviceImpl.generateServiceIdentity( + (com.google.cloud.tpu.v2.GenerateServiceIdentityRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_ACCELERATOR_TYPES: + serviceImpl.listAcceleratorTypes( + (com.google.cloud.tpu.v2.ListAcceleratorTypesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_ACCELERATOR_TYPE: + serviceImpl.getAcceleratorType( + (com.google.cloud.tpu.v2.GetAcceleratorTypeRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_RUNTIME_VERSIONS: + serviceImpl.listRuntimeVersions( + (com.google.cloud.tpu.v2.ListRuntimeVersionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_RUNTIME_VERSION: + serviceImpl.getRuntimeVersion( + (com.google.cloud.tpu.v2.GetRuntimeVersionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_GUEST_ATTRIBUTES: + serviceImpl.getGuestAttributes( + (com.google.cloud.tpu.v2.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 abstract static class TpuBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + TpuBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.tpu.v2.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/java-tpu/grpc-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/TpuGrpc.java b/java-tpu/grpc-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/TpuGrpc.java index 2482cf27aba1..008a91342433 100644 --- a/java-tpu/grpc-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/TpuGrpc.java +++ b/java-tpu/grpc-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/TpuGrpc.java @@ -326,6 +326,190 @@ private TpuGrpc() {} return getUpdateNodeMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest, + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse> + getListQueuedResourcesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListQueuedResources", + requestType = com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest.class, + responseType = com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest, + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse> + getListQueuedResourcesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest, + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse> + getListQueuedResourcesMethod; + if ((getListQueuedResourcesMethod = TpuGrpc.getListQueuedResourcesMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getListQueuedResourcesMethod = TpuGrpc.getListQueuedResourcesMethod) == null) { + TpuGrpc.getListQueuedResourcesMethod = + getListQueuedResourcesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListQueuedResources")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse + .getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("ListQueuedResources")) + .build(); + } + } + } + return getListQueuedResourcesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest, + com.google.cloud.tpu.v2alpha1.QueuedResource> + getGetQueuedResourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetQueuedResource", + requestType = com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest.class, + responseType = com.google.cloud.tpu.v2alpha1.QueuedResource.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest, + com.google.cloud.tpu.v2alpha1.QueuedResource> + getGetQueuedResourceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest, + com.google.cloud.tpu.v2alpha1.QueuedResource> + getGetQueuedResourceMethod; + if ((getGetQueuedResourceMethod = TpuGrpc.getGetQueuedResourceMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getGetQueuedResourceMethod = TpuGrpc.getGetQueuedResourceMethod) == null) { + TpuGrpc.getGetQueuedResourceMethod = + getGetQueuedResourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetQueuedResource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2alpha1.QueuedResource.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("GetQueuedResource")) + .build(); + } + } + } + return getGetQueuedResourceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest, + com.google.longrunning.Operation> + getCreateQueuedResourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateQueuedResource", + requestType = com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest, + com.google.longrunning.Operation> + getCreateQueuedResourceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest, + com.google.longrunning.Operation> + getCreateQueuedResourceMethod; + if ((getCreateQueuedResourceMethod = TpuGrpc.getCreateQueuedResourceMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getCreateQueuedResourceMethod = TpuGrpc.getCreateQueuedResourceMethod) == null) { + TpuGrpc.getCreateQueuedResourceMethod = + getCreateQueuedResourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateQueuedResource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("CreateQueuedResource")) + .build(); + } + } + } + return getCreateQueuedResourceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest, + com.google.longrunning.Operation> + getDeleteQueuedResourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteQueuedResource", + requestType = com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest, + com.google.longrunning.Operation> + getDeleteQueuedResourceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest, + com.google.longrunning.Operation> + getDeleteQueuedResourceMethod; + if ((getDeleteQueuedResourceMethod = TpuGrpc.getDeleteQueuedResourceMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getDeleteQueuedResourceMethod = TpuGrpc.getDeleteQueuedResourceMethod) == null) { + TpuGrpc.getDeleteQueuedResourceMethod = + getDeleteQueuedResourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteQueuedResource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TpuMethodDescriptorSupplier("DeleteQueuedResource")) + .build(); + } + } + } + return getDeleteQueuedResourceMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest, com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse> @@ -604,6 +788,54 @@ private TpuGrpc() {} return getGetGuestAttributesMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest, + com.google.longrunning.Operation> + getSimulateMaintenanceEventMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SimulateMaintenanceEvent", + requestType = com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest, + com.google.longrunning.Operation> + getSimulateMaintenanceEventMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest, + com.google.longrunning.Operation> + getSimulateMaintenanceEventMethod; + if ((getSimulateMaintenanceEventMethod = TpuGrpc.getSimulateMaintenanceEventMethod) == null) { + synchronized (TpuGrpc.class) { + if ((getSimulateMaintenanceEventMethod = TpuGrpc.getSimulateMaintenanceEventMethod) + == null) { + TpuGrpc.getSimulateMaintenanceEventMethod = + getSimulateMaintenanceEventMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "SimulateMaintenanceEvent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new TpuMethodDescriptorSupplier("SimulateMaintenanceEvent")) + .build(); + } + } + } + return getSimulateMaintenanceEventMethod; + } + /** 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 = @@ -744,6 +976,64 @@ public void updateNode( io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateNodeMethod(), responseObserver); } + /** + * + * + *
+     * Lists queued resources.
+     * 
+ */ + public void listQueuedResources( + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListQueuedResourcesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a queued resource.
+     * 
+ */ + public void getQueuedResource( + com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetQueuedResourceMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a QueuedResource TPU instance.
+     * 
+ */ + public void createQueuedResource( + com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateQueuedResourceMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a QueuedResource TPU instance.
+     * 
+ */ + public void deleteQueuedResource( + com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteQueuedResourceMethod(), responseObserver); + } + /** * * @@ -834,6 +1124,20 @@ public void getGuestAttributes( getGetGuestAttributesMethod(), responseObserver); } + /** + * + * + *
+     * Simulates a maintenance event.
+     * 
+ */ + public void simulateMaintenanceEvent( + com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSimulateMaintenanceEventMethod(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) @@ -879,6 +1183,32 @@ public final io.grpc.ServerServiceDefinition bindService() { new MethodHandlers< com.google.cloud.tpu.v2alpha1.UpdateNodeRequest, com.google.longrunning.Operation>(this, METHODID_UPDATE_NODE))) + .addMethod( + getListQueuedResourcesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest, + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse>( + this, METHODID_LIST_QUEUED_RESOURCES))) + .addMethod( + getGetQueuedResourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest, + com.google.cloud.tpu.v2alpha1.QueuedResource>( + this, METHODID_GET_QUEUED_RESOURCE))) + .addMethod( + getCreateQueuedResourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_QUEUED_RESOURCE))) + .addMethod( + getDeleteQueuedResourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_QUEUED_RESOURCE))) .addMethod( getGenerateServiceIdentityMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -921,6 +1251,12 @@ public final io.grpc.ServerServiceDefinition bindService() { com.google.cloud.tpu.v2alpha1.GetGuestAttributesRequest, com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse>( this, METHODID_GET_GUEST_ATTRIBUTES))) + .addMethod( + getSimulateMaintenanceEventMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest, + com.google.longrunning.Operation>(this, METHODID_SIMULATE_MAINTENANCE_EVENT))) .build(); } } @@ -1042,6 +1378,72 @@ public void updateNode( getChannel().newCall(getUpdateNodeMethod(), getCallOptions()), request, responseObserver); } + /** + * + * + *
+     * Lists queued resources.
+     * 
+ */ + public void listQueuedResources( + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListQueuedResourcesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a queued resource.
+     * 
+ */ + public void getQueuedResource( + com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetQueuedResourceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a QueuedResource TPU instance.
+     * 
+ */ + public void createQueuedResource( + com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateQueuedResourceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a QueuedResource TPU instance.
+     * 
+ */ + public void deleteQueuedResource( + com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteQueuedResourceMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -1143,6 +1545,22 @@ public void getGuestAttributes( request, responseObserver); } + + /** + * + * + *
+     * Simulates a maintenance event.
+     * 
+ */ + public void simulateMaintenanceEvent( + com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSimulateMaintenanceEventMethod(), getCallOptions()), + request, + responseObserver); + } } /** @@ -1255,6 +1673,58 @@ public com.google.longrunning.Operation updateNode( getChannel(), getUpdateNodeMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Lists queued resources.
+     * 
+ */ + public com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse listQueuedResources( + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListQueuedResourcesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a queued resource.
+     * 
+ */ + public com.google.cloud.tpu.v2alpha1.QueuedResource getQueuedResource( + com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetQueuedResourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a QueuedResource TPU instance.
+     * 
+ */ + public com.google.longrunning.Operation createQueuedResource( + com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateQueuedResourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a QueuedResource TPU instance.
+     * 
+ */ + public com.google.longrunning.Operation deleteQueuedResource( + com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteQueuedResourceMethod(), getCallOptions(), request); + } + /** * * @@ -1332,6 +1802,19 @@ public com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse getGuestAttribut return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getGetGuestAttributesMethod(), getCallOptions(), request); } + + /** + * + * + *
+     * Simulates a maintenance event.
+     * 
+ */ + public com.google.longrunning.Operation simulateMaintenanceEvent( + com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSimulateMaintenanceEventMethod(), getCallOptions(), request); + } } /** @@ -1444,6 +1927,60 @@ protected TpuFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callO getChannel().newCall(getUpdateNodeMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Lists queued resources.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse> + listQueuedResources(com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListQueuedResourcesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a queued resource.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.tpu.v2alpha1.QueuedResource> + getQueuedResource(com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetQueuedResourceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a QueuedResource TPU instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createQueuedResource(com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateQueuedResourceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a QueuedResource TPU instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteQueuedResource(com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteQueuedResourceMethod(), getCallOptions()), request); + } + /** * * @@ -1528,6 +2065,20 @@ protected TpuFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callO return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getGetGuestAttributesMethod(), getCallOptions()), request); } + + /** + * + * + *
+     * Simulates a maintenance event.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + simulateMaintenanceEvent( + com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSimulateMaintenanceEventMethod(), getCallOptions()), request); + } } private static final int METHODID_LIST_NODES = 0; @@ -1537,12 +2088,17 @@ protected TpuFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callO 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 int METHODID_LIST_QUEUED_RESOURCES = 7; + private static final int METHODID_GET_QUEUED_RESOURCE = 8; + private static final int METHODID_CREATE_QUEUED_RESOURCE = 9; + private static final int METHODID_DELETE_QUEUED_RESOURCE = 10; + private static final int METHODID_GENERATE_SERVICE_IDENTITY = 11; + private static final int METHODID_LIST_ACCELERATOR_TYPES = 12; + private static final int METHODID_GET_ACCELERATOR_TYPE = 13; + private static final int METHODID_LIST_RUNTIME_VERSIONS = 14; + private static final int METHODID_GET_RUNTIME_VERSION = 15; + private static final int METHODID_GET_GUEST_ATTRIBUTES = 16; + private static final int METHODID_SIMULATE_MAINTENANCE_EVENT = 17; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -1597,6 +2153,29 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.tpu.v2alpha1.UpdateNodeRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_LIST_QUEUED_RESOURCES: + serviceImpl.listQueuedResources( + (com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse>) + responseObserver); + break; + case METHODID_GET_QUEUED_RESOURCE: + serviceImpl.getQueuedResource( + (com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_QUEUED_RESOURCE: + serviceImpl.createQueuedResource( + (com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_QUEUED_RESOURCE: + serviceImpl.deleteQueuedResource( + (com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_GENERATE_SERVICE_IDENTITY: serviceImpl.generateServiceIdentity( (com.google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest) request, @@ -1637,6 +2216,11 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv com.google.cloud.tpu.v2alpha1.GetGuestAttributesResponse>) responseObserver); break; + case METHODID_SIMULATE_MAINTENANCE_EVENT: + serviceImpl.simulateMaintenanceEvent( + (com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; default: throw new AssertionError(); } @@ -1706,12 +2290,17 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getStopNodeMethod()) .addMethod(getStartNodeMethod()) .addMethod(getUpdateNodeMethod()) + .addMethod(getListQueuedResourcesMethod()) + .addMethod(getGetQueuedResourceMethod()) + .addMethod(getCreateQueuedResourceMethod()) + .addMethod(getDeleteQueuedResourceMethod()) .addMethod(getGenerateServiceIdentityMethod()) .addMethod(getListAcceleratorTypesMethod()) .addMethod(getGetAcceleratorTypeMethod()) .addMethod(getListRuntimeVersionsMethod()) .addMethod(getGetRuntimeVersionMethod()) .addMethod(getGetGuestAttributesMethod()) + .addMethod(getSimulateMaintenanceEventMethod()) .build(); } } diff --git a/java-tpu/pom.xml b/java-tpu/pom.xml index 8cca5d7c0a54..5e80fcc6bf34 100644 --- a/java-tpu/pom.xml +++ b/java-tpu/pom.xml @@ -31,6 +31,16 @@ google-cloud-tpu 2.8.0-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-tpu-v2 + 2.8.0-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-tpu-v2 + 2.8.0-SNAPSHOT + com.google.api.grpc proto-google-cloud-tpu-v2alpha1 @@ -58,8 +68,10 @@ google-cloud-tpu grpc-google-cloud-tpu-v1 grpc-google-cloud-tpu-v2alpha1 + grpc-google-cloud-tpu-v2 proto-google-cloud-tpu-v1 proto-google-cloud-tpu-v2alpha1 + proto-google-cloud-tpu-v2 google-cloud-tpu-bom diff --git a/java-tpu/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/Node.java b/java-tpu/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/Node.java index 637e0ea263ee..e696bff77a4b 100644 --- a/java-tpu/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/Node.java +++ b/java-tpu/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/Node.java @@ -125,7 +125,7 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * TPU node has been created and is fully usable.
+     * TPU node has been created.
      * 
* * READY = 2; @@ -280,7 +280,7 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * TPU node has been created and is fully usable.
+     * TPU node has been created.
      * 
* * READY = 2; diff --git a/java-tpu/proto-google-cloud-tpu-v1/src/main/proto/google/cloud/tpu/v1/cloud_tpu.proto b/java-tpu/proto-google-cloud-tpu-v1/src/main/proto/google/cloud/tpu/v1/cloud_tpu.proto index 08e83550b1f7..c2acf92f4397 100644 --- a/java-tpu/proto-google-cloud-tpu-v1/src/main/proto/google/cloud/tpu/v1/cloud_tpu.proto +++ b/java-tpu/proto-google-cloud-tpu-v1/src/main/proto/google/cloud/tpu/v1/cloud_tpu.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. @@ -88,7 +88,7 @@ service Tpu { }; } - // Stops a node. + // Stops a node, this operation is only available with single TPU nodes. rpc StopNode(StopNodeRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/nodes/*}:stop" @@ -178,7 +178,7 @@ message Node { // TPU node is being created. CREATING = 1; - // TPU node has been created and is fully usable. + // TPU node has been created. READY = 2; // TPU node is restarting. @@ -550,11 +550,6 @@ message ListAcceleratorTypesResponse { 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. diff --git a/java-tpu/proto-google-cloud-tpu-v2/clirr-ignored-differences.xml b/java-tpu/proto-google-cloud-tpu-v2/clirr-ignored-differences.xml new file mode 100644 index 000000000000..1e9a54d294fe --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/tpu/v2/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/tpu/v2/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/tpu/v2/*OrBuilder + boolean has*(*) + + diff --git a/java-tpu/proto-google-cloud-tpu-v2/pom.xml b/java-tpu/proto-google-cloud-tpu-v2/pom.xml new file mode 100644 index 000000000000..5d44dccb68df --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-tpu-v2 + 2.8.0-SNAPSHOT + proto-google-cloud-tpu-v2 + Proto library for google-cloud-tpu + + com.google.cloud + google-cloud-tpu-parent + 2.8.0-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AcceleratorType.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AcceleratorType.java new file mode 100644 index 000000000000..f3016f370d7e --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AcceleratorType.java @@ -0,0 +1,791 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * A accelerator type that a Node can be configured with.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.AcceleratorType} + */ +public final class AcceleratorType extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_AcceleratorType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_AcceleratorType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.AcceleratorType.class, + com.google.cloud.tpu.v2.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_); + } + getUnknownFields().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 += getUnknownFields().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.v2.AcceleratorType)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.AcceleratorType other = (com.google.cloud.tpu.v2.AcceleratorType) obj; + + if (!getName().equals(other.getName())) return false; + if (!getType().equals(other.getType())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.AcceleratorType parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.AcceleratorType parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.AcceleratorType parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.AcceleratorType parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.AcceleratorType parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.AcceleratorType} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.AcceleratorType) + com.google.cloud.tpu.v2.AcceleratorTypeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_AcceleratorType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_AcceleratorType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.AcceleratorType.class, + com.google.cloud.tpu.v2.AcceleratorType.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.AcceleratorType.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_AcceleratorType_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.AcceleratorType getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.AcceleratorType.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.AcceleratorType build() { + com.google.cloud.tpu.v2.AcceleratorType result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.AcceleratorType buildPartial() { + com.google.cloud.tpu.v2.AcceleratorType result = + new com.google.cloud.tpu.v2.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.v2.AcceleratorType) { + return mergeFrom((com.google.cloud.tpu.v2.AcceleratorType) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.AcceleratorType other) { + if (other == com.google.cloud.tpu.v2.AcceleratorType.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + type_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.AcceleratorType) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.AcceleratorType) + private static final com.google.cloud.tpu.v2.AcceleratorType DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.AcceleratorType(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.AcceleratorType getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AcceleratorTypeName.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AcceleratorTypeName.java new file mode 100644 index 000000000000..0bfd92c8219c --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/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.v2; + +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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AcceleratorTypeOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AcceleratorTypeOrBuilder.java new file mode 100644 index 000000000000..08972a10a2fe --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AcceleratorTypeOrBuilder.java @@ -0,0 +1,75 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface AcceleratorTypeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AccessConfig.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AccessConfig.java new file mode 100644 index 000000000000..d7eaf93eca96 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AccessConfig.java @@ -0,0 +1,611 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * An access config attached to the TPU worker.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.AccessConfig} + */ +public final class AccessConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_AccessConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_AccessConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.AccessConfig.class, + com.google.cloud.tpu.v2.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_); + } + getUnknownFields().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 += getUnknownFields().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.v2.AccessConfig)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.AccessConfig other = (com.google.cloud.tpu.v2.AccessConfig) obj; + + if (!getExternalIp().equals(other.getExternalIp())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.AccessConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.AccessConfig parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.AccessConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.AccessConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.AccessConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.AccessConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.AccessConfig) + com.google.cloud.tpu.v2.AccessConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_AccessConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_AccessConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.AccessConfig.class, + com.google.cloud.tpu.v2.AccessConfig.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.AccessConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_AccessConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.AccessConfig getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.AccessConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.AccessConfig build() { + com.google.cloud.tpu.v2.AccessConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.AccessConfig buildPartial() { + com.google.cloud.tpu.v2.AccessConfig result = new com.google.cloud.tpu.v2.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.v2.AccessConfig) { + return mergeFrom((com.google.cloud.tpu.v2.AccessConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.AccessConfig other) { + if (other == com.google.cloud.tpu.v2.AccessConfig.getDefaultInstance()) return this; + if (!other.getExternalIp().isEmpty()) { + externalIp_ = other.externalIp_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + externalIp_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.AccessConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.AccessConfig) + private static final com.google.cloud.tpu.v2.AccessConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.AccessConfig(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.AccessConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AccessConfigOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AccessConfigOrBuilder.java new file mode 100644 index 000000000000..c6fca0ebe20c --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AccessConfigOrBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface AccessConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AttachedDisk.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AttachedDisk.java new file mode 100644 index 000000000000..6ec754585221 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AttachedDisk.java @@ -0,0 +1,944 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * A node-attached disk resource.
+ * Next ID: 8;
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.AttachedDisk} + */ +public final class AttachedDisk extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_AttachedDisk_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_AttachedDisk_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.AttachedDisk.class, + com.google.cloud.tpu.v2.AttachedDisk.Builder.class); + } + + /** + * + * + *
+   * The different mode of the attached disk.
+   * 
+ * + * Protobuf enum {@code google.cloud.tpu.v2.AttachedDisk.DiskMode} + */ + public enum DiskMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The disk mode is not known/set.
+     * 
+ * + * DISK_MODE_UNSPECIFIED = 0; + */ + DISK_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Attaches the disk in read-write mode. Only one TPU node can attach a disk
+     * in read-write mode at a time.
+     * 
+ * + * READ_WRITE = 1; + */ + READ_WRITE(1), + /** + * + * + *
+     * Attaches the disk in read-only mode. Multiple TPU nodes can attach
+     * a disk in read-only mode at a time.
+     * 
+ * + * READ_ONLY = 2; + */ + READ_ONLY(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The disk mode is not known/set.
+     * 
+ * + * DISK_MODE_UNSPECIFIED = 0; + */ + public static final int DISK_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Attaches the disk in read-write mode. Only one TPU node can attach a disk
+     * in read-write mode at a time.
+     * 
+ * + * READ_WRITE = 1; + */ + public static final int READ_WRITE_VALUE = 1; + /** + * + * + *
+     * Attaches the disk in read-only mode. Multiple TPU nodes can attach
+     * a disk in read-only mode at a time.
+     * 
+ * + * READ_ONLY = 2; + */ + public static final int READ_ONLY_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DiskMode valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static DiskMode forNumber(int value) { + switch (value) { + case 0: + return DISK_MODE_UNSPECIFIED; + case 1: + return READ_WRITE; + case 2: + return READ_ONLY; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public DiskMode findValueByNumber(int number) { + return DiskMode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.AttachedDisk.DiskMode mode = 4; + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.tpu.v2.AttachedDisk.DiskMode getMode() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v2.AttachedDisk.DiskMode result = + com.google.cloud.tpu.v2.AttachedDisk.DiskMode.valueOf(mode_); + return result == null ? com.google.cloud.tpu.v2.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.v2.AttachedDisk.DiskMode.DISK_MODE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, mode_); + } + getUnknownFields().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.v2.AttachedDisk.DiskMode.DISK_MODE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, mode_); + } + size += getUnknownFields().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.v2.AttachedDisk)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.AttachedDisk other = (com.google.cloud.tpu.v2.AttachedDisk) obj; + + if (!getSourceDisk().equals(other.getSourceDisk())) return false; + if (mode_ != other.mode_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.AttachedDisk parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.AttachedDisk parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.AttachedDisk parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.AttachedDisk parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.AttachedDisk parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.AttachedDisk} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.AttachedDisk) + com.google.cloud.tpu.v2.AttachedDiskOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_AttachedDisk_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_AttachedDisk_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.AttachedDisk.class, + com.google.cloud.tpu.v2.AttachedDisk.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.AttachedDisk.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_AttachedDisk_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.AttachedDisk getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.AttachedDisk.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.AttachedDisk build() { + com.google.cloud.tpu.v2.AttachedDisk result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.AttachedDisk buildPartial() { + com.google.cloud.tpu.v2.AttachedDisk result = new com.google.cloud.tpu.v2.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.v2.AttachedDisk) { + return mergeFrom((com.google.cloud.tpu.v2.AttachedDisk) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.AttachedDisk other) { + if (other == com.google.cloud.tpu.v2.AttachedDisk.getDefaultInstance()) return this; + if (!other.getSourceDisk().isEmpty()) { + sourceDisk_ = other.sourceDisk_; + onChanged(); + } + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 26: + { + sourceDisk_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 32: + { + mode_ = input.readEnum(); + + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.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.v2.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.v2.AttachedDisk.DiskMode mode = 4; + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.tpu.v2.AttachedDisk.DiskMode getMode() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v2.AttachedDisk.DiskMode result = + com.google.cloud.tpu.v2.AttachedDisk.DiskMode.valueOf(mode_); + return result == null ? com.google.cloud.tpu.v2.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.v2.AttachedDisk.DiskMode mode = 4; + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode(com.google.cloud.tpu.v2.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.v2.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.v2.AttachedDisk) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.AttachedDisk) + private static final com.google.cloud.tpu.v2.AttachedDisk DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.AttachedDisk(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.AttachedDisk getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AttachedDiskOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AttachedDiskOrBuilder.java new file mode 100644 index 000000000000..013905493c57 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/AttachedDiskOrBuilder.java @@ -0,0 +1,81 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface AttachedDiskOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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.v2.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.v2.AttachedDisk.DiskMode mode = 4; + * + * @return The mode. + */ + com.google.cloud.tpu.v2.AttachedDisk.DiskMode getMode(); +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/CloudTpuProto.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/CloudTpuProto.java new file mode 100644 index 000000000000..ea0bce53b174 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/CloudTpuProto.java @@ -0,0 +1,733 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +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_v2_GuestAttributes_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_GuestAttributes_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_GuestAttributesValue_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_GuestAttributesValue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_GuestAttributesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_GuestAttributesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_AttachedDisk_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_AttachedDisk_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_SchedulingConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_SchedulingConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_NetworkEndpoint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_NetworkEndpoint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_AccessConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_AccessConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_NetworkConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_NetworkConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_ServiceAccount_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_ServiceAccount_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_Node_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_Node_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_Node_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_Node_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_Node_MetadataEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_Node_MetadataEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_ListNodesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_ListNodesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_ListNodesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_ListNodesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_GetNodeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_GetNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_CreateNodeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_CreateNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_DeleteNodeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_DeleteNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_StopNodeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_StopNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_StartNodeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_StartNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_UpdateNodeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_UpdateNodeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_ServiceIdentity_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_ServiceIdentity_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_GenerateServiceIdentityRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_GenerateServiceIdentityRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_GenerateServiceIdentityResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_GenerateServiceIdentityResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_AcceleratorType_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_AcceleratorType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_GetAcceleratorTypeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_GetAcceleratorTypeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_ListAcceleratorTypesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_ListAcceleratorTypesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_ListAcceleratorTypesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_ListAcceleratorTypesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_RuntimeVersion_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_RuntimeVersion_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_GetRuntimeVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_GetRuntimeVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_ListRuntimeVersionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_ListRuntimeVersionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_ListRuntimeVersionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_ListRuntimeVersionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_OperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_Symptom_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_Symptom_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_GetGuestAttributesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_GetGuestAttributesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_GetGuestAttributesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_GetGuestAttributesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2_ShieldedInstanceConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2_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/v2/cloud_tpu.proto\022\023g" + + "oogle.cloud.tpu.v2\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 google/protobuf/field_mask.p" + + "roto\032\037google/protobuf/timestamp.proto\"e\n" + + "\017GuestAttributes\022\022\n\nquery_path\030\001 \001(\t\022>\n\013" + + "query_value\030\002 \001(\0132).google.cloud.tpu.v2." + + "GuestAttributesValue\"P\n\024GuestAttributesV" + + "alue\0228\n\005items\030\001 \003(\0132).google.cloud.tpu.v" + + "2.GuestAttributesEntry\"E\n\024GuestAttribute" + + "sEntry\022\021\n\tnamespace\030\001 \001(\t\022\013\n\003key\030\002 \001(\t\022\r" + + "\n\005value\030\003 \001(\t\"\243\001\n\014AttachedDisk\022\023\n\013source" + + "_disk\030\003 \001(\t\0228\n\004mode\030\004 \001(\0162*.google.cloud" + + ".tpu.v2.AttachedDisk.DiskMode\"D\n\010DiskMod" + + "e\022\031\n\025DISK_MODE_UNSPECIFIED\020\000\022\016\n\nREAD_WRI" + + "TE\020\001\022\r\n\tREAD_ONLY\020\002\"9\n\020SchedulingConfig\022" + + "\023\n\013preemptible\030\001 \001(\010\022\020\n\010reserved\030\002 \001(\010\"m" + + "\n\017NetworkEndpoint\022\022\n\nip_address\030\001 \001(\t\022\014\n" + + "\004port\030\002 \001(\005\0228\n\raccess_config\030\005 \001(\0132!.goo" + + "gle.cloud.tpu.v2.AccessConfig\"(\n\014AccessC" + + "onfig\022\030\n\013external_ip\030\001 \001(\tB\003\340A\003\"i\n\rNetwo" + + "rkConfig\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\022\026\n\016ca" + + "n_ip_forward\030\004 \001(\010\".\n\016ServiceAccount\022\r\n\005" + + "email\030\001 \001(\t\022\r\n\005scope\030\002 \003(\t\"\260\014\n\004Node\022\024\n\004n" + + "ame\030\001 \001(\tB\006\340A\003\340A\005\022\023\n\013description\030\003 \001(\t\022\035" + + "\n\020accelerator_type\030\005 \001(\tB\003\340A\002\0223\n\005state\030\t" + + " \001(\0162\037.google.cloud.tpu.v2.Node.StateB\003\340" + + "A\003\022\037\n\022health_description\030\n \001(\tB\003\340A\003\022\034\n\017r" + + "untime_version\030\013 \001(\tB\003\340A\002\022:\n\016network_con" + + "fig\030$ \001(\0132\".google.cloud.tpu.v2.NetworkC" + + "onfig\022\022\n\ncidr_block\030\r \001(\t\022<\n\017service_acc" + + "ount\030% \001(\0132#.google.cloud.tpu.v2.Service" + + "Account\0224\n\013create_time\030\020 \001(\0132\032.google.pr" + + "otobuf.TimestampB\003\340A\003\022@\n\021scheduling_conf" + + "ig\030\021 \001(\0132%.google.cloud.tpu.v2.Schedulin" + + "gConfig\022D\n\021network_endpoints\030\025 \003(\0132$.goo" + + "gle.cloud.tpu.v2.NetworkEndpointB\003\340A\003\0220\n" + + "\006health\030\026 \001(\0162 .google.cloud.tpu.v2.Node" + + ".Health\0225\n\006labels\030\030 \003(\0132%.google.cloud.t" + + "pu.v2.Node.LabelsEntry\0229\n\010metadata\030\" \003(\013" + + "2\'.google.cloud.tpu.v2.Node.MetadataEntr" + + "y\022\014\n\004tags\030( \003(\t\022\017\n\002id\030! \001(\003B\003\340A\003\0225\n\ndata" + + "_disks\030) \003(\0132!.google.cloud.tpu.v2.Attac" + + "hedDisk\022>\n\013api_version\030& \001(\0162$.google.cl" + + "oud.tpu.v2.Node.ApiVersionB\003\340A\003\0223\n\010sympt" + + "oms\030\' \003(\0132\034.google.cloud.tpu.v2.SymptomB" + + "\003\340A\003\022M\n\030shielded_instance_config\030- \001(\0132+" + + ".google.cloud.tpu.v2.ShieldedInstanceCon" + + "fig\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value" + + "\030\002 \001(\t:\0028\001\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t" + + "\022\r\n\005value\030\002 \001(\t:\0028\001\"\341\001\n\005State\022\025\n\021STATE_U" + + "NSPECIFIED\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\010DELETING" + + "\020\005\022\r\n\tREPAIRING\020\006\022\013\n\007STOPPED\020\010\022\014\n\010STOPPI" + + "NG\020\t\022\014\n\010STARTING\020\n\022\r\n\tPREEMPTED\020\013\022\016\n\nTER" + + "MINATED\020\014\022\n\n\006HIDING\020\r\022\n\n\006HIDDEN\020\016\022\014\n\010UNH" + + "IDING\020\017\"o\n\006Health\022\026\n\022HEALTH_UNSPECIFIED\020" + + "\000\022\013\n\007HEALTHY\020\001\022\013\n\007TIMEOUT\020\003\022\030\n\024UNHEALTHY" + + "_TENSORFLOW\020\004\022\031\n\025UNHEALTHY_MAINTENANCE\020\005" + + "\"W\n\nApiVersion\022\033\n\027API_VERSION_UNSPECIFIE" + + "D\020\000\022\r\n\tV1_ALPHA1\020\001\022\006\n\002V1\020\002\022\r\n\tV2_ALPHA1\020" + + "\003\022\006\n\002V2\020\004:R\352AO\n\027tpu.googleapis.com/Node\022" + + "4projects/{project}/locations/{location}" + + "/nodes/{node}\"j\n\020ListNodesRequest\022/\n\006par" + + "ent\030\001 \001(\tB\037\340A\002\372A\031\022\027tpu.googleapis.com/No" + + "de\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." + + "google.cloud.tpu.v2.Node\022\027\n\017next_page_to" + + "ken\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"?\n\016GetNod" + + "eRequest\022-\n\004name\030\001 \001(\tB\037\340A\002\372A\031\n\027tpu.goog" + + "leapis.com/Node\"\215\001\n\021CreateNodeRequest\0229\n" + + "\006parent\030\001 \001(\tB)\340A\002\372A#\n!locations.googlea" + + "pis.com/Location\022\017\n\007node_id\030\002 \001(\t\022,\n\004nod" + + "e\030\003 \001(\0132\031.google.cloud.tpu.v2.NodeB\003\340A\002\"" + + "B\n\021DeleteNodeRequest\022-\n\004name\030\001 \001(\tB\037\340A\002\372" + + "A\031\n\027tpu.googleapis.com/Node\"@\n\017StopNodeR" + + "equest\022-\n\004name\030\001 \001(\tB\037\340A\002\372A\031\n\027tpu.google" + + "apis.com/Node\"A\n\020StartNodeRequest\022-\n\004nam" + + "e\030\001 \001(\tB\037\340A\002\372A\031\n\027tpu.googleapis.com/Node" + + "\"w\n\021UpdateNodeRequest\0224\n\013update_mask\030\001 \001" + + "(\0132\032.google.protobuf.FieldMaskB\003\340A\002\022,\n\004n" + + "ode\030\002 \001(\0132\031.google.cloud.tpu.v2.NodeB\003\340A" + + "\002\" \n\017ServiceIdentity\022\r\n\005email\030\001 \001(\t\"[\n\036G" + + "enerateServiceIdentityRequest\0229\n\006parent\030" + + "\001 \001(\tB)\340A\002\372A#\n!locations.googleapis.com/" + + "Location\"Y\n\037GenerateServiceIdentityRespo" + + "nse\0226\n\010identity\030\001 \001(\0132$.google.cloud.tpu" + + ".v2.ServiceIdentity\"\243\001\n\017AcceleratorType\022" + + "\014\n\004name\030\001 \001(\t\022\014\n\004type\030\002 \001(\t:t\352Aq\n\"tpu.go" + + "ogleapis.com/AcceleratorType\022Kprojects/{" + + "project}/locations/{location}/accelerato" + + "rTypes/{accelerator_type}\"U\n\031GetAccelera" + + "torTypeRequest\0228\n\004name\030\001 \001(\tB*\340A\002\372A$\n\"tp" + + "u.googleapis.com/AcceleratorType\"\242\001\n\033Lis" + + "tAcceleratorTypesRequest\022:\n\006parent\030\001 \001(\t" + + "B*\340A\002\372A$\022\"tpu.googleapis.com/Accelerator" + + "Type\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\034ListAcceleratorTypesResponse\022?\n\021accele" + + "rator_types\030\001 \003(\0132$.google.cloud.tpu.v2." + + "AcceleratorType\022\027\n\017next_page_token\030\002 \001(\t" + + "\022\023\n\013unreachable\030\003 \003(\t\"\242\001\n\016RuntimeVersion" + + "\022\014\n\004name\030\001 \001(\t\022\017\n\007version\030\002 \001(\t:q\352An\n!tp" + + "u.googleapis.com/RuntimeVersion\022Iproject" + + "s/{project}/locations/{location}/runtime" + + "Versions/{runtime_version}\"S\n\030GetRuntime" + + "VersionRequest\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n!tp" + + "u.googleapis.com/RuntimeVersion\"\240\001\n\032List" + + "RuntimeVersionsRequest\0229\n\006parent\030\001 \001(\tB)" + + "\340A\002\372A#\022!tpu.googleapis.com/RuntimeVersio" + + "n\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\"\212\001\n\033L" + + "istRuntimeVersionsResponse\022=\n\020runtime_ve" + + "rsions\030\001 \003(\0132#.google.cloud.tpu.v2.Runti" + + "meVersion\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.v2.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" + + "\"r\n\031GetGuestAttributesRequest\022-\n\004name\030\001 " + + "\001(\tB\037\340A\002\372A\031\n\027tpu.googleapis.com/Node\022\022\n\n" + + "query_path\030\002 \001(\t\022\022\n\nworker_ids\030\003 \003(\t\"\\\n\032" + + "GetGuestAttributesResponse\022>\n\020guest_attr" + + "ibutes\030\001 \003(\0132$.google.cloud.tpu.v2.Guest" + + "Attributes\"4\n\026ShieldedInstanceConfig\022\032\n\022" + + "enable_secure_boot\030\001 \001(\0102\370\022\n\003Tpu\022\226\001\n\tLis" + + "tNodes\022%.google.cloud.tpu.v2.ListNodesRe" + + "quest\032&.google.cloud.tpu.v2.ListNodesRes" + + "ponse\":\202\323\344\223\002+\022)/v2/{parent=projects/*/lo" + + "cations/*}/nodes\332A\006parent\022\203\001\n\007GetNode\022#." + + "google.cloud.tpu.v2.GetNodeRequest\032\031.goo" + + "gle.cloud.tpu.v2.Node\"8\202\323\344\223\002+\022)/v2/{name" + + "=projects/*/locations/*/nodes/*}\332A\004name\022" + + "\276\001\n\nCreateNode\022&.google.cloud.tpu.v2.Cre" + + "ateNodeRequest\032\035.google.longrunning.Oper" + + "ation\"i\202\323\344\223\0021\")/v2/{parent=projects/*/lo" + + "cations/*}/nodes:\004node\332A\023parent,node,nod" + + "e_id\312A\031\n\004Node\022\021OperationMetadata\022\272\001\n\nDel" + + "eteNode\022&.google.cloud.tpu.v2.DeleteNode" + + "Request\032\035.google.longrunning.Operation\"e" + + "\202\323\344\223\002+*)/v2/{name=projects/*/locations/*" + + "/nodes/*}\332A\004name\312A*\n\025google.protobuf.Emp" + + "ty\022\021OperationMetadata\022\246\001\n\010StopNode\022$.goo" + + "gle.cloud.tpu.v2.StopNodeRequest\032\035.googl" + + "e.longrunning.Operation\"U\202\323\344\223\0023\"./v2/{na" + + "me=projects/*/locations/*/nodes/*}:stop:" + + "\001*\312A\031\n\004Node\022\021OperationMetadata\022\251\001\n\tStart" + + "Node\022%.google.cloud.tpu.v2.StartNodeRequ" + + "est\032\035.google.longrunning.Operation\"V\202\323\344\223" + + "\0024\"//v2/{name=projects/*/locations/*/nod" + + "es/*}:start:\001*\312A\031\n\004Node\022\021OperationMetada" + + "ta\022\300\001\n\nUpdateNode\022&.google.cloud.tpu.v2." + + "UpdateNodeRequest\032\035.google.longrunning.O" + + "peration\"k\202\323\344\223\00262./v2/{node.name=project" + + "s/*/locations/*/nodes/*}:\004node\332A\020node,up" + + "date_mask\312A\031\n\004Node\022\021OperationMetadata\022\314\001" + + "\n\027GenerateServiceIdentity\0223.google.cloud" + + ".tpu.v2.GenerateServiceIdentityRequest\0324" + + ".google.cloud.tpu.v2.GenerateServiceIden" + + "tityResponse\"F\202\323\344\223\002@\";/v2/{parent=projec" + + "ts/*/locations/*}:generateServiceIdentit" + + "y:\001*\022\302\001\n\024ListAcceleratorTypes\0220.google.c" + + "loud.tpu.v2.ListAcceleratorTypesRequest\032" + + "1.google.cloud.tpu.v2.ListAcceleratorTyp" + + "esResponse\"E\202\323\344\223\0026\0224/v2/{parent=projects" + + "/*/locations/*}/acceleratorTypes\332A\006paren" + + "t\022\257\001\n\022GetAcceleratorType\022..google.cloud." + + "tpu.v2.GetAcceleratorTypeRequest\032$.googl" + + "e.cloud.tpu.v2.AcceleratorType\"C\202\323\344\223\0026\0224" + + "/v2/{name=projects/*/locations/*/acceler" + + "atorTypes/*}\332A\004name\022\276\001\n\023ListRuntimeVersi" + + "ons\022/.google.cloud.tpu.v2.ListRuntimeVer" + + "sionsRequest\0320.google.cloud.tpu.v2.ListR" + + "untimeVersionsResponse\"D\202\323\344\223\0025\0223/v2/{par" + + "ent=projects/*/locations/*}/runtimeVersi" + + "ons\332A\006parent\022\253\001\n\021GetRuntimeVersion\022-.goo" + + "gle.cloud.tpu.v2.GetRuntimeVersionReques" + + "t\032#.google.cloud.tpu.v2.RuntimeVersion\"B" + + "\202\323\344\223\0025\0223/v2/{name=projects/*/locations/*" + + "/runtimeVersions/*}\332A\004name\022\276\001\n\022GetGuestA" + + "ttributes\022..google.cloud.tpu.v2.GetGuest" + + "AttributesRequest\032/.google.cloud.tpu.v2." + + "GetGuestAttributesResponse\"G\202\323\344\223\002A\" + * Request for [CreateNode][google.cloud.tpu.v2.Tpu.CreateNode]. + * + * + * Protobuf type {@code google.cloud.tpu.v2.CreateNodeRequest} + */ +public final class CreateNodeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_CreateNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_CreateNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.CreateNodeRequest.class, + com.google.cloud.tpu.v2.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.v2.Node node_; + /** + * + * + *
+   * Required. The node.
+   * 
+ * + * .google.cloud.tpu.v2.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.v2.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The node. + */ + @java.lang.Override + public com.google.cloud.tpu.v2.Node getNode() { + return node_ == null ? com.google.cloud.tpu.v2.Node.getDefaultInstance() : node_; + } + /** + * + * + *
+   * Required. The node.
+   * 
+ * + * .google.cloud.tpu.v2.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.tpu.v2.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()); + } + getUnknownFields().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 += getUnknownFields().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.v2.CreateNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.CreateNodeRequest other = + (com.google.cloud.tpu.v2.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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.CreateNodeRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.CreateNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.CreateNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.CreateNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.CreateNodeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.Tpu.CreateNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.CreateNodeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.CreateNodeRequest) + com.google.cloud.tpu.v2.CreateNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_CreateNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_CreateNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.CreateNodeRequest.class, + com.google.cloud.tpu.v2.CreateNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.CreateNodeRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_CreateNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.CreateNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.CreateNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.CreateNodeRequest build() { + com.google.cloud.tpu.v2.CreateNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.CreateNodeRequest buildPartial() { + com.google.cloud.tpu.v2.CreateNodeRequest result = + new com.google.cloud.tpu.v2.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.v2.CreateNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v2.CreateNodeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.CreateNodeRequest other) { + if (other == com.google.cloud.tpu.v2.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.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + nodeId_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + input.readMessage(getNodeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.Node node_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.Node, + com.google.cloud.tpu.v2.Node.Builder, + com.google.cloud.tpu.v2.NodeOrBuilder> + nodeBuilder_; + /** + * + * + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v2.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.v2.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The node. + */ + public com.google.cloud.tpu.v2.Node getNode() { + if (nodeBuilder_ == null) { + return node_ == null ? com.google.cloud.tpu.v2.Node.getDefaultInstance() : node_; + } else { + return nodeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v2.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setNode(com.google.cloud.tpu.v2.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.v2.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setNode(com.google.cloud.tpu.v2.Node.Builder builderForValue) { + if (nodeBuilder_ == null) { + node_ = builderForValue.build(); + onChanged(); + } else { + nodeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v2.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeNode(com.google.cloud.tpu.v2.Node value) { + if (nodeBuilder_ == null) { + if (node_ != null) { + node_ = com.google.cloud.tpu.v2.Node.newBuilder(node_).mergeFrom(value).buildPartial(); + } else { + node_ = value; + } + onChanged(); + } else { + nodeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v2.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.v2.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.tpu.v2.Node.Builder getNodeBuilder() { + + onChanged(); + return getNodeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v2.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.tpu.v2.NodeOrBuilder getNodeOrBuilder() { + if (nodeBuilder_ != null) { + return nodeBuilder_.getMessageOrBuilder(); + } else { + return node_ == null ? com.google.cloud.tpu.v2.Node.getDefaultInstance() : node_; + } + } + /** + * + * + *
+     * Required. The node.
+     * 
+ * + * .google.cloud.tpu.v2.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.Node, + com.google.cloud.tpu.v2.Node.Builder, + com.google.cloud.tpu.v2.NodeOrBuilder> + getNodeFieldBuilder() { + if (nodeBuilder_ == null) { + nodeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.Node, + com.google.cloud.tpu.v2.Node.Builder, + com.google.cloud.tpu.v2.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.v2.CreateNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.CreateNodeRequest) + private static final com.google.cloud.tpu.v2.CreateNodeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.CreateNodeRequest(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.CreateNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/CreateNodeRequestOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/CreateNodeRequestOrBuilder.java new file mode 100644 index 000000000000..f3894c0f6a26 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/CreateNodeRequestOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface CreateNodeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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.v2.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the node field is set. + */ + boolean hasNode(); + /** + * + * + *
+   * Required. The node.
+   * 
+ * + * .google.cloud.tpu.v2.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The node. + */ + com.google.cloud.tpu.v2.Node getNode(); + /** + * + * + *
+   * Required. The node.
+   * 
+ * + * .google.cloud.tpu.v2.Node node = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.tpu.v2.NodeOrBuilder getNodeOrBuilder(); +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/DeleteNodeRequest.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/DeleteNodeRequest.java new file mode 100644 index 000000000000..034cd57cc339 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/DeleteNodeRequest.java @@ -0,0 +1,628 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * Request for [DeleteNode][google.cloud.tpu.v2.Tpu.DeleteNode].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.DeleteNodeRequest} + */ +public final class DeleteNodeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_DeleteNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_DeleteNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.DeleteNodeRequest.class, + com.google.cloud.tpu.v2.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_); + } + getUnknownFields().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 += getUnknownFields().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.v2.DeleteNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.DeleteNodeRequest other = + (com.google.cloud.tpu.v2.DeleteNodeRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.DeleteNodeRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.DeleteNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.DeleteNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.DeleteNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.DeleteNodeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.Tpu.DeleteNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.DeleteNodeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.DeleteNodeRequest) + com.google.cloud.tpu.v2.DeleteNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_DeleteNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_DeleteNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.DeleteNodeRequest.class, + com.google.cloud.tpu.v2.DeleteNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.DeleteNodeRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_DeleteNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.DeleteNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.DeleteNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.DeleteNodeRequest build() { + com.google.cloud.tpu.v2.DeleteNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.DeleteNodeRequest buildPartial() { + com.google.cloud.tpu.v2.DeleteNodeRequest result = + new com.google.cloud.tpu.v2.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.v2.DeleteNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v2.DeleteNodeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.DeleteNodeRequest other) { + if (other == com.google.cloud.tpu.v2.DeleteNodeRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.DeleteNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.DeleteNodeRequest) + private static final com.google.cloud.tpu.v2.DeleteNodeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.DeleteNodeRequest(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.DeleteNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/DeleteNodeRequestOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/DeleteNodeRequestOrBuilder.java new file mode 100644 index 000000000000..e146d9dd5bea --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/DeleteNodeRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface DeleteNodeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GenerateServiceIdentityRequest.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GenerateServiceIdentityRequest.java new file mode 100644 index 000000000000..e57334061c7b --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GenerateServiceIdentityRequest.java @@ -0,0 +1,631 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * Request for [GenerateServiceIdentity][google.cloud.tpu.v2.Tpu.GenerateServiceIdentity].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.GenerateServiceIdentityRequest} + */ +public final class GenerateServiceIdentityRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GenerateServiceIdentityRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GenerateServiceIdentityRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.GenerateServiceIdentityRequest.class, + com.google.cloud.tpu.v2.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_); + } + getUnknownFields().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 += getUnknownFields().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.v2.GenerateServiceIdentityRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.GenerateServiceIdentityRequest other = + (com.google.cloud.tpu.v2.GenerateServiceIdentityRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.GenerateServiceIdentityRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GenerateServiceIdentityRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GenerateServiceIdentityRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GenerateServiceIdentityRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.GenerateServiceIdentityRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.Tpu.GenerateServiceIdentity].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.GenerateServiceIdentityRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.GenerateServiceIdentityRequest) + com.google.cloud.tpu.v2.GenerateServiceIdentityRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GenerateServiceIdentityRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GenerateServiceIdentityRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.GenerateServiceIdentityRequest.class, + com.google.cloud.tpu.v2.GenerateServiceIdentityRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.GenerateServiceIdentityRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GenerateServiceIdentityRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GenerateServiceIdentityRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.GenerateServiceIdentityRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GenerateServiceIdentityRequest build() { + com.google.cloud.tpu.v2.GenerateServiceIdentityRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GenerateServiceIdentityRequest buildPartial() { + com.google.cloud.tpu.v2.GenerateServiceIdentityRequest result = + new com.google.cloud.tpu.v2.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.v2.GenerateServiceIdentityRequest) { + return mergeFrom((com.google.cloud.tpu.v2.GenerateServiceIdentityRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.GenerateServiceIdentityRequest other) { + if (other == com.google.cloud.tpu.v2.GenerateServiceIdentityRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.GenerateServiceIdentityRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.GenerateServiceIdentityRequest) + private static final com.google.cloud.tpu.v2.GenerateServiceIdentityRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.GenerateServiceIdentityRequest(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.GenerateServiceIdentityRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GenerateServiceIdentityRequestOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GenerateServiceIdentityRequestOrBuilder.java new file mode 100644 index 000000000000..0de9c57228a2 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GenerateServiceIdentityRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface GenerateServiceIdentityRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GenerateServiceIdentityResponse.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GenerateServiceIdentityResponse.java new file mode 100644 index 000000000000..4b991aadb0a4 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GenerateServiceIdentityResponse.java @@ -0,0 +1,705 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * Response for [GenerateServiceIdentity][google.cloud.tpu.v2.Tpu.GenerateServiceIdentity].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.GenerateServiceIdentityResponse} + */ +public final class GenerateServiceIdentityResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GenerateServiceIdentityResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GenerateServiceIdentityResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.GenerateServiceIdentityResponse.class, + com.google.cloud.tpu.v2.GenerateServiceIdentityResponse.Builder.class); + } + + public static final int IDENTITY_FIELD_NUMBER = 1; + private com.google.cloud.tpu.v2.ServiceIdentity identity_; + /** + * + * + *
+   * ServiceIdentity that was created or retrieved.
+   * 
+ * + * .google.cloud.tpu.v2.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.v2.ServiceIdentity identity = 1; + * + * @return The identity. + */ + @java.lang.Override + public com.google.cloud.tpu.v2.ServiceIdentity getIdentity() { + return identity_ == null + ? com.google.cloud.tpu.v2.ServiceIdentity.getDefaultInstance() + : identity_; + } + /** + * + * + *
+   * ServiceIdentity that was created or retrieved.
+   * 
+ * + * .google.cloud.tpu.v2.ServiceIdentity identity = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2.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()); + } + getUnknownFields().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 += getUnknownFields().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.v2.GenerateServiceIdentityResponse)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.GenerateServiceIdentityResponse other = + (com.google.cloud.tpu.v2.GenerateServiceIdentityResponse) obj; + + if (hasIdentity() != other.hasIdentity()) return false; + if (hasIdentity()) { + if (!getIdentity().equals(other.getIdentity())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.GenerateServiceIdentityResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GenerateServiceIdentityResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GenerateServiceIdentityResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GenerateServiceIdentityResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.GenerateServiceIdentityResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.Tpu.GenerateServiceIdentity].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.GenerateServiceIdentityResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.GenerateServiceIdentityResponse) + com.google.cloud.tpu.v2.GenerateServiceIdentityResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GenerateServiceIdentityResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GenerateServiceIdentityResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.GenerateServiceIdentityResponse.class, + com.google.cloud.tpu.v2.GenerateServiceIdentityResponse.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.GenerateServiceIdentityResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GenerateServiceIdentityResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GenerateServiceIdentityResponse getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.GenerateServiceIdentityResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GenerateServiceIdentityResponse build() { + com.google.cloud.tpu.v2.GenerateServiceIdentityResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GenerateServiceIdentityResponse buildPartial() { + com.google.cloud.tpu.v2.GenerateServiceIdentityResponse result = + new com.google.cloud.tpu.v2.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.v2.GenerateServiceIdentityResponse) { + return mergeFrom((com.google.cloud.tpu.v2.GenerateServiceIdentityResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.GenerateServiceIdentityResponse other) { + if (other == com.google.cloud.tpu.v2.GenerateServiceIdentityResponse.getDefaultInstance()) + return this; + if (other.hasIdentity()) { + mergeIdentity(other.getIdentity()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getIdentityFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private com.google.cloud.tpu.v2.ServiceIdentity identity_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.ServiceIdentity, + com.google.cloud.tpu.v2.ServiceIdentity.Builder, + com.google.cloud.tpu.v2.ServiceIdentityOrBuilder> + identityBuilder_; + /** + * + * + *
+     * ServiceIdentity that was created or retrieved.
+     * 
+ * + * .google.cloud.tpu.v2.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.v2.ServiceIdentity identity = 1; + * + * @return The identity. + */ + public com.google.cloud.tpu.v2.ServiceIdentity getIdentity() { + if (identityBuilder_ == null) { + return identity_ == null + ? com.google.cloud.tpu.v2.ServiceIdentity.getDefaultInstance() + : identity_; + } else { + return identityBuilder_.getMessage(); + } + } + /** + * + * + *
+     * ServiceIdentity that was created or retrieved.
+     * 
+ * + * .google.cloud.tpu.v2.ServiceIdentity identity = 1; + */ + public Builder setIdentity(com.google.cloud.tpu.v2.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.v2.ServiceIdentity identity = 1; + */ + public Builder setIdentity(com.google.cloud.tpu.v2.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.v2.ServiceIdentity identity = 1; + */ + public Builder mergeIdentity(com.google.cloud.tpu.v2.ServiceIdentity value) { + if (identityBuilder_ == null) { + if (identity_ != null) { + identity_ = + com.google.cloud.tpu.v2.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.v2.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.v2.ServiceIdentity identity = 1; + */ + public com.google.cloud.tpu.v2.ServiceIdentity.Builder getIdentityBuilder() { + + onChanged(); + return getIdentityFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * ServiceIdentity that was created or retrieved.
+     * 
+ * + * .google.cloud.tpu.v2.ServiceIdentity identity = 1; + */ + public com.google.cloud.tpu.v2.ServiceIdentityOrBuilder getIdentityOrBuilder() { + if (identityBuilder_ != null) { + return identityBuilder_.getMessageOrBuilder(); + } else { + return identity_ == null + ? com.google.cloud.tpu.v2.ServiceIdentity.getDefaultInstance() + : identity_; + } + } + /** + * + * + *
+     * ServiceIdentity that was created or retrieved.
+     * 
+ * + * .google.cloud.tpu.v2.ServiceIdentity identity = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.ServiceIdentity, + com.google.cloud.tpu.v2.ServiceIdentity.Builder, + com.google.cloud.tpu.v2.ServiceIdentityOrBuilder> + getIdentityFieldBuilder() { + if (identityBuilder_ == null) { + identityBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.ServiceIdentity, + com.google.cloud.tpu.v2.ServiceIdentity.Builder, + com.google.cloud.tpu.v2.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.v2.GenerateServiceIdentityResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.GenerateServiceIdentityResponse) + private static final com.google.cloud.tpu.v2.GenerateServiceIdentityResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.GenerateServiceIdentityResponse(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.GenerateServiceIdentityResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GenerateServiceIdentityResponseOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GenerateServiceIdentityResponseOrBuilder.java new file mode 100644 index 000000000000..420ea7741f40 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GenerateServiceIdentityResponseOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface GenerateServiceIdentityResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.GenerateServiceIdentityResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * ServiceIdentity that was created or retrieved.
+   * 
+ * + * .google.cloud.tpu.v2.ServiceIdentity identity = 1; + * + * @return Whether the identity field is set. + */ + boolean hasIdentity(); + /** + * + * + *
+   * ServiceIdentity that was created or retrieved.
+   * 
+ * + * .google.cloud.tpu.v2.ServiceIdentity identity = 1; + * + * @return The identity. + */ + com.google.cloud.tpu.v2.ServiceIdentity getIdentity(); + /** + * + * + *
+   * ServiceIdentity that was created or retrieved.
+   * 
+ * + * .google.cloud.tpu.v2.ServiceIdentity identity = 1; + */ + com.google.cloud.tpu.v2.ServiceIdentityOrBuilder getIdentityOrBuilder(); +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetAcceleratorTypeRequest.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetAcceleratorTypeRequest.java new file mode 100644 index 000000000000..de6c1a8ee7dd --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetAcceleratorTypeRequest.java @@ -0,0 +1,629 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * Request for [GetAcceleratorType][google.cloud.tpu.v2.Tpu.GetAcceleratorType].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.GetAcceleratorTypeRequest} + */ +public final class GetAcceleratorTypeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetAcceleratorTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetAcceleratorTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.GetAcceleratorTypeRequest.class, + com.google.cloud.tpu.v2.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_); + } + getUnknownFields().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 += getUnknownFields().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.v2.GetAcceleratorTypeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.GetAcceleratorTypeRequest other = + (com.google.cloud.tpu.v2.GetAcceleratorTypeRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.GetAcceleratorTypeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GetAcceleratorTypeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GetAcceleratorTypeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GetAcceleratorTypeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.GetAcceleratorTypeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.Tpu.GetAcceleratorType].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.GetAcceleratorTypeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.GetAcceleratorTypeRequest) + com.google.cloud.tpu.v2.GetAcceleratorTypeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetAcceleratorTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetAcceleratorTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.GetAcceleratorTypeRequest.class, + com.google.cloud.tpu.v2.GetAcceleratorTypeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.GetAcceleratorTypeRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetAcceleratorTypeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GetAcceleratorTypeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.GetAcceleratorTypeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GetAcceleratorTypeRequest build() { + com.google.cloud.tpu.v2.GetAcceleratorTypeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GetAcceleratorTypeRequest buildPartial() { + com.google.cloud.tpu.v2.GetAcceleratorTypeRequest result = + new com.google.cloud.tpu.v2.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.v2.GetAcceleratorTypeRequest) { + return mergeFrom((com.google.cloud.tpu.v2.GetAcceleratorTypeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.GetAcceleratorTypeRequest other) { + if (other == com.google.cloud.tpu.v2.GetAcceleratorTypeRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.GetAcceleratorTypeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.GetAcceleratorTypeRequest) + private static final com.google.cloud.tpu.v2.GetAcceleratorTypeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.GetAcceleratorTypeRequest(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.GetAcceleratorTypeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetAcceleratorTypeRequestOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetAcceleratorTypeRequestOrBuilder.java new file mode 100644 index 000000000000..7c96b0611f1b --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetAcceleratorTypeRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface GetAcceleratorTypeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetGuestAttributesRequest.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetGuestAttributesRequest.java new file mode 100644 index 000000000000..3d2f75e81c1a --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetGuestAttributesRequest.java @@ -0,0 +1,1093 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * Request for [GetGuestAttributes][google.cloud.tpu.v2.Tpu.GetGuestAttributes].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.GetGuestAttributesRequest} + */ +public final class GetGuestAttributesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetGuestAttributesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetGuestAttributesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.GetGuestAttributesRequest.class, + com.google.cloud.tpu.v2.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)); + } + getUnknownFields().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 += getUnknownFields().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.v2.GetGuestAttributesRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.GetGuestAttributesRequest other = + (com.google.cloud.tpu.v2.GetGuestAttributesRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getQueryPath().equals(other.getQueryPath())) return false; + if (!getWorkerIdsList().equals(other.getWorkerIdsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.GetGuestAttributesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GetGuestAttributesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GetGuestAttributesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GetGuestAttributesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.GetGuestAttributesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.Tpu.GetGuestAttributes].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.GetGuestAttributesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.GetGuestAttributesRequest) + com.google.cloud.tpu.v2.GetGuestAttributesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetGuestAttributesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetGuestAttributesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.GetGuestAttributesRequest.class, + com.google.cloud.tpu.v2.GetGuestAttributesRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.GetGuestAttributesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetGuestAttributesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GetGuestAttributesRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.GetGuestAttributesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GetGuestAttributesRequest build() { + com.google.cloud.tpu.v2.GetGuestAttributesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GetGuestAttributesRequest buildPartial() { + com.google.cloud.tpu.v2.GetGuestAttributesRequest result = + new com.google.cloud.tpu.v2.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.v2.GetGuestAttributesRequest) { + return mergeFrom((com.google.cloud.tpu.v2.GetGuestAttributesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.GetGuestAttributesRequest other) { + if (other == com.google.cloud.tpu.v2.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.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + queryPath_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureWorkerIdsIsMutable(); + workerIds_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.GetGuestAttributesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.GetGuestAttributesRequest) + private static final com.google.cloud.tpu.v2.GetGuestAttributesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.GetGuestAttributesRequest(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.GetGuestAttributesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetGuestAttributesRequestOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetGuestAttributesRequestOrBuilder.java new file mode 100644 index 000000000000..40b183f26e4c --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetGuestAttributesRequestOrBuilder.java @@ -0,0 +1,134 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface GetGuestAttributesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetGuestAttributesResponse.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetGuestAttributesResponse.java new file mode 100644 index 000000000000..6741daf273ca --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetGuestAttributesResponse.java @@ -0,0 +1,931 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * Response for [GetGuestAttributes][google.cloud.tpu.v2.Tpu.GetGuestAttributes].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.GetGuestAttributesResponse} + */ +public final class GetGuestAttributesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetGuestAttributesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetGuestAttributesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.GetGuestAttributesResponse.class, + com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.GuestAttributes guest_attributes = 1; + */ + @java.lang.Override + public int getGuestAttributesCount() { + return guestAttributes_.size(); + } + /** + * + * + *
+   * The guest attributes for the TPU workers.
+   * 
+ * + * repeated .google.cloud.tpu.v2.GuestAttributes guest_attributes = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2.GuestAttributes getGuestAttributes(int index) { + return guestAttributes_.get(index); + } + /** + * + * + *
+   * The guest attributes for the TPU workers.
+   * 
+ * + * repeated .google.cloud.tpu.v2.GuestAttributes guest_attributes = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2.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)); + } + getUnknownFields().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 += getUnknownFields().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.v2.GetGuestAttributesResponse)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.GetGuestAttributesResponse other = + (com.google.cloud.tpu.v2.GetGuestAttributesResponse) obj; + + if (!getGuestAttributesList().equals(other.getGuestAttributesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.GetGuestAttributesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GetGuestAttributesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GetGuestAttributesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GetGuestAttributesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.GetGuestAttributesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.Tpu.GetGuestAttributes].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.GetGuestAttributesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.GetGuestAttributesResponse) + com.google.cloud.tpu.v2.GetGuestAttributesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetGuestAttributesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetGuestAttributesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.GetGuestAttributesResponse.class, + com.google.cloud.tpu.v2.GetGuestAttributesResponse.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.GetGuestAttributesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (guestAttributesBuilder_ == null) { + guestAttributes_ = java.util.Collections.emptyList(); + } else { + guestAttributes_ = null; + guestAttributesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetGuestAttributesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GetGuestAttributesResponse getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.GetGuestAttributesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GetGuestAttributesResponse build() { + com.google.cloud.tpu.v2.GetGuestAttributesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GetGuestAttributesResponse buildPartial() { + com.google.cloud.tpu.v2.GetGuestAttributesResponse result = + new com.google.cloud.tpu.v2.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.v2.GetGuestAttributesResponse) { + return mergeFrom((com.google.cloud.tpu.v2.GetGuestAttributesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.GetGuestAttributesResponse other) { + if (other == com.google.cloud.tpu.v2.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.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.tpu.v2.GuestAttributes m = + input.readMessage( + com.google.cloud.tpu.v2.GuestAttributes.parser(), extensionRegistry); + if (guestAttributesBuilder_ == null) { + ensureGuestAttributesIsMutable(); + guestAttributes_.add(m); + } else { + guestAttributesBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.GuestAttributes, + com.google.cloud.tpu.v2.GuestAttributes.Builder, + com.google.cloud.tpu.v2.GuestAttributesOrBuilder> + guestAttributesBuilder_; + + /** + * + * + *
+     * The guest attributes for the TPU workers.
+     * 
+ * + * repeated .google.cloud.tpu.v2.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.v2.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.v2.GuestAttributes guest_attributes = 1; + */ + public com.google.cloud.tpu.v2.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.v2.GuestAttributes guest_attributes = 1; + */ + public Builder setGuestAttributes(int index, com.google.cloud.tpu.v2.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.v2.GuestAttributes guest_attributes = 1; + */ + public Builder setGuestAttributes( + int index, com.google.cloud.tpu.v2.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.v2.GuestAttributes guest_attributes = 1; + */ + public Builder addGuestAttributes(com.google.cloud.tpu.v2.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.v2.GuestAttributes guest_attributes = 1; + */ + public Builder addGuestAttributes(int index, com.google.cloud.tpu.v2.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.v2.GuestAttributes guest_attributes = 1; + */ + public Builder addGuestAttributes( + com.google.cloud.tpu.v2.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.v2.GuestAttributes guest_attributes = 1; + */ + public Builder addGuestAttributes( + int index, com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.GuestAttributes guest_attributes = 1; + */ + public com.google.cloud.tpu.v2.GuestAttributes.Builder getGuestAttributesBuilder(int index) { + return getGuestAttributesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The guest attributes for the TPU workers.
+     * 
+ * + * repeated .google.cloud.tpu.v2.GuestAttributes guest_attributes = 1; + */ + public com.google.cloud.tpu.v2.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.v2.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.v2.GuestAttributes guest_attributes = 1; + */ + public com.google.cloud.tpu.v2.GuestAttributes.Builder addGuestAttributesBuilder() { + return getGuestAttributesFieldBuilder() + .addBuilder(com.google.cloud.tpu.v2.GuestAttributes.getDefaultInstance()); + } + /** + * + * + *
+     * The guest attributes for the TPU workers.
+     * 
+ * + * repeated .google.cloud.tpu.v2.GuestAttributes guest_attributes = 1; + */ + public com.google.cloud.tpu.v2.GuestAttributes.Builder addGuestAttributesBuilder(int index) { + return getGuestAttributesFieldBuilder() + .addBuilder(index, com.google.cloud.tpu.v2.GuestAttributes.getDefaultInstance()); + } + /** + * + * + *
+     * The guest attributes for the TPU workers.
+     * 
+ * + * repeated .google.cloud.tpu.v2.GuestAttributes guest_attributes = 1; + */ + public java.util.List + getGuestAttributesBuilderList() { + return getGuestAttributesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2.GuestAttributes, + com.google.cloud.tpu.v2.GuestAttributes.Builder, + com.google.cloud.tpu.v2.GuestAttributesOrBuilder> + getGuestAttributesFieldBuilder() { + if (guestAttributesBuilder_ == null) { + guestAttributesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2.GuestAttributes, + com.google.cloud.tpu.v2.GuestAttributes.Builder, + com.google.cloud.tpu.v2.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.v2.GetGuestAttributesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.GetGuestAttributesResponse) + private static final com.google.cloud.tpu.v2.GetGuestAttributesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.GetGuestAttributesResponse(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.GetGuestAttributesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetGuestAttributesResponseOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetGuestAttributesResponseOrBuilder.java new file mode 100644 index 000000000000..97e57f40ae01 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetGuestAttributesResponseOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface GetGuestAttributesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.GetGuestAttributesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The guest attributes for the TPU workers.
+   * 
+ * + * repeated .google.cloud.tpu.v2.GuestAttributes guest_attributes = 1; + */ + java.util.List getGuestAttributesList(); + /** + * + * + *
+   * The guest attributes for the TPU workers.
+   * 
+ * + * repeated .google.cloud.tpu.v2.GuestAttributes guest_attributes = 1; + */ + com.google.cloud.tpu.v2.GuestAttributes getGuestAttributes(int index); + /** + * + * + *
+   * The guest attributes for the TPU workers.
+   * 
+ * + * repeated .google.cloud.tpu.v2.GuestAttributes guest_attributes = 1; + */ + int getGuestAttributesCount(); + /** + * + * + *
+   * The guest attributes for the TPU workers.
+   * 
+ * + * repeated .google.cloud.tpu.v2.GuestAttributes guest_attributes = 1; + */ + java.util.List + getGuestAttributesOrBuilderList(); + /** + * + * + *
+   * The guest attributes for the TPU workers.
+   * 
+ * + * repeated .google.cloud.tpu.v2.GuestAttributes guest_attributes = 1; + */ + com.google.cloud.tpu.v2.GuestAttributesOrBuilder getGuestAttributesOrBuilder(int index); +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetNodeRequest.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetNodeRequest.java new file mode 100644 index 000000000000..8817756db9b6 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetNodeRequest.java @@ -0,0 +1,627 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * Request for [GetNode][google.cloud.tpu.v2.Tpu.GetNode].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.GetNodeRequest} + */ +public final class GetNodeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.GetNodeRequest.class, + com.google.cloud.tpu.v2.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_); + } + getUnknownFields().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 += getUnknownFields().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.v2.GetNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.GetNodeRequest other = (com.google.cloud.tpu.v2.GetNodeRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.GetNodeRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GetNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GetNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GetNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.GetNodeRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.Tpu.GetNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.GetNodeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.GetNodeRequest) + com.google.cloud.tpu.v2.GetNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.GetNodeRequest.class, + com.google.cloud.tpu.v2.GetNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.GetNodeRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GetNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.GetNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GetNodeRequest build() { + com.google.cloud.tpu.v2.GetNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GetNodeRequest buildPartial() { + com.google.cloud.tpu.v2.GetNodeRequest result = + new com.google.cloud.tpu.v2.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.v2.GetNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v2.GetNodeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.GetNodeRequest other) { + if (other == com.google.cloud.tpu.v2.GetNodeRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.GetNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.GetNodeRequest) + private static final com.google.cloud.tpu.v2.GetNodeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.GetNodeRequest(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.GetNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetNodeRequestOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetNodeRequestOrBuilder.java new file mode 100644 index 000000000000..db08fdb1a071 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetNodeRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface GetNodeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetRuntimeVersionRequest.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetRuntimeVersionRequest.java new file mode 100644 index 000000000000..0865bf530fca --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetRuntimeVersionRequest.java @@ -0,0 +1,629 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * Request for [GetRuntimeVersion][google.cloud.tpu.v2.Tpu.GetRuntimeVersion].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.GetRuntimeVersionRequest} + */ +public final class GetRuntimeVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetRuntimeVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetRuntimeVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.GetRuntimeVersionRequest.class, + com.google.cloud.tpu.v2.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_); + } + getUnknownFields().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 += getUnknownFields().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.v2.GetRuntimeVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.GetRuntimeVersionRequest other = + (com.google.cloud.tpu.v2.GetRuntimeVersionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.GetRuntimeVersionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GetRuntimeVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GetRuntimeVersionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GetRuntimeVersionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.GetRuntimeVersionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.Tpu.GetRuntimeVersion].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.GetRuntimeVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.GetRuntimeVersionRequest) + com.google.cloud.tpu.v2.GetRuntimeVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetRuntimeVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetRuntimeVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.GetRuntimeVersionRequest.class, + com.google.cloud.tpu.v2.GetRuntimeVersionRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.GetRuntimeVersionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GetRuntimeVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GetRuntimeVersionRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.GetRuntimeVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GetRuntimeVersionRequest build() { + com.google.cloud.tpu.v2.GetRuntimeVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GetRuntimeVersionRequest buildPartial() { + com.google.cloud.tpu.v2.GetRuntimeVersionRequest result = + new com.google.cloud.tpu.v2.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.v2.GetRuntimeVersionRequest) { + return mergeFrom((com.google.cloud.tpu.v2.GetRuntimeVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.GetRuntimeVersionRequest other) { + if (other == com.google.cloud.tpu.v2.GetRuntimeVersionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.GetRuntimeVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.GetRuntimeVersionRequest) + private static final com.google.cloud.tpu.v2.GetRuntimeVersionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.GetRuntimeVersionRequest(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.GetRuntimeVersionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetRuntimeVersionRequestOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetRuntimeVersionRequestOrBuilder.java new file mode 100644 index 000000000000..644774bdf54f --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GetRuntimeVersionRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface GetRuntimeVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributes.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributes.java new file mode 100644 index 000000000000..661fe653e2ec --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributes.java @@ -0,0 +1,895 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * A guest attributes.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.GuestAttributes} + */ +public final class GuestAttributes extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GuestAttributes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GuestAttributes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.GuestAttributes.class, + com.google.cloud.tpu.v2.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.v2.GuestAttributesValue queryValue_; + /** + * + * + *
+   * The value of the requested queried path.
+   * 
+ * + * .google.cloud.tpu.v2.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.v2.GuestAttributesValue query_value = 2; + * + * @return The queryValue. + */ + @java.lang.Override + public com.google.cloud.tpu.v2.GuestAttributesValue getQueryValue() { + return queryValue_ == null + ? com.google.cloud.tpu.v2.GuestAttributesValue.getDefaultInstance() + : queryValue_; + } + /** + * + * + *
+   * The value of the requested queried path.
+   * 
+ * + * .google.cloud.tpu.v2.GuestAttributesValue query_value = 2; + */ + @java.lang.Override + public com.google.cloud.tpu.v2.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()); + } + getUnknownFields().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 += getUnknownFields().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.v2.GuestAttributes)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.GuestAttributes other = (com.google.cloud.tpu.v2.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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.GuestAttributes parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GuestAttributes parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GuestAttributes parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GuestAttributes parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.GuestAttributes parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.GuestAttributes} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.GuestAttributes) + com.google.cloud.tpu.v2.GuestAttributesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GuestAttributes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GuestAttributes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.GuestAttributes.class, + com.google.cloud.tpu.v2.GuestAttributes.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.GuestAttributes.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GuestAttributes_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GuestAttributes getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.GuestAttributes.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GuestAttributes build() { + com.google.cloud.tpu.v2.GuestAttributes result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GuestAttributes buildPartial() { + com.google.cloud.tpu.v2.GuestAttributes result = + new com.google.cloud.tpu.v2.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.v2.GuestAttributes) { + return mergeFrom((com.google.cloud.tpu.v2.GuestAttributes) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.GuestAttributes other) { + if (other == com.google.cloud.tpu.v2.GuestAttributes.getDefaultInstance()) return this; + if (!other.getQueryPath().isEmpty()) { + queryPath_ = other.queryPath_; + onChanged(); + } + if (other.hasQueryValue()) { + mergeQueryValue(other.getQueryValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + queryPath_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getQueryValueFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.GuestAttributesValue queryValue_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.GuestAttributesValue, + com.google.cloud.tpu.v2.GuestAttributesValue.Builder, + com.google.cloud.tpu.v2.GuestAttributesValueOrBuilder> + queryValueBuilder_; + /** + * + * + *
+     * The value of the requested queried path.
+     * 
+ * + * .google.cloud.tpu.v2.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.v2.GuestAttributesValue query_value = 2; + * + * @return The queryValue. + */ + public com.google.cloud.tpu.v2.GuestAttributesValue getQueryValue() { + if (queryValueBuilder_ == null) { + return queryValue_ == null + ? com.google.cloud.tpu.v2.GuestAttributesValue.getDefaultInstance() + : queryValue_; + } else { + return queryValueBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The value of the requested queried path.
+     * 
+ * + * .google.cloud.tpu.v2.GuestAttributesValue query_value = 2; + */ + public Builder setQueryValue(com.google.cloud.tpu.v2.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.v2.GuestAttributesValue query_value = 2; + */ + public Builder setQueryValue( + com.google.cloud.tpu.v2.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.v2.GuestAttributesValue query_value = 2; + */ + public Builder mergeQueryValue(com.google.cloud.tpu.v2.GuestAttributesValue value) { + if (queryValueBuilder_ == null) { + if (queryValue_ != null) { + queryValue_ = + com.google.cloud.tpu.v2.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.v2.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.v2.GuestAttributesValue query_value = 2; + */ + public com.google.cloud.tpu.v2.GuestAttributesValue.Builder getQueryValueBuilder() { + + onChanged(); + return getQueryValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The value of the requested queried path.
+     * 
+ * + * .google.cloud.tpu.v2.GuestAttributesValue query_value = 2; + */ + public com.google.cloud.tpu.v2.GuestAttributesValueOrBuilder getQueryValueOrBuilder() { + if (queryValueBuilder_ != null) { + return queryValueBuilder_.getMessageOrBuilder(); + } else { + return queryValue_ == null + ? com.google.cloud.tpu.v2.GuestAttributesValue.getDefaultInstance() + : queryValue_; + } + } + /** + * + * + *
+     * The value of the requested queried path.
+     * 
+ * + * .google.cloud.tpu.v2.GuestAttributesValue query_value = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.GuestAttributesValue, + com.google.cloud.tpu.v2.GuestAttributesValue.Builder, + com.google.cloud.tpu.v2.GuestAttributesValueOrBuilder> + getQueryValueFieldBuilder() { + if (queryValueBuilder_ == null) { + queryValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.GuestAttributesValue, + com.google.cloud.tpu.v2.GuestAttributesValue.Builder, + com.google.cloud.tpu.v2.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.v2.GuestAttributes) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.GuestAttributes) + private static final com.google.cloud.tpu.v2.GuestAttributes DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.GuestAttributes(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.GuestAttributes getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributesEntry.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributesEntry.java new file mode 100644 index 000000000000..b3b257e8d071 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributesEntry.java @@ -0,0 +1,970 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * A guest attributes namespace/key/value entry.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.GuestAttributesEntry} + */ +public final class GuestAttributesEntry extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GuestAttributesEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GuestAttributesEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.GuestAttributesEntry.class, + com.google.cloud.tpu.v2.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_); + } + getUnknownFields().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 += getUnknownFields().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.v2.GuestAttributesEntry)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.GuestAttributesEntry other = + (com.google.cloud.tpu.v2.GuestAttributesEntry) obj; + + if (!getNamespace().equals(other.getNamespace())) return false; + if (!getKey().equals(other.getKey())) return false; + if (!getValue().equals(other.getValue())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.GuestAttributesEntry parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GuestAttributesEntry parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GuestAttributesEntry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GuestAttributesEntry parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.GuestAttributesEntry parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.GuestAttributesEntry} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.GuestAttributesEntry) + com.google.cloud.tpu.v2.GuestAttributesEntryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GuestAttributesEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GuestAttributesEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.GuestAttributesEntry.class, + com.google.cloud.tpu.v2.GuestAttributesEntry.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.GuestAttributesEntry.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GuestAttributesEntry_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GuestAttributesEntry getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.GuestAttributesEntry.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GuestAttributesEntry build() { + com.google.cloud.tpu.v2.GuestAttributesEntry result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GuestAttributesEntry buildPartial() { + com.google.cloud.tpu.v2.GuestAttributesEntry result = + new com.google.cloud.tpu.v2.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.v2.GuestAttributesEntry) { + return mergeFrom((com.google.cloud.tpu.v2.GuestAttributesEntry) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.GuestAttributesEntry other) { + if (other == com.google.cloud.tpu.v2.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.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + namespace_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + key_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + value_ = input.readStringRequireUtf8(); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.GuestAttributesEntry) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.GuestAttributesEntry) + private static final com.google.cloud.tpu.v2.GuestAttributesEntry DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.GuestAttributesEntry(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.GuestAttributesEntry getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributesEntryOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributesEntryOrBuilder.java new file mode 100644 index 000000000000..3e862f99218c --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributesEntryOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface GuestAttributesEntryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributesOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributesOrBuilder.java new file mode 100644 index 000000000000..800a4bcd0147 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributesOrBuilder.java @@ -0,0 +1,89 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface GuestAttributesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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.v2.GuestAttributesValue query_value = 2; + * + * @return Whether the queryValue field is set. + */ + boolean hasQueryValue(); + /** + * + * + *
+   * The value of the requested queried path.
+   * 
+ * + * .google.cloud.tpu.v2.GuestAttributesValue query_value = 2; + * + * @return The queryValue. + */ + com.google.cloud.tpu.v2.GuestAttributesValue getQueryValue(); + /** + * + * + *
+   * The value of the requested queried path.
+   * 
+ * + * .google.cloud.tpu.v2.GuestAttributesValue query_value = 2; + */ + com.google.cloud.tpu.v2.GuestAttributesValueOrBuilder getQueryValueOrBuilder(); +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributesValue.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributesValue.java new file mode 100644 index 000000000000..7d67cf28d68e --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributesValue.java @@ -0,0 +1,925 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * Array of guest attribute namespace/key/value tuples.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.GuestAttributesValue} + */ +public final class GuestAttributesValue extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GuestAttributesValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GuestAttributesValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.GuestAttributesValue.class, + com.google.cloud.tpu.v2.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.v2.GuestAttributesEntry items = 1; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + /** + * + * + *
+   * The list of guest attributes entries.
+   * 
+ * + * repeated .google.cloud.tpu.v2.GuestAttributesEntry items = 1; + */ + @java.lang.Override + public java.util.List + getItemsOrBuilderList() { + return items_; + } + /** + * + * + *
+   * The list of guest attributes entries.
+   * 
+ * + * repeated .google.cloud.tpu.v2.GuestAttributesEntry items = 1; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + /** + * + * + *
+   * The list of guest attributes entries.
+   * 
+ * + * repeated .google.cloud.tpu.v2.GuestAttributesEntry items = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2.GuestAttributesEntry getItems(int index) { + return items_.get(index); + } + /** + * + * + *
+   * The list of guest attributes entries.
+   * 
+ * + * repeated .google.cloud.tpu.v2.GuestAttributesEntry items = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2.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)); + } + getUnknownFields().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 += getUnknownFields().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.v2.GuestAttributesValue)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.GuestAttributesValue other = + (com.google.cloud.tpu.v2.GuestAttributesValue) obj; + + if (!getItemsList().equals(other.getItemsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.GuestAttributesValue parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GuestAttributesValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GuestAttributesValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.GuestAttributesValue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.GuestAttributesValue parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.GuestAttributesValue} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.GuestAttributesValue) + com.google.cloud.tpu.v2.GuestAttributesValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GuestAttributesValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GuestAttributesValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.GuestAttributesValue.class, + com.google.cloud.tpu.v2.GuestAttributesValue.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.GuestAttributesValue.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + } else { + items_ = null; + itemsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_GuestAttributesValue_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GuestAttributesValue getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.GuestAttributesValue.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GuestAttributesValue build() { + com.google.cloud.tpu.v2.GuestAttributesValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.GuestAttributesValue buildPartial() { + com.google.cloud.tpu.v2.GuestAttributesValue result = + new com.google.cloud.tpu.v2.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.v2.GuestAttributesValue) { + return mergeFrom((com.google.cloud.tpu.v2.GuestAttributesValue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.GuestAttributesValue other) { + if (other == com.google.cloud.tpu.v2.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.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.tpu.v2.GuestAttributesEntry m = + input.readMessage( + com.google.cloud.tpu.v2.GuestAttributesEntry.parser(), extensionRegistry); + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(m); + } else { + itemsBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.GuestAttributesEntry, + com.google.cloud.tpu.v2.GuestAttributesEntry.Builder, + com.google.cloud.tpu.v2.GuestAttributesEntryOrBuilder> + itemsBuilder_; + + /** + * + * + *
+     * The list of guest attributes entries.
+     * 
+ * + * repeated .google.cloud.tpu.v2.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.v2.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.v2.GuestAttributesEntry items = 1; + */ + public com.google.cloud.tpu.v2.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.v2.GuestAttributesEntry items = 1; + */ + public Builder setItems(int index, com.google.cloud.tpu.v2.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.v2.GuestAttributesEntry items = 1; + */ + public Builder setItems( + int index, com.google.cloud.tpu.v2.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.v2.GuestAttributesEntry items = 1; + */ + public Builder addItems(com.google.cloud.tpu.v2.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.v2.GuestAttributesEntry items = 1; + */ + public Builder addItems(int index, com.google.cloud.tpu.v2.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.v2.GuestAttributesEntry items = 1; + */ + public Builder addItems(com.google.cloud.tpu.v2.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.v2.GuestAttributesEntry items = 1; + */ + public Builder addItems( + int index, com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.GuestAttributesEntry items = 1; + */ + public com.google.cloud.tpu.v2.GuestAttributesEntry.Builder getItemsBuilder(int index) { + return getItemsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of guest attributes entries.
+     * 
+ * + * repeated .google.cloud.tpu.v2.GuestAttributesEntry items = 1; + */ + public com.google.cloud.tpu.v2.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.v2.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.v2.GuestAttributesEntry items = 1; + */ + public com.google.cloud.tpu.v2.GuestAttributesEntry.Builder addItemsBuilder() { + return getItemsFieldBuilder() + .addBuilder(com.google.cloud.tpu.v2.GuestAttributesEntry.getDefaultInstance()); + } + /** + * + * + *
+     * The list of guest attributes entries.
+     * 
+ * + * repeated .google.cloud.tpu.v2.GuestAttributesEntry items = 1; + */ + public com.google.cloud.tpu.v2.GuestAttributesEntry.Builder addItemsBuilder(int index) { + return getItemsFieldBuilder() + .addBuilder(index, com.google.cloud.tpu.v2.GuestAttributesEntry.getDefaultInstance()); + } + /** + * + * + *
+     * The list of guest attributes entries.
+     * 
+ * + * repeated .google.cloud.tpu.v2.GuestAttributesEntry items = 1; + */ + public java.util.List + getItemsBuilderList() { + return getItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2.GuestAttributesEntry, + com.google.cloud.tpu.v2.GuestAttributesEntry.Builder, + com.google.cloud.tpu.v2.GuestAttributesEntryOrBuilder> + getItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2.GuestAttributesEntry, + com.google.cloud.tpu.v2.GuestAttributesEntry.Builder, + com.google.cloud.tpu.v2.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.v2.GuestAttributesValue) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.GuestAttributesValue) + private static final com.google.cloud.tpu.v2.GuestAttributesValue DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.GuestAttributesValue(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.GuestAttributesValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributesValueOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributesValueOrBuilder.java new file mode 100644 index 000000000000..fb75e87660b2 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/GuestAttributesValueOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface GuestAttributesValueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.GuestAttributesValue) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of guest attributes entries.
+   * 
+ * + * repeated .google.cloud.tpu.v2.GuestAttributesEntry items = 1; + */ + java.util.List getItemsList(); + /** + * + * + *
+   * The list of guest attributes entries.
+   * 
+ * + * repeated .google.cloud.tpu.v2.GuestAttributesEntry items = 1; + */ + com.google.cloud.tpu.v2.GuestAttributesEntry getItems(int index); + /** + * + * + *
+   * The list of guest attributes entries.
+   * 
+ * + * repeated .google.cloud.tpu.v2.GuestAttributesEntry items = 1; + */ + int getItemsCount(); + /** + * + * + *
+   * The list of guest attributes entries.
+   * 
+ * + * repeated .google.cloud.tpu.v2.GuestAttributesEntry items = 1; + */ + java.util.List + getItemsOrBuilderList(); + /** + * + * + *
+   * The list of guest attributes entries.
+   * 
+ * + * repeated .google.cloud.tpu.v2.GuestAttributesEntry items = 1; + */ + com.google.cloud.tpu.v2.GuestAttributesEntryOrBuilder getItemsOrBuilder(int index); +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListAcceleratorTypesRequest.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListAcceleratorTypesRequest.java new file mode 100644 index 000000000000..7b3165b2cccb --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListAcceleratorTypesRequest.java @@ -0,0 +1,1254 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * Request for [ListAcceleratorTypes][google.cloud.tpu.v2.Tpu.ListAcceleratorTypes].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.ListAcceleratorTypesRequest} + */ +public final class ListAcceleratorTypesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListAcceleratorTypesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListAcceleratorTypesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.ListAcceleratorTypesRequest.class, + com.google.cloud.tpu.v2.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_); + } + getUnknownFields().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 += getUnknownFields().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.v2.ListAcceleratorTypesRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.ListAcceleratorTypesRequest other = + (com.google.cloud.tpu.v2.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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.ListAcceleratorTypesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ListAcceleratorTypesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ListAcceleratorTypesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ListAcceleratorTypesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.ListAcceleratorTypesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.Tpu.ListAcceleratorTypes].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.ListAcceleratorTypesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.ListAcceleratorTypesRequest) + com.google.cloud.tpu.v2.ListAcceleratorTypesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListAcceleratorTypesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListAcceleratorTypesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.ListAcceleratorTypesRequest.class, + com.google.cloud.tpu.v2.ListAcceleratorTypesRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.ListAcceleratorTypesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListAcceleratorTypesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ListAcceleratorTypesRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.ListAcceleratorTypesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ListAcceleratorTypesRequest build() { + com.google.cloud.tpu.v2.ListAcceleratorTypesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ListAcceleratorTypesRequest buildPartial() { + com.google.cloud.tpu.v2.ListAcceleratorTypesRequest result = + new com.google.cloud.tpu.v2.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.v2.ListAcceleratorTypesRequest) { + return mergeFrom((com.google.cloud.tpu.v2.ListAcceleratorTypesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.ListAcceleratorTypesRequest other) { + if (other == com.google.cloud.tpu.v2.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.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 42: + { + filter_ = input.readStringRequireUtf8(); + + break; + } // case 42 + case 50: + { + orderBy_ = input.readStringRequireUtf8(); + + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.ListAcceleratorTypesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.ListAcceleratorTypesRequest) + private static final com.google.cloud.tpu.v2.ListAcceleratorTypesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.ListAcceleratorTypesRequest(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.ListAcceleratorTypesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListAcceleratorTypesRequestOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListAcceleratorTypesRequestOrBuilder.java new file mode 100644 index 000000000000..60fd80c81c46 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListAcceleratorTypesRequestOrBuilder.java @@ -0,0 +1,142 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface ListAcceleratorTypesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListAcceleratorTypesResponse.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListAcceleratorTypesResponse.java new file mode 100644 index 000000000000..8551301ef104 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListAcceleratorTypesResponse.java @@ -0,0 +1,1380 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * Response for [ListAcceleratorTypes][google.cloud.tpu.v2.Tpu.ListAcceleratorTypes].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.ListAcceleratorTypesResponse} + */ +public final class ListAcceleratorTypesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListAcceleratorTypesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListAcceleratorTypesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.ListAcceleratorTypesResponse.class, + com.google.cloud.tpu.v2.ListAcceleratorTypesResponse.Builder.class); + } + + public static final int ACCELERATOR_TYPES_FIELD_NUMBER = 1; + private java.util.List acceleratorTypes_; + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.AcceleratorType accelerator_types = 1; + */ + @java.lang.Override + public java.util.List getAcceleratorTypesList() { + return acceleratorTypes_; + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.AcceleratorType accelerator_types = 1; + */ + @java.lang.Override + public java.util.List + getAcceleratorTypesOrBuilderList() { + return acceleratorTypes_; + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.AcceleratorType accelerator_types = 1; + */ + @java.lang.Override + public int getAcceleratorTypesCount() { + return acceleratorTypes_.size(); + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.AcceleratorType accelerator_types = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2.AcceleratorType getAcceleratorTypes(int index) { + return acceleratorTypes_.get(index); + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.AcceleratorType accelerator_types = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2.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)); + } + getUnknownFields().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 += getUnknownFields().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.v2.ListAcceleratorTypesResponse)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.ListAcceleratorTypesResponse other = + (com.google.cloud.tpu.v2.ListAcceleratorTypesResponse) obj; + + if (!getAcceleratorTypesList().equals(other.getAcceleratorTypesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.ListAcceleratorTypesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ListAcceleratorTypesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ListAcceleratorTypesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ListAcceleratorTypesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.ListAcceleratorTypesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.Tpu.ListAcceleratorTypes].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.ListAcceleratorTypesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.ListAcceleratorTypesResponse) + com.google.cloud.tpu.v2.ListAcceleratorTypesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListAcceleratorTypesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListAcceleratorTypesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.ListAcceleratorTypesResponse.class, + com.google.cloud.tpu.v2.ListAcceleratorTypesResponse.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.ListAcceleratorTypesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (acceleratorTypesBuilder_ == null) { + acceleratorTypes_ = java.util.Collections.emptyList(); + } else { + acceleratorTypes_ = null; + acceleratorTypesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + 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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListAcceleratorTypesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ListAcceleratorTypesResponse getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.ListAcceleratorTypesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ListAcceleratorTypesResponse build() { + com.google.cloud.tpu.v2.ListAcceleratorTypesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ListAcceleratorTypesResponse buildPartial() { + com.google.cloud.tpu.v2.ListAcceleratorTypesResponse result = + new com.google.cloud.tpu.v2.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.v2.ListAcceleratorTypesResponse) { + return mergeFrom((com.google.cloud.tpu.v2.ListAcceleratorTypesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.ListAcceleratorTypesResponse other) { + if (other == com.google.cloud.tpu.v2.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.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.tpu.v2.AcceleratorType m = + input.readMessage( + com.google.cloud.tpu.v2.AcceleratorType.parser(), extensionRegistry); + if (acceleratorTypesBuilder_ == null) { + ensureAcceleratorTypesIsMutable(); + acceleratorTypes_.add(m); + } else { + acceleratorTypesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.AcceleratorType, + com.google.cloud.tpu.v2.AcceleratorType.Builder, + com.google.cloud.tpu.v2.AcceleratorTypeOrBuilder> + acceleratorTypesBuilder_; + + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2.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.v2.AcceleratorType accelerator_types = 1; + */ + public int getAcceleratorTypesCount() { + if (acceleratorTypesBuilder_ == null) { + return acceleratorTypes_.size(); + } else { + return acceleratorTypesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2.AcceleratorType accelerator_types = 1; + */ + public com.google.cloud.tpu.v2.AcceleratorType getAcceleratorTypes(int index) { + if (acceleratorTypesBuilder_ == null) { + return acceleratorTypes_.get(index); + } else { + return acceleratorTypesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2.AcceleratorType accelerator_types = 1; + */ + public Builder setAcceleratorTypes(int index, com.google.cloud.tpu.v2.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.v2.AcceleratorType accelerator_types = 1; + */ + public Builder setAcceleratorTypes( + int index, com.google.cloud.tpu.v2.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.v2.AcceleratorType accelerator_types = 1; + */ + public Builder addAcceleratorTypes(com.google.cloud.tpu.v2.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.v2.AcceleratorType accelerator_types = 1; + */ + public Builder addAcceleratorTypes(int index, com.google.cloud.tpu.v2.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.v2.AcceleratorType accelerator_types = 1; + */ + public Builder addAcceleratorTypes( + com.google.cloud.tpu.v2.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.v2.AcceleratorType accelerator_types = 1; + */ + public Builder addAcceleratorTypes( + int index, com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.AcceleratorType accelerator_types = 1; + */ + public com.google.cloud.tpu.v2.AcceleratorType.Builder getAcceleratorTypesBuilder(int index) { + return getAcceleratorTypesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2.AcceleratorType accelerator_types = 1; + */ + public com.google.cloud.tpu.v2.AcceleratorTypeOrBuilder getAcceleratorTypesOrBuilder( + int index) { + if (acceleratorTypesBuilder_ == null) { + return acceleratorTypes_.get(index); + } else { + return acceleratorTypesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2.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.v2.AcceleratorType accelerator_types = 1; + */ + public com.google.cloud.tpu.v2.AcceleratorType.Builder addAcceleratorTypesBuilder() { + return getAcceleratorTypesFieldBuilder() + .addBuilder(com.google.cloud.tpu.v2.AcceleratorType.getDefaultInstance()); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2.AcceleratorType accelerator_types = 1; + */ + public com.google.cloud.tpu.v2.AcceleratorType.Builder addAcceleratorTypesBuilder(int index) { + return getAcceleratorTypesFieldBuilder() + .addBuilder(index, com.google.cloud.tpu.v2.AcceleratorType.getDefaultInstance()); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2.AcceleratorType accelerator_types = 1; + */ + public java.util.List + getAcceleratorTypesBuilderList() { + return getAcceleratorTypesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2.AcceleratorType, + com.google.cloud.tpu.v2.AcceleratorType.Builder, + com.google.cloud.tpu.v2.AcceleratorTypeOrBuilder> + getAcceleratorTypesFieldBuilder() { + if (acceleratorTypesBuilder_ == null) { + acceleratorTypesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2.AcceleratorType, + com.google.cloud.tpu.v2.AcceleratorType.Builder, + com.google.cloud.tpu.v2.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.v2.ListAcceleratorTypesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.ListAcceleratorTypesResponse) + private static final com.google.cloud.tpu.v2.ListAcceleratorTypesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.ListAcceleratorTypesResponse(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.ListAcceleratorTypesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListAcceleratorTypesResponseOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListAcceleratorTypesResponseOrBuilder.java new file mode 100644 index 000000000000..49b166c69189 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListAcceleratorTypesResponseOrBuilder.java @@ -0,0 +1,153 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface ListAcceleratorTypesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.ListAcceleratorTypesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.AcceleratorType accelerator_types = 1; + */ + java.util.List getAcceleratorTypesList(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.AcceleratorType accelerator_types = 1; + */ + com.google.cloud.tpu.v2.AcceleratorType getAcceleratorTypes(int index); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.AcceleratorType accelerator_types = 1; + */ + int getAcceleratorTypesCount(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.AcceleratorType accelerator_types = 1; + */ + java.util.List + getAcceleratorTypesOrBuilderList(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.AcceleratorType accelerator_types = 1; + */ + com.google.cloud.tpu.v2.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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListNodesRequest.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListNodesRequest.java new file mode 100644 index 000000000000..9b4216ce1d11 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListNodesRequest.java @@ -0,0 +1,896 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * Request for [ListNodes][google.cloud.tpu.v2.Tpu.ListNodes].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.ListNodesRequest} + */ +public final class ListNodesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListNodesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListNodesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.ListNodesRequest.class, + com.google.cloud.tpu.v2.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_); + } + getUnknownFields().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 += getUnknownFields().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.v2.ListNodesRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.ListNodesRequest other = (com.google.cloud.tpu.v2.ListNodesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.ListNodesRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ListNodesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ListNodesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ListNodesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.ListNodesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.Tpu.ListNodes].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.ListNodesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.ListNodesRequest) + com.google.cloud.tpu.v2.ListNodesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListNodesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListNodesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.ListNodesRequest.class, + com.google.cloud.tpu.v2.ListNodesRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.ListNodesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListNodesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ListNodesRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.ListNodesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ListNodesRequest build() { + com.google.cloud.tpu.v2.ListNodesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ListNodesRequest buildPartial() { + com.google.cloud.tpu.v2.ListNodesRequest result = + new com.google.cloud.tpu.v2.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.v2.ListNodesRequest) { + return mergeFrom((com.google.cloud.tpu.v2.ListNodesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.ListNodesRequest other) { + if (other == com.google.cloud.tpu.v2.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.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.ListNodesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.ListNodesRequest) + private static final com.google.cloud.tpu.v2.ListNodesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.ListNodesRequest(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.ListNodesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListNodesRequestOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListNodesRequestOrBuilder.java new file mode 100644 index 000000000000..210748b76069 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListNodesRequestOrBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface ListNodesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListNodesResponse.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListNodesResponse.java new file mode 100644 index 000000000000..e938a12853e6 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListNodesResponse.java @@ -0,0 +1,1364 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * Response for [ListNodes][google.cloud.tpu.v2.Tpu.ListNodes].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.ListNodesResponse} + */ +public final class ListNodesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListNodesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListNodesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.ListNodesResponse.class, + com.google.cloud.tpu.v2.ListNodesResponse.Builder.class); + } + + public static final int NODES_FIELD_NUMBER = 1; + private java.util.List nodes_; + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.Node nodes = 1; + */ + @java.lang.Override + public java.util.List getNodesList() { + return nodes_; + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.Node nodes = 1; + */ + @java.lang.Override + public java.util.List getNodesOrBuilderList() { + return nodes_; + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.Node nodes = 1; + */ + @java.lang.Override + public int getNodesCount() { + return nodes_.size(); + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.Node nodes = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2.Node getNodes(int index) { + return nodes_.get(index); + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.Node nodes = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2.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)); + } + getUnknownFields().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 += getUnknownFields().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.v2.ListNodesResponse)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.ListNodesResponse other = + (com.google.cloud.tpu.v2.ListNodesResponse) obj; + + if (!getNodesList().equals(other.getNodesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.ListNodesResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ListNodesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ListNodesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ListNodesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.ListNodesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.Tpu.ListNodes].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.ListNodesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.ListNodesResponse) + com.google.cloud.tpu.v2.ListNodesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListNodesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListNodesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.ListNodesResponse.class, + com.google.cloud.tpu.v2.ListNodesResponse.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.ListNodesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + } else { + nodes_ = null; + nodesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + 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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListNodesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ListNodesResponse getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.ListNodesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ListNodesResponse build() { + com.google.cloud.tpu.v2.ListNodesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ListNodesResponse buildPartial() { + com.google.cloud.tpu.v2.ListNodesResponse result = + new com.google.cloud.tpu.v2.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.v2.ListNodesResponse) { + return mergeFrom((com.google.cloud.tpu.v2.ListNodesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.ListNodesResponse other) { + if (other == com.google.cloud.tpu.v2.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.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.tpu.v2.Node m = + input.readMessage(com.google.cloud.tpu.v2.Node.parser(), extensionRegistry); + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(m); + } else { + nodesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.Node, + com.google.cloud.tpu.v2.Node.Builder, + com.google.cloud.tpu.v2.NodeOrBuilder> + nodesBuilder_; + + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2.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.v2.Node nodes = 1; + */ + public int getNodesCount() { + if (nodesBuilder_ == null) { + return nodes_.size(); + } else { + return nodesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2.Node nodes = 1; + */ + public com.google.cloud.tpu.v2.Node getNodes(int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2.Node nodes = 1; + */ + public Builder setNodes(int index, com.google.cloud.tpu.v2.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.v2.Node nodes = 1; + */ + public Builder setNodes(int index, com.google.cloud.tpu.v2.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.v2.Node nodes = 1; + */ + public Builder addNodes(com.google.cloud.tpu.v2.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.v2.Node nodes = 1; + */ + public Builder addNodes(int index, com.google.cloud.tpu.v2.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.v2.Node nodes = 1; + */ + public Builder addNodes(com.google.cloud.tpu.v2.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.v2.Node nodes = 1; + */ + public Builder addNodes(int index, com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.Node nodes = 1; + */ + public com.google.cloud.tpu.v2.Node.Builder getNodesBuilder(int index) { + return getNodesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2.Node nodes = 1; + */ + public com.google.cloud.tpu.v2.NodeOrBuilder getNodesOrBuilder(int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2.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.v2.Node nodes = 1; + */ + public com.google.cloud.tpu.v2.Node.Builder addNodesBuilder() { + return getNodesFieldBuilder().addBuilder(com.google.cloud.tpu.v2.Node.getDefaultInstance()); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2.Node nodes = 1; + */ + public com.google.cloud.tpu.v2.Node.Builder addNodesBuilder(int index) { + return getNodesFieldBuilder() + .addBuilder(index, com.google.cloud.tpu.v2.Node.getDefaultInstance()); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2.Node nodes = 1; + */ + public java.util.List getNodesBuilderList() { + return getNodesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2.Node, + com.google.cloud.tpu.v2.Node.Builder, + com.google.cloud.tpu.v2.NodeOrBuilder> + getNodesFieldBuilder() { + if (nodesBuilder_ == null) { + nodesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2.Node, + com.google.cloud.tpu.v2.Node.Builder, + com.google.cloud.tpu.v2.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.v2.ListNodesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.ListNodesResponse) + private static final com.google.cloud.tpu.v2.ListNodesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.ListNodesResponse(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.ListNodesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListNodesResponseOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListNodesResponseOrBuilder.java new file mode 100644 index 000000000000..4ec319767836 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListNodesResponseOrBuilder.java @@ -0,0 +1,152 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface ListNodesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.ListNodesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.Node nodes = 1; + */ + java.util.List getNodesList(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.Node nodes = 1; + */ + com.google.cloud.tpu.v2.Node getNodes(int index); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.Node nodes = 1; + */ + int getNodesCount(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.Node nodes = 1; + */ + java.util.List getNodesOrBuilderList(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.Node nodes = 1; + */ + com.google.cloud.tpu.v2.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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListRuntimeVersionsRequest.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListRuntimeVersionsRequest.java new file mode 100644 index 000000000000..2b5fcfaca69f --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListRuntimeVersionsRequest.java @@ -0,0 +1,1254 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * Request for [ListRuntimeVersions][google.cloud.tpu.v2.Tpu.ListRuntimeVersions].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.ListRuntimeVersionsRequest} + */ +public final class ListRuntimeVersionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListRuntimeVersionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListRuntimeVersionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.ListRuntimeVersionsRequest.class, + com.google.cloud.tpu.v2.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_); + } + getUnknownFields().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 += getUnknownFields().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.v2.ListRuntimeVersionsRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.ListRuntimeVersionsRequest other = + (com.google.cloud.tpu.v2.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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.ListRuntimeVersionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ListRuntimeVersionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ListRuntimeVersionsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ListRuntimeVersionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.ListRuntimeVersionsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.Tpu.ListRuntimeVersions].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.ListRuntimeVersionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.ListRuntimeVersionsRequest) + com.google.cloud.tpu.v2.ListRuntimeVersionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListRuntimeVersionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListRuntimeVersionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.ListRuntimeVersionsRequest.class, + com.google.cloud.tpu.v2.ListRuntimeVersionsRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.ListRuntimeVersionsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListRuntimeVersionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ListRuntimeVersionsRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.ListRuntimeVersionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ListRuntimeVersionsRequest build() { + com.google.cloud.tpu.v2.ListRuntimeVersionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ListRuntimeVersionsRequest buildPartial() { + com.google.cloud.tpu.v2.ListRuntimeVersionsRequest result = + new com.google.cloud.tpu.v2.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.v2.ListRuntimeVersionsRequest) { + return mergeFrom((com.google.cloud.tpu.v2.ListRuntimeVersionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.ListRuntimeVersionsRequest other) { + if (other == com.google.cloud.tpu.v2.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.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 42: + { + filter_ = input.readStringRequireUtf8(); + + break; + } // case 42 + case 50: + { + orderBy_ = input.readStringRequireUtf8(); + + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.ListRuntimeVersionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.ListRuntimeVersionsRequest) + private static final com.google.cloud.tpu.v2.ListRuntimeVersionsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.ListRuntimeVersionsRequest(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.ListRuntimeVersionsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListRuntimeVersionsRequestOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListRuntimeVersionsRequestOrBuilder.java new file mode 100644 index 000000000000..5ffc73a137a0 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListRuntimeVersionsRequestOrBuilder.java @@ -0,0 +1,142 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface ListRuntimeVersionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListRuntimeVersionsResponse.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListRuntimeVersionsResponse.java new file mode 100644 index 000000000000..dd598d0e083c --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListRuntimeVersionsResponse.java @@ -0,0 +1,1379 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * Response for [ListRuntimeVersions][google.cloud.tpu.v2.Tpu.ListRuntimeVersions].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.ListRuntimeVersionsResponse} + */ +public final class ListRuntimeVersionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListRuntimeVersionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListRuntimeVersionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.ListRuntimeVersionsResponse.class, + com.google.cloud.tpu.v2.ListRuntimeVersionsResponse.Builder.class); + } + + public static final int RUNTIME_VERSIONS_FIELD_NUMBER = 1; + private java.util.List runtimeVersions_; + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.RuntimeVersion runtime_versions = 1; + */ + @java.lang.Override + public java.util.List getRuntimeVersionsList() { + return runtimeVersions_; + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.RuntimeVersion runtime_versions = 1; + */ + @java.lang.Override + public java.util.List + getRuntimeVersionsOrBuilderList() { + return runtimeVersions_; + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.RuntimeVersion runtime_versions = 1; + */ + @java.lang.Override + public int getRuntimeVersionsCount() { + return runtimeVersions_.size(); + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.RuntimeVersion runtime_versions = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2.RuntimeVersion getRuntimeVersions(int index) { + return runtimeVersions_.get(index); + } + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.RuntimeVersion runtime_versions = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2.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)); + } + getUnknownFields().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 += getUnknownFields().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.v2.ListRuntimeVersionsResponse)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.ListRuntimeVersionsResponse other = + (com.google.cloud.tpu.v2.ListRuntimeVersionsResponse) obj; + + if (!getRuntimeVersionsList().equals(other.getRuntimeVersionsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.ListRuntimeVersionsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ListRuntimeVersionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ListRuntimeVersionsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ListRuntimeVersionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.ListRuntimeVersionsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.Tpu.ListRuntimeVersions].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.ListRuntimeVersionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.ListRuntimeVersionsResponse) + com.google.cloud.tpu.v2.ListRuntimeVersionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListRuntimeVersionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListRuntimeVersionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.ListRuntimeVersionsResponse.class, + com.google.cloud.tpu.v2.ListRuntimeVersionsResponse.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.ListRuntimeVersionsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (runtimeVersionsBuilder_ == null) { + runtimeVersions_ = java.util.Collections.emptyList(); + } else { + runtimeVersions_ = null; + runtimeVersionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + 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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ListRuntimeVersionsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ListRuntimeVersionsResponse getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.ListRuntimeVersionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ListRuntimeVersionsResponse build() { + com.google.cloud.tpu.v2.ListRuntimeVersionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ListRuntimeVersionsResponse buildPartial() { + com.google.cloud.tpu.v2.ListRuntimeVersionsResponse result = + new com.google.cloud.tpu.v2.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.v2.ListRuntimeVersionsResponse) { + return mergeFrom((com.google.cloud.tpu.v2.ListRuntimeVersionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.ListRuntimeVersionsResponse other) { + if (other == com.google.cloud.tpu.v2.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.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.tpu.v2.RuntimeVersion m = + input.readMessage( + com.google.cloud.tpu.v2.RuntimeVersion.parser(), extensionRegistry); + if (runtimeVersionsBuilder_ == null) { + ensureRuntimeVersionsIsMutable(); + runtimeVersions_.add(m); + } else { + runtimeVersionsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.RuntimeVersion, + com.google.cloud.tpu.v2.RuntimeVersion.Builder, + com.google.cloud.tpu.v2.RuntimeVersionOrBuilder> + runtimeVersionsBuilder_; + + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2.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.v2.RuntimeVersion runtime_versions = 1; + */ + public int getRuntimeVersionsCount() { + if (runtimeVersionsBuilder_ == null) { + return runtimeVersions_.size(); + } else { + return runtimeVersionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2.RuntimeVersion runtime_versions = 1; + */ + public com.google.cloud.tpu.v2.RuntimeVersion getRuntimeVersions(int index) { + if (runtimeVersionsBuilder_ == null) { + return runtimeVersions_.get(index); + } else { + return runtimeVersionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2.RuntimeVersion runtime_versions = 1; + */ + public Builder setRuntimeVersions(int index, com.google.cloud.tpu.v2.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.v2.RuntimeVersion runtime_versions = 1; + */ + public Builder setRuntimeVersions( + int index, com.google.cloud.tpu.v2.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.v2.RuntimeVersion runtime_versions = 1; + */ + public Builder addRuntimeVersions(com.google.cloud.tpu.v2.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.v2.RuntimeVersion runtime_versions = 1; + */ + public Builder addRuntimeVersions(int index, com.google.cloud.tpu.v2.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.v2.RuntimeVersion runtime_versions = 1; + */ + public Builder addRuntimeVersions( + com.google.cloud.tpu.v2.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.v2.RuntimeVersion runtime_versions = 1; + */ + public Builder addRuntimeVersions( + int index, com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.RuntimeVersion runtime_versions = 1; + */ + public com.google.cloud.tpu.v2.RuntimeVersion.Builder getRuntimeVersionsBuilder(int index) { + return getRuntimeVersionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2.RuntimeVersion runtime_versions = 1; + */ + public com.google.cloud.tpu.v2.RuntimeVersionOrBuilder getRuntimeVersionsOrBuilder(int index) { + if (runtimeVersionsBuilder_ == null) { + return runtimeVersions_.get(index); + } else { + return runtimeVersionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2.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.v2.RuntimeVersion runtime_versions = 1; + */ + public com.google.cloud.tpu.v2.RuntimeVersion.Builder addRuntimeVersionsBuilder() { + return getRuntimeVersionsFieldBuilder() + .addBuilder(com.google.cloud.tpu.v2.RuntimeVersion.getDefaultInstance()); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2.RuntimeVersion runtime_versions = 1; + */ + public com.google.cloud.tpu.v2.RuntimeVersion.Builder addRuntimeVersionsBuilder(int index) { + return getRuntimeVersionsFieldBuilder() + .addBuilder(index, com.google.cloud.tpu.v2.RuntimeVersion.getDefaultInstance()); + } + /** + * + * + *
+     * The listed nodes.
+     * 
+ * + * repeated .google.cloud.tpu.v2.RuntimeVersion runtime_versions = 1; + */ + public java.util.List + getRuntimeVersionsBuilderList() { + return getRuntimeVersionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2.RuntimeVersion, + com.google.cloud.tpu.v2.RuntimeVersion.Builder, + com.google.cloud.tpu.v2.RuntimeVersionOrBuilder> + getRuntimeVersionsFieldBuilder() { + if (runtimeVersionsBuilder_ == null) { + runtimeVersionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2.RuntimeVersion, + com.google.cloud.tpu.v2.RuntimeVersion.Builder, + com.google.cloud.tpu.v2.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.v2.ListRuntimeVersionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.ListRuntimeVersionsResponse) + private static final com.google.cloud.tpu.v2.ListRuntimeVersionsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.ListRuntimeVersionsResponse(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.ListRuntimeVersionsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListRuntimeVersionsResponseOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListRuntimeVersionsResponseOrBuilder.java new file mode 100644 index 000000000000..ba15692d5d8b --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ListRuntimeVersionsResponseOrBuilder.java @@ -0,0 +1,153 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface ListRuntimeVersionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.ListRuntimeVersionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.RuntimeVersion runtime_versions = 1; + */ + java.util.List getRuntimeVersionsList(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.RuntimeVersion runtime_versions = 1; + */ + com.google.cloud.tpu.v2.RuntimeVersion getRuntimeVersions(int index); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.RuntimeVersion runtime_versions = 1; + */ + int getRuntimeVersionsCount(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.RuntimeVersion runtime_versions = 1; + */ + java.util.List + getRuntimeVersionsOrBuilderList(); + /** + * + * + *
+   * The listed nodes.
+   * 
+ * + * repeated .google.cloud.tpu.v2.RuntimeVersion runtime_versions = 1; + */ + com.google.cloud.tpu.v2.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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/LocationName.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/LocationName.java new file mode 100644 index 000000000000..a1f5c77ac0b6 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/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.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/NetworkConfig.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/NetworkConfig.java new file mode 100644 index 000000000000..79d5355d7b4b --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/NetworkConfig.java @@ -0,0 +1,1009 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * Network related configurations.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.NetworkConfig} + */ +public final class NetworkConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_NetworkConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_NetworkConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.NetworkConfig.class, + com.google.cloud.tpu.v2.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_; + } + + public static final int CAN_IP_FORWARD_FIELD_NUMBER = 4; + private boolean canIpForward_; + /** + * + * + *
+   * Allows the TPU node to send and receive packets with non-matching
+   * destination or source IPs. This is required if you plan to use the TPU
+   * workers to forward routes.
+   * 
+ * + * bool can_ip_forward = 4; + * + * @return The canIpForward. + */ + @java.lang.Override + public boolean getCanIpForward() { + return canIpForward_; + } + + 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_); + } + if (canIpForward_ != false) { + output.writeBool(4, canIpForward_); + } + getUnknownFields().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_); + } + if (canIpForward_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, canIpForward_); + } + size += getUnknownFields().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.v2.NetworkConfig)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.NetworkConfig other = (com.google.cloud.tpu.v2.NetworkConfig) obj; + + if (!getNetwork().equals(other.getNetwork())) return false; + if (!getSubnetwork().equals(other.getSubnetwork())) return false; + if (getEnableExternalIps() != other.getEnableExternalIps()) return false; + if (getCanIpForward() != other.getCanIpForward()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (37 * hash) + CAN_IP_FORWARD_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCanIpForward()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.NetworkConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.NetworkConfig parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.NetworkConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.NetworkConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.NetworkConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.NetworkConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.NetworkConfig) + com.google.cloud.tpu.v2.NetworkConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_NetworkConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_NetworkConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.NetworkConfig.class, + com.google.cloud.tpu.v2.NetworkConfig.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.NetworkConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + network_ = ""; + + subnetwork_ = ""; + + enableExternalIps_ = false; + + canIpForward_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_NetworkConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.NetworkConfig getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.NetworkConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.NetworkConfig build() { + com.google.cloud.tpu.v2.NetworkConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.NetworkConfig buildPartial() { + com.google.cloud.tpu.v2.NetworkConfig result = + new com.google.cloud.tpu.v2.NetworkConfig(this); + result.network_ = network_; + result.subnetwork_ = subnetwork_; + result.enableExternalIps_ = enableExternalIps_; + result.canIpForward_ = canIpForward_; + 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.v2.NetworkConfig) { + return mergeFrom((com.google.cloud.tpu.v2.NetworkConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.NetworkConfig other) { + if (other == com.google.cloud.tpu.v2.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()); + } + if (other.getCanIpForward() != false) { + setCanIpForward(other.getCanIpForward()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + network_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + subnetwork_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 24: + { + enableExternalIps_ = input.readBool(); + + break; + } // case 24 + case 32: + { + canIpForward_ = input.readBool(); + + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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; + } + + private boolean canIpForward_; + /** + * + * + *
+     * Allows the TPU node to send and receive packets with non-matching
+     * destination or source IPs. This is required if you plan to use the TPU
+     * workers to forward routes.
+     * 
+ * + * bool can_ip_forward = 4; + * + * @return The canIpForward. + */ + @java.lang.Override + public boolean getCanIpForward() { + return canIpForward_; + } + /** + * + * + *
+     * Allows the TPU node to send and receive packets with non-matching
+     * destination or source IPs. This is required if you plan to use the TPU
+     * workers to forward routes.
+     * 
+ * + * bool can_ip_forward = 4; + * + * @param value The canIpForward to set. + * @return This builder for chaining. + */ + public Builder setCanIpForward(boolean value) { + + canIpForward_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Allows the TPU node to send and receive packets with non-matching
+     * destination or source IPs. This is required if you plan to use the TPU
+     * workers to forward routes.
+     * 
+ * + * bool can_ip_forward = 4; + * + * @return This builder for chaining. + */ + public Builder clearCanIpForward() { + + canIpForward_ = 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.v2.NetworkConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.NetworkConfig) + private static final com.google.cloud.tpu.v2.NetworkConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.NetworkConfig(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.NetworkConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/NetworkConfigOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/NetworkConfigOrBuilder.java new file mode 100644 index 000000000000..e8489117651c --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/NetworkConfigOrBuilder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface NetworkConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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(); + + /** + * + * + *
+   * Allows the TPU node to send and receive packets with non-matching
+   * destination or source IPs. This is required if you plan to use the TPU
+   * workers to forward routes.
+   * 
+ * + * bool can_ip_forward = 4; + * + * @return The canIpForward. + */ + boolean getCanIpForward(); +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/NetworkEndpoint.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/NetworkEndpoint.java new file mode 100644 index 000000000000..9c03e5288f92 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/NetworkEndpoint.java @@ -0,0 +1,971 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * A network endpoint over which a TPU worker can be reached.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.NetworkEndpoint} + */ +public final class NetworkEndpoint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_NetworkEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_NetworkEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.NetworkEndpoint.class, + com.google.cloud.tpu.v2.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.v2.AccessConfig accessConfig_; + /** + * + * + *
+   * The access config for the TPU worker.
+   * 
+ * + * .google.cloud.tpu.v2.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.v2.AccessConfig access_config = 5; + * + * @return The accessConfig. + */ + @java.lang.Override + public com.google.cloud.tpu.v2.AccessConfig getAccessConfig() { + return accessConfig_ == null + ? com.google.cloud.tpu.v2.AccessConfig.getDefaultInstance() + : accessConfig_; + } + /** + * + * + *
+   * The access config for the TPU worker.
+   * 
+ * + * .google.cloud.tpu.v2.AccessConfig access_config = 5; + */ + @java.lang.Override + public com.google.cloud.tpu.v2.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()); + } + getUnknownFields().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 += getUnknownFields().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.v2.NetworkEndpoint)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.NetworkEndpoint other = (com.google.cloud.tpu.v2.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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.NetworkEndpoint parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.NetworkEndpoint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.NetworkEndpoint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.NetworkEndpoint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.NetworkEndpoint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.NetworkEndpoint} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.NetworkEndpoint) + com.google.cloud.tpu.v2.NetworkEndpointOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_NetworkEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_NetworkEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.NetworkEndpoint.class, + com.google.cloud.tpu.v2.NetworkEndpoint.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.NetworkEndpoint.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_NetworkEndpoint_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.NetworkEndpoint getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.NetworkEndpoint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.NetworkEndpoint build() { + com.google.cloud.tpu.v2.NetworkEndpoint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.NetworkEndpoint buildPartial() { + com.google.cloud.tpu.v2.NetworkEndpoint result = + new com.google.cloud.tpu.v2.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.v2.NetworkEndpoint) { + return mergeFrom((com.google.cloud.tpu.v2.NetworkEndpoint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.NetworkEndpoint other) { + if (other == com.google.cloud.tpu.v2.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.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + ipAddress_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + port_ = input.readInt32(); + + break; + } // case 16 + case 42: + { + input.readMessage(getAccessConfigFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.AccessConfig accessConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.AccessConfig, + com.google.cloud.tpu.v2.AccessConfig.Builder, + com.google.cloud.tpu.v2.AccessConfigOrBuilder> + accessConfigBuilder_; + /** + * + * + *
+     * The access config for the TPU worker.
+     * 
+ * + * .google.cloud.tpu.v2.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.v2.AccessConfig access_config = 5; + * + * @return The accessConfig. + */ + public com.google.cloud.tpu.v2.AccessConfig getAccessConfig() { + if (accessConfigBuilder_ == null) { + return accessConfig_ == null + ? com.google.cloud.tpu.v2.AccessConfig.getDefaultInstance() + : accessConfig_; + } else { + return accessConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The access config for the TPU worker.
+     * 
+ * + * .google.cloud.tpu.v2.AccessConfig access_config = 5; + */ + public Builder setAccessConfig(com.google.cloud.tpu.v2.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.v2.AccessConfig access_config = 5; + */ + public Builder setAccessConfig(com.google.cloud.tpu.v2.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.v2.AccessConfig access_config = 5; + */ + public Builder mergeAccessConfig(com.google.cloud.tpu.v2.AccessConfig value) { + if (accessConfigBuilder_ == null) { + if (accessConfig_ != null) { + accessConfig_ = + com.google.cloud.tpu.v2.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.v2.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.v2.AccessConfig access_config = 5; + */ + public com.google.cloud.tpu.v2.AccessConfig.Builder getAccessConfigBuilder() { + + onChanged(); + return getAccessConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The access config for the TPU worker.
+     * 
+ * + * .google.cloud.tpu.v2.AccessConfig access_config = 5; + */ + public com.google.cloud.tpu.v2.AccessConfigOrBuilder getAccessConfigOrBuilder() { + if (accessConfigBuilder_ != null) { + return accessConfigBuilder_.getMessageOrBuilder(); + } else { + return accessConfig_ == null + ? com.google.cloud.tpu.v2.AccessConfig.getDefaultInstance() + : accessConfig_; + } + } + /** + * + * + *
+     * The access config for the TPU worker.
+     * 
+ * + * .google.cloud.tpu.v2.AccessConfig access_config = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.AccessConfig, + com.google.cloud.tpu.v2.AccessConfig.Builder, + com.google.cloud.tpu.v2.AccessConfigOrBuilder> + getAccessConfigFieldBuilder() { + if (accessConfigBuilder_ == null) { + accessConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.AccessConfig, + com.google.cloud.tpu.v2.AccessConfig.Builder, + com.google.cloud.tpu.v2.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.v2.NetworkEndpoint) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.NetworkEndpoint) + private static final com.google.cloud.tpu.v2.NetworkEndpoint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.NetworkEndpoint(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.NetworkEndpoint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/NetworkEndpointOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/NetworkEndpointOrBuilder.java new file mode 100644 index 000000000000..9f14e96890a9 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/NetworkEndpointOrBuilder.java @@ -0,0 +1,98 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface NetworkEndpointOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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.v2.AccessConfig access_config = 5; + * + * @return Whether the accessConfig field is set. + */ + boolean hasAccessConfig(); + /** + * + * + *
+   * The access config for the TPU worker.
+   * 
+ * + * .google.cloud.tpu.v2.AccessConfig access_config = 5; + * + * @return The accessConfig. + */ + com.google.cloud.tpu.v2.AccessConfig getAccessConfig(); + /** + * + * + *
+   * The access config for the TPU worker.
+   * 
+ * + * .google.cloud.tpu.v2.AccessConfig access_config = 5; + */ + com.google.cloud.tpu.v2.AccessConfigOrBuilder getAccessConfigOrBuilder(); +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/Node.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/Node.java new file mode 100644 index 000000000000..a79a8252ec90 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/Node.java @@ -0,0 +1,6843 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * A TPU instance.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.Node} + */ +public final class Node extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_Node_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.Node.class, com.google.cloud.tpu.v2.Node.Builder.class); + } + + /** + * + * + *
+   * Represents the different states of a TPU node during its lifecycle.
+   * 
+ * + * Protobuf enum {@code google.cloud.tpu.v2.Node.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * TPU node state is not known/set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * TPU node is being created.
+     * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + * + * + *
+     * TPU node has been created.
+     * 
+ * + * READY = 2; + */ + READY(2), + /** + * + * + *
+     * TPU node is restarting.
+     * 
+ * + * RESTARTING = 3; + */ + RESTARTING(3), + /** + * + * + *
+     * TPU node is undergoing reimaging.
+     * 
+ * + * REIMAGING = 4; + */ + REIMAGING(4), + /** + * + * + *
+     * TPU node is being deleted.
+     * 
+ * + * DELETING = 5; + */ + DELETING(5), + /** + * + * + *
+     * TPU node is being repaired and may be unusable. Details can be
+     * found in the `help_description` field.
+     * 
+ * + * REPAIRING = 6; + */ + REPAIRING(6), + /** + * + * + *
+     * TPU node is stopped.
+     * 
+ * + * STOPPED = 8; + */ + STOPPED(8), + /** + * + * + *
+     * TPU node is currently stopping.
+     * 
+ * + * STOPPING = 9; + */ + STOPPING(9), + /** + * + * + *
+     * TPU node is currently starting.
+     * 
+ * + * STARTING = 10; + */ + STARTING(10), + /** + * + * + *
+     * TPU node has been preempted. Only applies to Preemptible TPU Nodes.
+     * 
+ * + * PREEMPTED = 11; + */ + PREEMPTED(11), + /** + * + * + *
+     * TPU node has been terminated due to maintenance or has reached the end of
+     * its life cycle (for preemptible nodes).
+     * 
+ * + * TERMINATED = 12; + */ + TERMINATED(12), + /** + * + * + *
+     * TPU node is currently hiding.
+     * 
+ * + * HIDING = 13; + */ + HIDING(13), + /** + * + * + *
+     * TPU node has been hidden.
+     * 
+ * + * HIDDEN = 14; + */ + HIDDEN(14), + /** + * + * + *
+     * TPU node is currently unhiding.
+     * 
+ * + * UNHIDING = 15; + */ + UNHIDING(15), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * TPU node state is not known/set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * TPU node is being created.
+     * 
+ * + * CREATING = 1; + */ + public static final int CREATING_VALUE = 1; + /** + * + * + *
+     * TPU node has been created.
+     * 
+ * + * READY = 2; + */ + public static final int READY_VALUE = 2; + /** + * + * + *
+     * TPU node is restarting.
+     * 
+ * + * RESTARTING = 3; + */ + public static final int RESTARTING_VALUE = 3; + /** + * + * + *
+     * TPU node is undergoing reimaging.
+     * 
+ * + * REIMAGING = 4; + */ + public static final int REIMAGING_VALUE = 4; + /** + * + * + *
+     * TPU node is being deleted.
+     * 
+ * + * DELETING = 5; + */ + public static final int DELETING_VALUE = 5; + /** + * + * + *
+     * TPU node is being repaired and may be unusable. Details can be
+     * found in the `help_description` field.
+     * 
+ * + * REPAIRING = 6; + */ + public static final int REPAIRING_VALUE = 6; + /** + * + * + *
+     * TPU node is stopped.
+     * 
+ * + * STOPPED = 8; + */ + public static final int STOPPED_VALUE = 8; + /** + * + * + *
+     * TPU node is currently stopping.
+     * 
+ * + * STOPPING = 9; + */ + public static final int STOPPING_VALUE = 9; + /** + * + * + *
+     * TPU node is currently starting.
+     * 
+ * + * STARTING = 10; + */ + public static final int STARTING_VALUE = 10; + /** + * + * + *
+     * TPU node has been preempted. Only applies to Preemptible TPU Nodes.
+     * 
+ * + * PREEMPTED = 11; + */ + public static final int PREEMPTED_VALUE = 11; + /** + * + * + *
+     * TPU node has been terminated due to maintenance or has reached the end of
+     * its life cycle (for preemptible nodes).
+     * 
+ * + * TERMINATED = 12; + */ + public static final int TERMINATED_VALUE = 12; + /** + * + * + *
+     * TPU node is currently hiding.
+     * 
+ * + * HIDING = 13; + */ + public static final int HIDING_VALUE = 13; + /** + * + * + *
+     * TPU node has been hidden.
+     * 
+ * + * HIDDEN = 14; + */ + public static final int HIDDEN_VALUE = 14; + /** + * + * + *
+     * TPU node is currently unhiding.
+     * 
+ * + * UNHIDING = 15; + */ + public static final int UNHIDING_VALUE = 15; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return CREATING; + case 2: + return READY; + case 3: + return RESTARTING; + case 4: + return REIMAGING; + case 5: + return DELETING; + case 6: + return REPAIRING; + case 8: + return STOPPED; + case 9: + return STOPPING; + case 10: + return STARTING; + case 11: + return PREEMPTED; + case 12: + return TERMINATED; + case 13: + return HIDING; + case 14: + return HIDDEN; + case 15: + return UNHIDING; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.tpu.v2.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.v2.Node.State) + } + + /** + * + * + *
+   * Health defines the status of a TPU node as reported by
+   * Health Monitor.
+   * 
+ * + * Protobuf enum {@code google.cloud.tpu.v2.Node.Health} + */ + public enum Health implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Health status is unknown: not initialized or failed to retrieve.
+     * 
+ * + * HEALTH_UNSPECIFIED = 0; + */ + HEALTH_UNSPECIFIED(0), + /** + * + * + *
+     * The resource is healthy.
+     * 
+ * + * HEALTHY = 1; + */ + HEALTHY(1), + /** + * + * + *
+     * The resource is unresponsive.
+     * 
+ * + * TIMEOUT = 3; + */ + TIMEOUT(3), + /** + * + * + *
+     * The in-guest ML stack is unhealthy.
+     * 
+ * + * UNHEALTHY_TENSORFLOW = 4; + */ + UNHEALTHY_TENSORFLOW(4), + /** + * + * + *
+     * The node is under maintenance/priority boost caused rescheduling and
+     * will resume running once rescheduled.
+     * 
+ * + * UNHEALTHY_MAINTENANCE = 5; + */ + UNHEALTHY_MAINTENANCE(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Health status is unknown: not initialized or failed to retrieve.
+     * 
+ * + * HEALTH_UNSPECIFIED = 0; + */ + public static final int HEALTH_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The resource is healthy.
+     * 
+ * + * HEALTHY = 1; + */ + public static final int HEALTHY_VALUE = 1; + /** + * + * + *
+     * The resource is unresponsive.
+     * 
+ * + * TIMEOUT = 3; + */ + public static final int TIMEOUT_VALUE = 3; + /** + * + * + *
+     * The in-guest ML stack is unhealthy.
+     * 
+ * + * UNHEALTHY_TENSORFLOW = 4; + */ + public static final int UNHEALTHY_TENSORFLOW_VALUE = 4; + /** + * + * + *
+     * The node is under maintenance/priority boost caused rescheduling and
+     * will resume running once rescheduled.
+     * 
+ * + * UNHEALTHY_MAINTENANCE = 5; + */ + public static final int UNHEALTHY_MAINTENANCE_VALUE = 5; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Health valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Health forNumber(int value) { + switch (value) { + case 0: + return HEALTH_UNSPECIFIED; + case 1: + return HEALTHY; + case 3: + return TIMEOUT; + case 4: + return UNHEALTHY_TENSORFLOW; + case 5: + return UNHEALTHY_MAINTENANCE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Health findValueByNumber(int number) { + return Health.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.tpu.v2.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.v2.Node.Health) + } + + /** + * + * + *
+   * TPU API Version.
+   * 
+ * + * Protobuf enum {@code google.cloud.tpu.v2.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), + /** + * + * + *
+     * TPU API V2 version.
+     * 
+ * + * V2 = 4; + */ + V2(4), + 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; + /** + * + * + *
+     * TPU API V2 version.
+     * 
+ * + * V2 = 4; + */ + public static final int V2_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static 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; + case 4: + return V2; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ApiVersion findValueByNumber(int number) { + return ApiVersion.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.tpu.v2.Node.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v2.Node.State result = com.google.cloud.tpu.v2.Node.State.valueOf(state_); + return result == null ? com.google.cloud.tpu.v2.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.v2.NetworkConfig networkConfig_; + /** + * + * + *
+   * Network configurations for the TPU node.
+   * 
+ * + * .google.cloud.tpu.v2.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.v2.NetworkConfig network_config = 36; + * + * @return The networkConfig. + */ + @java.lang.Override + public com.google.cloud.tpu.v2.NetworkConfig getNetworkConfig() { + return networkConfig_ == null + ? com.google.cloud.tpu.v2.NetworkConfig.getDefaultInstance() + : networkConfig_; + } + /** + * + * + *
+   * Network configurations for the TPU node.
+   * 
+ * + * .google.cloud.tpu.v2.NetworkConfig network_config = 36; + */ + @java.lang.Override + public com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.ServiceAccount service_account = 37; + * + * @return The serviceAccount. + */ + @java.lang.Override + public com.google.cloud.tpu.v2.ServiceAccount getServiceAccount() { + return serviceAccount_ == null + ? com.google.cloud.tpu.v2.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.v2.ServiceAccount service_account = 37; + */ + @java.lang.Override + public com.google.cloud.tpu.v2.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.v2.SchedulingConfig schedulingConfig_; + /** + * + * + *
+   * The scheduling options for this node.
+   * 
+ * + * .google.cloud.tpu.v2.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.v2.SchedulingConfig scheduling_config = 17; + * + * @return The schedulingConfig. + */ + @java.lang.Override + public com.google.cloud.tpu.v2.SchedulingConfig getSchedulingConfig() { + return schedulingConfig_ == null + ? com.google.cloud.tpu.v2.SchedulingConfig.getDefaultInstance() + : schedulingConfig_; + } + /** + * + * + *
+   * The scheduling options for this node.
+   * 
+ * + * .google.cloud.tpu.v2.SchedulingConfig scheduling_config = 17; + */ + @java.lang.Override + public com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.tpu.v2.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.v2.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.tpu.v2.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.v2.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.v2.Node.Health health = 22; + * + * @return The health. + */ + @java.lang.Override + public com.google.cloud.tpu.v2.Node.Health getHealth() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v2.Node.Health result = + com.google.cloud.tpu.v2.Node.Health.valueOf(health_); + return result == null ? com.google.cloud.tpu.v2.Node.Health.UNRECOGNIZED : result; + } + + public static final int LABELS_FIELD_NUMBER = 24; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_Node_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Resource labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 24; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new 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 defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_Node_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField metadata_; + + private com.google.protobuf.MapField internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + * + * + *
+   * Custom metadata to apply to the TPU Node.
+   * Can set startup-script and shutdown-script
+   * 
+ * + * map<string, string> metadata = 34; + */ + @java.lang.Override + public boolean containsMetadata(java.lang.String key) { + if (key == null) { + throw new 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.v2.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.v2.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.v2.AttachedDisk data_disks = 41; + */ + @java.lang.Override + public int getDataDisksCount() { + return dataDisks_.size(); + } + /** + * + * + *
+   * The additional data disks for the Node.
+   * 
+ * + * repeated .google.cloud.tpu.v2.AttachedDisk data_disks = 41; + */ + @java.lang.Override + public com.google.cloud.tpu.v2.AttachedDisk getDataDisks(int index) { + return dataDisks_.get(index); + } + /** + * + * + *
+   * The additional data disks for the Node.
+   * 
+ * + * repeated .google.cloud.tpu.v2.AttachedDisk data_disks = 41; + */ + @java.lang.Override + public com.google.cloud.tpu.v2.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.v2.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.v2.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The apiVersion. + */ + @java.lang.Override + public com.google.cloud.tpu.v2.Node.ApiVersion getApiVersion() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v2.Node.ApiVersion result = + com.google.cloud.tpu.v2.Node.ApiVersion.valueOf(apiVersion_); + return result == null ? com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.tpu.v2.Symptom getSymptoms(int index) { + return symptoms_.get(index); + } + /** + * + * + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * + * repeated .google.cloud.tpu.v2.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.tpu.v2.SymptomOrBuilder getSymptomsOrBuilder(int index) { + return symptoms_.get(index); + } + + public static final int SHIELDED_INSTANCE_CONFIG_FIELD_NUMBER = 45; + private com.google.cloud.tpu.v2.ShieldedInstanceConfig shieldedInstanceConfig_; + /** + * + * + *
+   * Shielded Instance options.
+   * 
+ * + * .google.cloud.tpu.v2.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.v2.ShieldedInstanceConfig shielded_instance_config = 45; + * + * @return The shieldedInstanceConfig. + */ + @java.lang.Override + public com.google.cloud.tpu.v2.ShieldedInstanceConfig getShieldedInstanceConfig() { + return shieldedInstanceConfig_ == null + ? com.google.cloud.tpu.v2.ShieldedInstanceConfig.getDefaultInstance() + : shieldedInstanceConfig_; + } + /** + * + * + *
+   * Shielded Instance options.
+   * 
+ * + * .google.cloud.tpu.v2.ShieldedInstanceConfig shielded_instance_config = 45; + */ + @java.lang.Override + public com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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()); + } + getUnknownFields().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.v2.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.v2.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.v2.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 += getUnknownFields().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.v2.Node)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.Node other = (com.google.cloud.tpu.v2.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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.Node parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.Node parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.Node parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.Node parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.Node parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.Node} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.Node) + com.google.cloud.tpu.v2.NodeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_Node_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.Node.class, com.google.cloud.tpu.v2.Node.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.Node.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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(); + } else { + networkEndpoints_ = null; + networkEndpointsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + 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(); + } else { + dataDisks_ = null; + dataDisksBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + apiVersion_ = 0; + + if (symptomsBuilder_ == null) { + symptoms_ = java.util.Collections.emptyList(); + } else { + symptoms_ = null; + symptomsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + 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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_Node_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.Node getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.Node.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.Node build() { + com.google.cloud.tpu.v2.Node result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.Node buildPartial() { + com.google.cloud.tpu.v2.Node result = new com.google.cloud.tpu.v2.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.v2.Node) { + return mergeFrom((com.google.cloud.tpu.v2.Node) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.Node other) { + if (other == com.google.cloud.tpu.v2.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.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 26: + { + description_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 42: + { + acceleratorType_ = input.readStringRequireUtf8(); + + break; + } // case 42 + case 72: + { + state_ = input.readEnum(); + + break; + } // case 72 + case 82: + { + healthDescription_ = input.readStringRequireUtf8(); + + break; + } // case 82 + case 90: + { + runtimeVersion_ = input.readStringRequireUtf8(); + + break; + } // case 90 + case 106: + { + cidrBlock_ = input.readStringRequireUtf8(); + + break; + } // case 106 + case 130: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 130 + case 138: + { + input.readMessage( + getSchedulingConfigFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 138 + case 170: + { + com.google.cloud.tpu.v2.NetworkEndpoint m = + input.readMessage( + com.google.cloud.tpu.v2.NetworkEndpoint.parser(), extensionRegistry); + if (networkEndpointsBuilder_ == null) { + ensureNetworkEndpointsIsMutable(); + networkEndpoints_.add(m); + } else { + networkEndpointsBuilder_.addMessage(m); + } + break; + } // case 170 + case 176: + { + health_ = input.readEnum(); + + break; + } // case 176 + case 194: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + break; + } // case 194 + case 264: + { + id_ = input.readInt64(); + + break; + } // case 264 + case 274: + { + com.google.protobuf.MapEntry metadata__ = + input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableMetadata() + .getMutableMap() + .put(metadata__.getKey(), metadata__.getValue()); + break; + } // case 274 + case 290: + { + input.readMessage(getNetworkConfigFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 290 + case 298: + { + input.readMessage(getServiceAccountFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 298 + case 304: + { + apiVersion_ = input.readEnum(); + + break; + } // case 304 + case 314: + { + com.google.cloud.tpu.v2.Symptom m = + input.readMessage(com.google.cloud.tpu.v2.Symptom.parser(), extensionRegistry); + if (symptomsBuilder_ == null) { + ensureSymptomsIsMutable(); + symptoms_.add(m); + } else { + symptomsBuilder_.addMessage(m); + } + break; + } // case 314 + case 322: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureTagsIsMutable(); + tags_.add(s); + break; + } // case 322 + case 330: + { + com.google.cloud.tpu.v2.AttachedDisk m = + input.readMessage( + com.google.cloud.tpu.v2.AttachedDisk.parser(), extensionRegistry); + if (dataDisksBuilder_ == null) { + ensureDataDisksIsMutable(); + dataDisks_.add(m); + } else { + dataDisksBuilder_.addMessage(m); + } + break; + } // case 330 + case 362: + { + input.readMessage( + getShieldedInstanceConfigFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 362 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.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.v2.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.v2.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.tpu.v2.Node.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v2.Node.State result = + com.google.cloud.tpu.v2.Node.State.valueOf(state_); + return result == null ? com.google.cloud.tpu.v2.Node.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The current state for the TPU Node.
+     * 
+ * + * .google.cloud.tpu.v2.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.v2.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.v2.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.v2.NetworkConfig networkConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.NetworkConfig, + com.google.cloud.tpu.v2.NetworkConfig.Builder, + com.google.cloud.tpu.v2.NetworkConfigOrBuilder> + networkConfigBuilder_; + /** + * + * + *
+     * Network configurations for the TPU node.
+     * 
+ * + * .google.cloud.tpu.v2.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.v2.NetworkConfig network_config = 36; + * + * @return The networkConfig. + */ + public com.google.cloud.tpu.v2.NetworkConfig getNetworkConfig() { + if (networkConfigBuilder_ == null) { + return networkConfig_ == null + ? com.google.cloud.tpu.v2.NetworkConfig.getDefaultInstance() + : networkConfig_; + } else { + return networkConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Network configurations for the TPU node.
+     * 
+ * + * .google.cloud.tpu.v2.NetworkConfig network_config = 36; + */ + public Builder setNetworkConfig(com.google.cloud.tpu.v2.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.v2.NetworkConfig network_config = 36; + */ + public Builder setNetworkConfig(com.google.cloud.tpu.v2.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.v2.NetworkConfig network_config = 36; + */ + public Builder mergeNetworkConfig(com.google.cloud.tpu.v2.NetworkConfig value) { + if (networkConfigBuilder_ == null) { + if (networkConfig_ != null) { + networkConfig_ = + com.google.cloud.tpu.v2.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.v2.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.v2.NetworkConfig network_config = 36; + */ + public com.google.cloud.tpu.v2.NetworkConfig.Builder getNetworkConfigBuilder() { + + onChanged(); + return getNetworkConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Network configurations for the TPU node.
+     * 
+ * + * .google.cloud.tpu.v2.NetworkConfig network_config = 36; + */ + public com.google.cloud.tpu.v2.NetworkConfigOrBuilder getNetworkConfigOrBuilder() { + if (networkConfigBuilder_ != null) { + return networkConfigBuilder_.getMessageOrBuilder(); + } else { + return networkConfig_ == null + ? com.google.cloud.tpu.v2.NetworkConfig.getDefaultInstance() + : networkConfig_; + } + } + /** + * + * + *
+     * Network configurations for the TPU node.
+     * 
+ * + * .google.cloud.tpu.v2.NetworkConfig network_config = 36; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.NetworkConfig, + com.google.cloud.tpu.v2.NetworkConfig.Builder, + com.google.cloud.tpu.v2.NetworkConfigOrBuilder> + getNetworkConfigFieldBuilder() { + if (networkConfigBuilder_ == null) { + networkConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.NetworkConfig, + com.google.cloud.tpu.v2.NetworkConfig.Builder, + com.google.cloud.tpu.v2.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.v2.ServiceAccount serviceAccount_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.ServiceAccount, + com.google.cloud.tpu.v2.ServiceAccount.Builder, + com.google.cloud.tpu.v2.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.v2.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.v2.ServiceAccount service_account = 37; + * + * @return The serviceAccount. + */ + public com.google.cloud.tpu.v2.ServiceAccount getServiceAccount() { + if (serviceAccountBuilder_ == null) { + return serviceAccount_ == null + ? com.google.cloud.tpu.v2.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.v2.ServiceAccount service_account = 37; + */ + public Builder setServiceAccount(com.google.cloud.tpu.v2.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.v2.ServiceAccount service_account = 37; + */ + public Builder setServiceAccount( + com.google.cloud.tpu.v2.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.v2.ServiceAccount service_account = 37; + */ + public Builder mergeServiceAccount(com.google.cloud.tpu.v2.ServiceAccount value) { + if (serviceAccountBuilder_ == null) { + if (serviceAccount_ != null) { + serviceAccount_ = + com.google.cloud.tpu.v2.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.v2.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.v2.ServiceAccount service_account = 37; + */ + public com.google.cloud.tpu.v2.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.v2.ServiceAccount service_account = 37; + */ + public com.google.cloud.tpu.v2.ServiceAccountOrBuilder getServiceAccountOrBuilder() { + if (serviceAccountBuilder_ != null) { + return serviceAccountBuilder_.getMessageOrBuilder(); + } else { + return serviceAccount_ == null + ? com.google.cloud.tpu.v2.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.v2.ServiceAccount service_account = 37; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.ServiceAccount, + com.google.cloud.tpu.v2.ServiceAccount.Builder, + com.google.cloud.tpu.v2.ServiceAccountOrBuilder> + getServiceAccountFieldBuilder() { + if (serviceAccountBuilder_ == null) { + serviceAccountBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.ServiceAccount, + com.google.cloud.tpu.v2.ServiceAccount.Builder, + com.google.cloud.tpu.v2.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.v2.SchedulingConfig schedulingConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.SchedulingConfig, + com.google.cloud.tpu.v2.SchedulingConfig.Builder, + com.google.cloud.tpu.v2.SchedulingConfigOrBuilder> + schedulingConfigBuilder_; + /** + * + * + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v2.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.v2.SchedulingConfig scheduling_config = 17; + * + * @return The schedulingConfig. + */ + public com.google.cloud.tpu.v2.SchedulingConfig getSchedulingConfig() { + if (schedulingConfigBuilder_ == null) { + return schedulingConfig_ == null + ? com.google.cloud.tpu.v2.SchedulingConfig.getDefaultInstance() + : schedulingConfig_; + } else { + return schedulingConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v2.SchedulingConfig scheduling_config = 17; + */ + public Builder setSchedulingConfig(com.google.cloud.tpu.v2.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.v2.SchedulingConfig scheduling_config = 17; + */ + public Builder setSchedulingConfig( + com.google.cloud.tpu.v2.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.v2.SchedulingConfig scheduling_config = 17; + */ + public Builder mergeSchedulingConfig(com.google.cloud.tpu.v2.SchedulingConfig value) { + if (schedulingConfigBuilder_ == null) { + if (schedulingConfig_ != null) { + schedulingConfig_ = + com.google.cloud.tpu.v2.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.v2.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.v2.SchedulingConfig scheduling_config = 17; + */ + public com.google.cloud.tpu.v2.SchedulingConfig.Builder getSchedulingConfigBuilder() { + + onChanged(); + return getSchedulingConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v2.SchedulingConfig scheduling_config = 17; + */ + public com.google.cloud.tpu.v2.SchedulingConfigOrBuilder getSchedulingConfigOrBuilder() { + if (schedulingConfigBuilder_ != null) { + return schedulingConfigBuilder_.getMessageOrBuilder(); + } else { + return schedulingConfig_ == null + ? com.google.cloud.tpu.v2.SchedulingConfig.getDefaultInstance() + : schedulingConfig_; + } + } + /** + * + * + *
+     * The scheduling options for this node.
+     * 
+ * + * .google.cloud.tpu.v2.SchedulingConfig scheduling_config = 17; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.SchedulingConfig, + com.google.cloud.tpu.v2.SchedulingConfig.Builder, + com.google.cloud.tpu.v2.SchedulingConfigOrBuilder> + getSchedulingConfigFieldBuilder() { + if (schedulingConfigBuilder_ == null) { + schedulingConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.SchedulingConfig, + com.google.cloud.tpu.v2.SchedulingConfig.Builder, + com.google.cloud.tpu.v2.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.v2.NetworkEndpoint, + com.google.cloud.tpu.v2.NetworkEndpoint.Builder, + com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v2.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.v2.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNetworkEndpoints(int index, com.google.cloud.tpu.v2.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.v2.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNetworkEndpoints( + int index, com.google.cloud.tpu.v2.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.v2.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNetworkEndpoints(com.google.cloud.tpu.v2.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.v2.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNetworkEndpoints(int index, com.google.cloud.tpu.v2.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.v2.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNetworkEndpoints( + com.google.cloud.tpu.v2.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.v2.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNetworkEndpoints( + int index, com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v2.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.v2.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v2.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.v2.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.v2.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v2.NetworkEndpoint.Builder addNetworkEndpointsBuilder() { + return getNetworkEndpointsFieldBuilder() + .addBuilder(com.google.cloud.tpu.v2.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.v2.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v2.NetworkEndpoint.Builder addNetworkEndpointsBuilder(int index) { + return getNetworkEndpointsFieldBuilder() + .addBuilder(index, com.google.cloud.tpu.v2.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.v2.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.v2.NetworkEndpoint, + com.google.cloud.tpu.v2.NetworkEndpoint.Builder, + com.google.cloud.tpu.v2.NetworkEndpointOrBuilder> + getNetworkEndpointsFieldBuilder() { + if (networkEndpointsBuilder_ == null) { + networkEndpointsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2.NetworkEndpoint, + com.google.cloud.tpu.v2.NetworkEndpoint.Builder, + com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.Node.Health health = 22; + * + * @return The health. + */ + @java.lang.Override + public com.google.cloud.tpu.v2.Node.Health getHealth() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v2.Node.Health result = + com.google.cloud.tpu.v2.Node.Health.valueOf(health_); + return result == null ? com.google.cloud.tpu.v2.Node.Health.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The health status of the TPU node.
+     * 
+ * + * .google.cloud.tpu.v2.Node.Health health = 22; + * + * @param value The health to set. + * @return This builder for chaining. + */ + public Builder setHealth(com.google.cloud.tpu.v2.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.v2.Node.Health health = 22; + * + * @return This builder for chaining. + */ + public Builder clearHealth() { + + health_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Resource labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 24; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new 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 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.v2.AttachedDisk, + com.google.cloud.tpu.v2.AttachedDisk.Builder, + com.google.cloud.tpu.v2.AttachedDiskOrBuilder> + dataDisksBuilder_; + + /** + * + * + *
+     * The additional data disks for the Node.
+     * 
+ * + * repeated .google.cloud.tpu.v2.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.v2.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.v2.AttachedDisk data_disks = 41; + */ + public com.google.cloud.tpu.v2.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.v2.AttachedDisk data_disks = 41; + */ + public Builder setDataDisks(int index, com.google.cloud.tpu.v2.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.v2.AttachedDisk data_disks = 41; + */ + public Builder setDataDisks( + int index, com.google.cloud.tpu.v2.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.v2.AttachedDisk data_disks = 41; + */ + public Builder addDataDisks(com.google.cloud.tpu.v2.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.v2.AttachedDisk data_disks = 41; + */ + public Builder addDataDisks(int index, com.google.cloud.tpu.v2.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.v2.AttachedDisk data_disks = 41; + */ + public Builder addDataDisks(com.google.cloud.tpu.v2.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.v2.AttachedDisk data_disks = 41; + */ + public Builder addDataDisks( + int index, com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.AttachedDisk data_disks = 41; + */ + public com.google.cloud.tpu.v2.AttachedDisk.Builder getDataDisksBuilder(int index) { + return getDataDisksFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The additional data disks for the Node.
+     * 
+ * + * repeated .google.cloud.tpu.v2.AttachedDisk data_disks = 41; + */ + public com.google.cloud.tpu.v2.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.v2.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.v2.AttachedDisk data_disks = 41; + */ + public com.google.cloud.tpu.v2.AttachedDisk.Builder addDataDisksBuilder() { + return getDataDisksFieldBuilder() + .addBuilder(com.google.cloud.tpu.v2.AttachedDisk.getDefaultInstance()); + } + /** + * + * + *
+     * The additional data disks for the Node.
+     * 
+ * + * repeated .google.cloud.tpu.v2.AttachedDisk data_disks = 41; + */ + public com.google.cloud.tpu.v2.AttachedDisk.Builder addDataDisksBuilder(int index) { + return getDataDisksFieldBuilder() + .addBuilder(index, com.google.cloud.tpu.v2.AttachedDisk.getDefaultInstance()); + } + /** + * + * + *
+     * The additional data disks for the Node.
+     * 
+ * + * repeated .google.cloud.tpu.v2.AttachedDisk data_disks = 41; + */ + public java.util.List getDataDisksBuilderList() { + return getDataDisksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2.AttachedDisk, + com.google.cloud.tpu.v2.AttachedDisk.Builder, + com.google.cloud.tpu.v2.AttachedDiskOrBuilder> + getDataDisksFieldBuilder() { + if (dataDisksBuilder_ == null) { + dataDisksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2.AttachedDisk, + com.google.cloud.tpu.v2.AttachedDisk.Builder, + com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The apiVersion. + */ + @java.lang.Override + public com.google.cloud.tpu.v2.Node.ApiVersion getApiVersion() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v2.Node.ApiVersion result = + com.google.cloud.tpu.v2.Node.ApiVersion.valueOf(apiVersion_); + return result == null ? com.google.cloud.tpu.v2.Node.ApiVersion.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The API version that created this Node.
+     * 
+ * + * + * .google.cloud.tpu.v2.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.v2.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.v2.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.v2.Symptom, + com.google.cloud.tpu.v2.Symptom.Builder, + com.google.cloud.tpu.v2.SymptomOrBuilder> + symptomsBuilder_; + + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2.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.v2.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.v2.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v2.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.v2.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSymptoms(int index, com.google.cloud.tpu.v2.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.v2.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSymptoms(int index, com.google.cloud.tpu.v2.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.v2.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addSymptoms(com.google.cloud.tpu.v2.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.v2.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addSymptoms(int index, com.google.cloud.tpu.v2.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.v2.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addSymptoms(com.google.cloud.tpu.v2.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.v2.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addSymptoms(int index, com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v2.Symptom.Builder getSymptomsBuilder(int index) { + return getSymptomsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v2.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.v2.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.v2.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v2.Symptom.Builder addSymptomsBuilder() { + return getSymptomsFieldBuilder() + .addBuilder(com.google.cloud.tpu.v2.Symptom.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v2.Symptom.Builder addSymptomsBuilder(int index) { + return getSymptomsFieldBuilder() + .addBuilder(index, com.google.cloud.tpu.v2.Symptom.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. The Symptoms that have occurred to the TPU Node.
+     * 
+ * + * + * repeated .google.cloud.tpu.v2.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.v2.Symptom, + com.google.cloud.tpu.v2.Symptom.Builder, + com.google.cloud.tpu.v2.SymptomOrBuilder> + getSymptomsFieldBuilder() { + if (symptomsBuilder_ == null) { + symptomsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2.Symptom, + com.google.cloud.tpu.v2.Symptom.Builder, + com.google.cloud.tpu.v2.SymptomOrBuilder>( + symptoms_, ((bitField0_ & 0x00000020) != 0), getParentForChildren(), isClean()); + symptoms_ = null; + } + return symptomsBuilder_; + } + + private com.google.cloud.tpu.v2.ShieldedInstanceConfig shieldedInstanceConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.ShieldedInstanceConfig, + com.google.cloud.tpu.v2.ShieldedInstanceConfig.Builder, + com.google.cloud.tpu.v2.ShieldedInstanceConfigOrBuilder> + shieldedInstanceConfigBuilder_; + /** + * + * + *
+     * Shielded Instance options.
+     * 
+ * + * .google.cloud.tpu.v2.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.v2.ShieldedInstanceConfig shielded_instance_config = 45; + * + * @return The shieldedInstanceConfig. + */ + public com.google.cloud.tpu.v2.ShieldedInstanceConfig getShieldedInstanceConfig() { + if (shieldedInstanceConfigBuilder_ == null) { + return shieldedInstanceConfig_ == null + ? com.google.cloud.tpu.v2.ShieldedInstanceConfig.getDefaultInstance() + : shieldedInstanceConfig_; + } else { + return shieldedInstanceConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Shielded Instance options.
+     * 
+ * + * .google.cloud.tpu.v2.ShieldedInstanceConfig shielded_instance_config = 45; + */ + public Builder setShieldedInstanceConfig(com.google.cloud.tpu.v2.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.v2.ShieldedInstanceConfig shielded_instance_config = 45; + */ + public Builder setShieldedInstanceConfig( + com.google.cloud.tpu.v2.ShieldedInstanceConfig.Builder builderForValue) { + if (shieldedInstanceConfigBuilder_ == null) { + shieldedInstanceConfig_ = builderForValue.build(); + onChanged(); + } else { + shieldedInstanceConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Shielded Instance options.
+     * 
+ * + * .google.cloud.tpu.v2.ShieldedInstanceConfig shielded_instance_config = 45; + */ + public Builder mergeShieldedInstanceConfig( + com.google.cloud.tpu.v2.ShieldedInstanceConfig value) { + if (shieldedInstanceConfigBuilder_ == null) { + if (shieldedInstanceConfig_ != null) { + shieldedInstanceConfig_ = + com.google.cloud.tpu.v2.ShieldedInstanceConfig.newBuilder(shieldedInstanceConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + shieldedInstanceConfig_ = value; + } + onChanged(); + } else { + shieldedInstanceConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Shielded Instance options.
+     * 
+ * + * .google.cloud.tpu.v2.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.v2.ShieldedInstanceConfig shielded_instance_config = 45; + */ + public com.google.cloud.tpu.v2.ShieldedInstanceConfig.Builder + getShieldedInstanceConfigBuilder() { + + onChanged(); + return getShieldedInstanceConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Shielded Instance options.
+     * 
+ * + * .google.cloud.tpu.v2.ShieldedInstanceConfig shielded_instance_config = 45; + */ + public com.google.cloud.tpu.v2.ShieldedInstanceConfigOrBuilder + getShieldedInstanceConfigOrBuilder() { + if (shieldedInstanceConfigBuilder_ != null) { + return shieldedInstanceConfigBuilder_.getMessageOrBuilder(); + } else { + return shieldedInstanceConfig_ == null + ? com.google.cloud.tpu.v2.ShieldedInstanceConfig.getDefaultInstance() + : shieldedInstanceConfig_; + } + } + /** + * + * + *
+     * Shielded Instance options.
+     * 
+ * + * .google.cloud.tpu.v2.ShieldedInstanceConfig shielded_instance_config = 45; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.ShieldedInstanceConfig, + com.google.cloud.tpu.v2.ShieldedInstanceConfig.Builder, + com.google.cloud.tpu.v2.ShieldedInstanceConfigOrBuilder> + getShieldedInstanceConfigFieldBuilder() { + if (shieldedInstanceConfigBuilder_ == null) { + shieldedInstanceConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.ShieldedInstanceConfig, + com.google.cloud.tpu.v2.ShieldedInstanceConfig.Builder, + com.google.cloud.tpu.v2.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.v2.Node) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.Node) + private static final com.google.cloud.tpu.v2.Node DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.Node(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.Node getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/NodeName.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/NodeName.java new file mode 100644 index 000000000000..515bd4c164fe --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/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.v2; + +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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/NodeOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/NodeOrBuilder.java new file mode 100644 index 000000000000..7a4fff924999 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/NodeOrBuilder.java @@ -0,0 +1,833 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface NodeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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.v2.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.v2.Node.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.tpu.v2.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.v2.NetworkConfig network_config = 36; + * + * @return Whether the networkConfig field is set. + */ + boolean hasNetworkConfig(); + /** + * + * + *
+   * Network configurations for the TPU node.
+   * 
+ * + * .google.cloud.tpu.v2.NetworkConfig network_config = 36; + * + * @return The networkConfig. + */ + com.google.cloud.tpu.v2.NetworkConfig getNetworkConfig(); + /** + * + * + *
+   * Network configurations for the TPU node.
+   * 
+ * + * .google.cloud.tpu.v2.NetworkConfig network_config = 36; + */ + com.google.cloud.tpu.v2.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.v2.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.v2.ServiceAccount service_account = 37; + * + * @return The serviceAccount. + */ + com.google.cloud.tpu.v2.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.v2.ServiceAccount service_account = 37; + */ + com.google.cloud.tpu.v2.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.v2.SchedulingConfig scheduling_config = 17; + * + * @return Whether the schedulingConfig field is set. + */ + boolean hasSchedulingConfig(); + /** + * + * + *
+   * The scheduling options for this node.
+   * 
+ * + * .google.cloud.tpu.v2.SchedulingConfig scheduling_config = 17; + * + * @return The schedulingConfig. + */ + com.google.cloud.tpu.v2.SchedulingConfig getSchedulingConfig(); + /** + * + * + *
+   * The scheduling options for this node.
+   * 
+ * + * .google.cloud.tpu.v2.SchedulingConfig scheduling_config = 17; + */ + com.google.cloud.tpu.v2.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.v2.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.v2.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.NetworkEndpoint network_endpoints = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.tpu.v2.NetworkEndpointOrBuilder getNetworkEndpointsOrBuilder(int index); + + /** + * + * + *
+   * The health status of the TPU node.
+   * 
+ * + * .google.cloud.tpu.v2.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.v2.Node.Health health = 22; + * + * @return The health. + */ + com.google.cloud.tpu.v2.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.v2.AttachedDisk data_disks = 41; + */ + java.util.List getDataDisksList(); + /** + * + * + *
+   * The additional data disks for the Node.
+   * 
+ * + * repeated .google.cloud.tpu.v2.AttachedDisk data_disks = 41; + */ + com.google.cloud.tpu.v2.AttachedDisk getDataDisks(int index); + /** + * + * + *
+   * The additional data disks for the Node.
+   * 
+ * + * repeated .google.cloud.tpu.v2.AttachedDisk data_disks = 41; + */ + int getDataDisksCount(); + /** + * + * + *
+   * The additional data disks for the Node.
+   * 
+ * + * repeated .google.cloud.tpu.v2.AttachedDisk data_disks = 41; + */ + java.util.List + getDataDisksOrBuilderList(); + /** + * + * + *
+   * The additional data disks for the Node.
+   * 
+ * + * repeated .google.cloud.tpu.v2.AttachedDisk data_disks = 41; + */ + com.google.cloud.tpu.v2.AttachedDiskOrBuilder getDataDisksOrBuilder(int index); + + /** + * + * + *
+   * Output only. The API version that created this Node.
+   * 
+ * + * + * .google.cloud.tpu.v2.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.v2.Node.ApiVersion api_version = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The apiVersion. + */ + com.google.cloud.tpu.v2.Node.ApiVersion getApiVersion(); + + /** + * + * + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * + * repeated .google.cloud.tpu.v2.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.v2.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.tpu.v2.Symptom getSymptoms(int index); + /** + * + * + *
+   * Output only. The Symptoms that have occurred to the TPU Node.
+   * 
+ * + * + * repeated .google.cloud.tpu.v2.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.v2.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.v2.Symptom symptoms = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.tpu.v2.SymptomOrBuilder getSymptomsOrBuilder(int index); + + /** + * + * + *
+   * Shielded Instance options.
+   * 
+ * + * .google.cloud.tpu.v2.ShieldedInstanceConfig shielded_instance_config = 45; + * + * @return Whether the shieldedInstanceConfig field is set. + */ + boolean hasShieldedInstanceConfig(); + /** + * + * + *
+   * Shielded Instance options.
+   * 
+ * + * .google.cloud.tpu.v2.ShieldedInstanceConfig shielded_instance_config = 45; + * + * @return The shieldedInstanceConfig. + */ + com.google.cloud.tpu.v2.ShieldedInstanceConfig getShieldedInstanceConfig(); + /** + * + * + *
+   * Shielded Instance options.
+   * 
+ * + * .google.cloud.tpu.v2.ShieldedInstanceConfig shielded_instance_config = 45; + */ + com.google.cloud.tpu.v2.ShieldedInstanceConfigOrBuilder getShieldedInstanceConfigOrBuilder(); +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/OperationMetadata.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/OperationMetadata.java new file mode 100644 index 000000000000..3e108d545c8f --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/OperationMetadata.java @@ -0,0 +1,1768 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * Metadata describing an [Operation][google.longrunning.Operation]
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.OperationMetadata.class, + com.google.cloud.tpu.v2.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_); + } + getUnknownFields().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 += getUnknownFields().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.v2.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.OperationMetadata other = + (com.google.cloud.tpu.v2.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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.OperationMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.OperationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.OperationMetadata) + com.google.cloud.tpu.v2.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.OperationMetadata.class, + com.google.cloud.tpu.v2.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.OperationMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.OperationMetadata build() { + com.google.cloud.tpu.v2.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.OperationMetadata buildPartial() { + com.google.cloud.tpu.v2.OperationMetadata result = + new com.google.cloud.tpu.v2.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.v2.OperationMetadata) { + return mergeFrom((com.google.cloud.tpu.v2.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.OperationMetadata other) { + if (other == com.google.cloud.tpu.v2.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.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + target_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 34: + { + verb_ = input.readStringRequireUtf8(); + + break; + } // case 34 + case 42: + { + statusDetail_ = input.readStringRequireUtf8(); + + break; + } // case 42 + case 48: + { + cancelRequested_ = input.readBool(); + + break; + } // case 48 + case 58: + { + apiVersion_ = input.readStringRequireUtf8(); + + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.OperationMetadata) + private static final com.google.cloud.tpu.v2.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.OperationMetadata(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/OperationMetadataOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..016c8388fb32 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/OperationMetadataOrBuilder.java @@ -0,0 +1,210 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/RuntimeVersion.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/RuntimeVersion.java new file mode 100644 index 000000000000..4311b9619c67 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/RuntimeVersion.java @@ -0,0 +1,791 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * A runtime version that a Node can be configured with.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.RuntimeVersion} + */ +public final class RuntimeVersion extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_RuntimeVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_RuntimeVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.RuntimeVersion.class, + com.google.cloud.tpu.v2.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_); + } + getUnknownFields().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 += getUnknownFields().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.v2.RuntimeVersion)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.RuntimeVersion other = (com.google.cloud.tpu.v2.RuntimeVersion) obj; + + if (!getName().equals(other.getName())) return false; + if (!getVersion().equals(other.getVersion())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.RuntimeVersion parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.RuntimeVersion parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.RuntimeVersion parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.RuntimeVersion parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.RuntimeVersion parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.RuntimeVersion} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.RuntimeVersion) + com.google.cloud.tpu.v2.RuntimeVersionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_RuntimeVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_RuntimeVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.RuntimeVersion.class, + com.google.cloud.tpu.v2.RuntimeVersion.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.RuntimeVersion.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_RuntimeVersion_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.RuntimeVersion getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.RuntimeVersion.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.RuntimeVersion build() { + com.google.cloud.tpu.v2.RuntimeVersion result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.RuntimeVersion buildPartial() { + com.google.cloud.tpu.v2.RuntimeVersion result = + new com.google.cloud.tpu.v2.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.v2.RuntimeVersion) { + return mergeFrom((com.google.cloud.tpu.v2.RuntimeVersion) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.RuntimeVersion other) { + if (other == com.google.cloud.tpu.v2.RuntimeVersion.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + version_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.RuntimeVersion) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.RuntimeVersion) + private static final com.google.cloud.tpu.v2.RuntimeVersion DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.RuntimeVersion(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.RuntimeVersion getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/RuntimeVersionName.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/RuntimeVersionName.java new file mode 100644 index 000000000000..71b9613090dd --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/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.v2; + +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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/RuntimeVersionOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/RuntimeVersionOrBuilder.java new file mode 100644 index 000000000000..aef8c1340299 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/RuntimeVersionOrBuilder.java @@ -0,0 +1,75 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface RuntimeVersionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/SchedulingConfig.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/SchedulingConfig.java new file mode 100644 index 000000000000..e068fe5917a5 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/SchedulingConfig.java @@ -0,0 +1,616 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * Sets the scheduling options for this node.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.SchedulingConfig} + */ +public final class SchedulingConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_SchedulingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_SchedulingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.SchedulingConfig.class, + com.google.cloud.tpu.v2.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_); + } + getUnknownFields().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 += getUnknownFields().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.v2.SchedulingConfig)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.SchedulingConfig other = (com.google.cloud.tpu.v2.SchedulingConfig) obj; + + if (getPreemptible() != other.getPreemptible()) return false; + if (getReserved() != other.getReserved()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.SchedulingConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.SchedulingConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.SchedulingConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.SchedulingConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.SchedulingConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.SchedulingConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.SchedulingConfig) + com.google.cloud.tpu.v2.SchedulingConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_SchedulingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_SchedulingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.SchedulingConfig.class, + com.google.cloud.tpu.v2.SchedulingConfig.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.SchedulingConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_SchedulingConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.SchedulingConfig getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.SchedulingConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.SchedulingConfig build() { + com.google.cloud.tpu.v2.SchedulingConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.SchedulingConfig buildPartial() { + com.google.cloud.tpu.v2.SchedulingConfig result = + new com.google.cloud.tpu.v2.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.v2.SchedulingConfig) { + return mergeFrom((com.google.cloud.tpu.v2.SchedulingConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.SchedulingConfig other) { + if (other == com.google.cloud.tpu.v2.SchedulingConfig.getDefaultInstance()) return this; + if (other.getPreemptible() != false) { + setPreemptible(other.getPreemptible()); + } + if (other.getReserved() != false) { + setReserved(other.getReserved()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + preemptible_ = input.readBool(); + + break; + } // case 8 + case 16: + { + reserved_ = input.readBool(); + + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.SchedulingConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.SchedulingConfig) + private static final com.google.cloud.tpu.v2.SchedulingConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.SchedulingConfig(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.SchedulingConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/SchedulingConfigOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/SchedulingConfigOrBuilder.java new file mode 100644 index 000000000000..096d097ca4b5 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/SchedulingConfigOrBuilder.java @@ -0,0 +1,51 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface SchedulingConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ServiceAccount.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ServiceAccount.java new file mode 100644 index 000000000000..fce15b9c8d6d --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ServiceAccount.java @@ -0,0 +1,906 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * A service account.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.ServiceAccount} + */ +public final class ServiceAccount extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ServiceAccount_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ServiceAccount_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.ServiceAccount.class, + com.google.cloud.tpu.v2.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)); + } + getUnknownFields().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 += getUnknownFields().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.v2.ServiceAccount)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.ServiceAccount other = (com.google.cloud.tpu.v2.ServiceAccount) obj; + + if (!getEmail().equals(other.getEmail())) return false; + if (!getScopeList().equals(other.getScopeList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.ServiceAccount parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ServiceAccount parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ServiceAccount parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ServiceAccount parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.ServiceAccount parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.ServiceAccount} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.ServiceAccount) + com.google.cloud.tpu.v2.ServiceAccountOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ServiceAccount_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ServiceAccount_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.ServiceAccount.class, + com.google.cloud.tpu.v2.ServiceAccount.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.ServiceAccount.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ServiceAccount_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ServiceAccount getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.ServiceAccount.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ServiceAccount build() { + com.google.cloud.tpu.v2.ServiceAccount result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ServiceAccount buildPartial() { + com.google.cloud.tpu.v2.ServiceAccount result = + new com.google.cloud.tpu.v2.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.v2.ServiceAccount) { + return mergeFrom((com.google.cloud.tpu.v2.ServiceAccount) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.ServiceAccount other) { + if (other == com.google.cloud.tpu.v2.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.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + email_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureScopeIsMutable(); + scope_.add(s); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.ServiceAccount) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.ServiceAccount) + private static final com.google.cloud.tpu.v2.ServiceAccount DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.ServiceAccount(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.ServiceAccount getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ServiceAccountOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ServiceAccountOrBuilder.java new file mode 100644 index 000000000000..c345475324a7 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ServiceAccountOrBuilder.java @@ -0,0 +1,107 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface ServiceAccountOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ServiceIdentity.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ServiceIdentity.java new file mode 100644 index 000000000000..f05cf2c82289 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ServiceIdentity.java @@ -0,0 +1,613 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * The per-product per-project service identity for Cloud TPU service.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.ServiceIdentity} + */ +public final class ServiceIdentity extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ServiceIdentity_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ServiceIdentity_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.ServiceIdentity.class, + com.google.cloud.tpu.v2.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_); + } + getUnknownFields().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 += getUnknownFields().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.v2.ServiceIdentity)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.ServiceIdentity other = (com.google.cloud.tpu.v2.ServiceIdentity) obj; + + if (!getEmail().equals(other.getEmail())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.ServiceIdentity parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ServiceIdentity parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ServiceIdentity parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ServiceIdentity parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.ServiceIdentity parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.ServiceIdentity} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.ServiceIdentity) + com.google.cloud.tpu.v2.ServiceIdentityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ServiceIdentity_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ServiceIdentity_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.ServiceIdentity.class, + com.google.cloud.tpu.v2.ServiceIdentity.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.ServiceIdentity.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ServiceIdentity_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ServiceIdentity getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.ServiceIdentity.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ServiceIdentity build() { + com.google.cloud.tpu.v2.ServiceIdentity result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ServiceIdentity buildPartial() { + com.google.cloud.tpu.v2.ServiceIdentity result = + new com.google.cloud.tpu.v2.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.v2.ServiceIdentity) { + return mergeFrom((com.google.cloud.tpu.v2.ServiceIdentity) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.ServiceIdentity other) { + if (other == com.google.cloud.tpu.v2.ServiceIdentity.getDefaultInstance()) return this; + if (!other.getEmail().isEmpty()) { + email_ = other.email_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + email_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.ServiceIdentity) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.ServiceIdentity) + private static final com.google.cloud.tpu.v2.ServiceIdentity DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.ServiceIdentity(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.ServiceIdentity getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ServiceIdentityOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ServiceIdentityOrBuilder.java new file mode 100644 index 000000000000..35c32f670401 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ServiceIdentityOrBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface ServiceIdentityOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ShieldedInstanceConfig.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ShieldedInstanceConfig.java new file mode 100644 index 000000000000..389991695086 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ShieldedInstanceConfig.java @@ -0,0 +1,526 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * A set of Shielded Instance options.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.ShieldedInstanceConfig} + */ +public final class ShieldedInstanceConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ShieldedInstanceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ShieldedInstanceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.ShieldedInstanceConfig.class, + com.google.cloud.tpu.v2.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_); + } + getUnknownFields().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 += getUnknownFields().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.v2.ShieldedInstanceConfig)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.ShieldedInstanceConfig other = + (com.google.cloud.tpu.v2.ShieldedInstanceConfig) obj; + + if (getEnableSecureBoot() != other.getEnableSecureBoot()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.ShieldedInstanceConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ShieldedInstanceConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ShieldedInstanceConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.ShieldedInstanceConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.ShieldedInstanceConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.ShieldedInstanceConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.ShieldedInstanceConfig) + com.google.cloud.tpu.v2.ShieldedInstanceConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ShieldedInstanceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ShieldedInstanceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.ShieldedInstanceConfig.class, + com.google.cloud.tpu.v2.ShieldedInstanceConfig.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.ShieldedInstanceConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_ShieldedInstanceConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ShieldedInstanceConfig getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.ShieldedInstanceConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ShieldedInstanceConfig build() { + com.google.cloud.tpu.v2.ShieldedInstanceConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.ShieldedInstanceConfig buildPartial() { + com.google.cloud.tpu.v2.ShieldedInstanceConfig result = + new com.google.cloud.tpu.v2.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.v2.ShieldedInstanceConfig) { + return mergeFrom((com.google.cloud.tpu.v2.ShieldedInstanceConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.ShieldedInstanceConfig other) { + if (other == com.google.cloud.tpu.v2.ShieldedInstanceConfig.getDefaultInstance()) return this; + if (other.getEnableSecureBoot() != false) { + setEnableSecureBoot(other.getEnableSecureBoot()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + enableSecureBoot_ = input.readBool(); + + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.ShieldedInstanceConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.ShieldedInstanceConfig) + private static final com.google.cloud.tpu.v2.ShieldedInstanceConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.ShieldedInstanceConfig(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.ShieldedInstanceConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ShieldedInstanceConfigOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ShieldedInstanceConfigOrBuilder.java new file mode 100644 index 000000000000..59f73cb36744 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/ShieldedInstanceConfigOrBuilder.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface ShieldedInstanceConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/StartNodeRequest.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/StartNodeRequest.java new file mode 100644 index 000000000000..b4493e8e9905 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/StartNodeRequest.java @@ -0,0 +1,627 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * Request for [StartNode][google.cloud.tpu.v2.Tpu.StartNode].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.StartNodeRequest} + */ +public final class StartNodeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_StartNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_StartNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.StartNodeRequest.class, + com.google.cloud.tpu.v2.StartNodeRequest.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_); + } + getUnknownFields().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 += getUnknownFields().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.v2.StartNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.StartNodeRequest other = (com.google.cloud.tpu.v2.StartNodeRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.StartNodeRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.StartNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.StartNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.StartNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.StartNodeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.Tpu.StartNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.StartNodeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.StartNodeRequest) + com.google.cloud.tpu.v2.StartNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_StartNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_StartNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.StartNodeRequest.class, + com.google.cloud.tpu.v2.StartNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.StartNodeRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_StartNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.StartNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.StartNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.StartNodeRequest build() { + com.google.cloud.tpu.v2.StartNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.StartNodeRequest buildPartial() { + com.google.cloud.tpu.v2.StartNodeRequest result = + new com.google.cloud.tpu.v2.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.v2.StartNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v2.StartNodeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.StartNodeRequest other) { + if (other == com.google.cloud.tpu.v2.StartNodeRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.StartNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.StartNodeRequest) + private static final com.google.cloud.tpu.v2.StartNodeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.StartNodeRequest(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.StartNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/StartNodeRequestOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/StartNodeRequestOrBuilder.java new file mode 100644 index 000000000000..51ce756924c5 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/StartNodeRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface StartNodeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.StartNodeRequest) + 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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/StopNodeRequest.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/StopNodeRequest.java new file mode 100644 index 000000000000..1abc63012d53 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/StopNodeRequest.java @@ -0,0 +1,627 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * Request for [StopNode][google.cloud.tpu.v2.Tpu.StopNode].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.StopNodeRequest} + */ +public final class StopNodeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_StopNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_StopNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.StopNodeRequest.class, + com.google.cloud.tpu.v2.StopNodeRequest.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_); + } + getUnknownFields().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 += getUnknownFields().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.v2.StopNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.StopNodeRequest other = (com.google.cloud.tpu.v2.StopNodeRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.StopNodeRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.StopNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.StopNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.StopNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.StopNodeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.Tpu.StopNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.StopNodeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.StopNodeRequest) + com.google.cloud.tpu.v2.StopNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_StopNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_StopNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.StopNodeRequest.class, + com.google.cloud.tpu.v2.StopNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.StopNodeRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_StopNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.StopNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.StopNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.StopNodeRequest build() { + com.google.cloud.tpu.v2.StopNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.StopNodeRequest buildPartial() { + com.google.cloud.tpu.v2.StopNodeRequest result = + new com.google.cloud.tpu.v2.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.v2.StopNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v2.StopNodeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.StopNodeRequest other) { + if (other == com.google.cloud.tpu.v2.StopNodeRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.StopNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.StopNodeRequest) + private static final com.google.cloud.tpu.v2.StopNodeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.StopNodeRequest(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.StopNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/StopNodeRequestOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/StopNodeRequestOrBuilder.java new file mode 100644 index 000000000000..85a6ce1dd4f5 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/StopNodeRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface StopNodeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.StopNodeRequest) + 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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/Symptom.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/Symptom.java new file mode 100644 index 000000000000..10e7096ec9ef --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/Symptom.java @@ -0,0 +1,1449 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * A Symptom instance.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.Symptom} + */ +public final class Symptom extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_Symptom_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_Symptom_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.Symptom.class, com.google.cloud.tpu.v2.Symptom.Builder.class); + } + + /** + * + * + *
+   * SymptomType represents the different types of Symptoms that a TPU can be
+   * at.
+   * 
+ * + * Protobuf enum {@code google.cloud.tpu.v2.Symptom.SymptomType} + */ + public enum SymptomType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified symptom.
+     * 
+ * + * SYMPTOM_TYPE_UNSPECIFIED = 0; + */ + SYMPTOM_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * TPU VM memory is low.
+     * 
+ * + * LOW_MEMORY = 1; + */ + LOW_MEMORY(1), + /** + * + * + *
+     * TPU runtime is out of memory.
+     * 
+ * + * OUT_OF_MEMORY = 2; + */ + OUT_OF_MEMORY(2), + /** + * + * + *
+     * TPU runtime execution has timed out.
+     * 
+ * + * EXECUTE_TIMED_OUT = 3; + */ + EXECUTE_TIMED_OUT(3), + /** + * + * + *
+     * TPU runtime fails to construct a mesh that recognizes each TPU device's
+     * neighbors.
+     * 
+ * + * MESH_BUILD_FAIL = 4; + */ + MESH_BUILD_FAIL(4), + /** + * + * + *
+     * TPU HBM is out of memory.
+     * 
+ * + * HBM_OUT_OF_MEMORY = 5; + */ + HBM_OUT_OF_MEMORY(5), + /** + * + * + *
+     * Abusive behaviors have been identified on the current project.
+     * 
+ * + * PROJECT_ABUSE = 6; + */ + PROJECT_ABUSE(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified symptom.
+     * 
+ * + * SYMPTOM_TYPE_UNSPECIFIED = 0; + */ + public static final int SYMPTOM_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * TPU VM memory is low.
+     * 
+ * + * LOW_MEMORY = 1; + */ + public static final int LOW_MEMORY_VALUE = 1; + /** + * + * + *
+     * TPU runtime is out of memory.
+     * 
+ * + * OUT_OF_MEMORY = 2; + */ + public static final int OUT_OF_MEMORY_VALUE = 2; + /** + * + * + *
+     * TPU runtime execution has timed out.
+     * 
+ * + * EXECUTE_TIMED_OUT = 3; + */ + public static final int EXECUTE_TIMED_OUT_VALUE = 3; + /** + * + * + *
+     * TPU runtime fails to construct a mesh that recognizes each TPU device's
+     * neighbors.
+     * 
+ * + * MESH_BUILD_FAIL = 4; + */ + public static final int MESH_BUILD_FAIL_VALUE = 4; + /** + * + * + *
+     * TPU HBM is out of memory.
+     * 
+ * + * HBM_OUT_OF_MEMORY = 5; + */ + public static final int HBM_OUT_OF_MEMORY_VALUE = 5; + /** + * + * + *
+     * Abusive behaviors have been identified on the current project.
+     * 
+ * + * PROJECT_ABUSE = 6; + */ + public static final int PROJECT_ABUSE_VALUE = 6; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SymptomType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static SymptomType forNumber(int value) { + switch (value) { + case 0: + return SYMPTOM_TYPE_UNSPECIFIED; + case 1: + return LOW_MEMORY; + case 2: + return OUT_OF_MEMORY; + case 3: + return EXECUTE_TIMED_OUT; + case 4: + return MESH_BUILD_FAIL; + case 5: + return HBM_OUT_OF_MEMORY; + case 6: + return PROJECT_ABUSE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SymptomType findValueByNumber(int number) { + return SymptomType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.Symptom.SymptomType symptom_type = 2; + * + * @return The symptomType. + */ + @java.lang.Override + public com.google.cloud.tpu.v2.Symptom.SymptomType getSymptomType() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v2.Symptom.SymptomType result = + com.google.cloud.tpu.v2.Symptom.SymptomType.valueOf(symptomType_); + return result == null ? com.google.cloud.tpu.v2.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.v2.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_); + } + getUnknownFields().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.v2.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 += getUnknownFields().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.v2.Symptom)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.Symptom other = (com.google.cloud.tpu.v2.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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.Symptom parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.Symptom parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.Symptom parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.Symptom parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.Symptom parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.Symptom} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.Symptom) + com.google.cloud.tpu.v2.SymptomOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_Symptom_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_Symptom_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.Symptom.class, com.google.cloud.tpu.v2.Symptom.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.Symptom.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_Symptom_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.Symptom getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.Symptom.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.Symptom build() { + com.google.cloud.tpu.v2.Symptom result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.Symptom buildPartial() { + com.google.cloud.tpu.v2.Symptom result = new com.google.cloud.tpu.v2.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.v2.Symptom) { + return mergeFrom((com.google.cloud.tpu.v2.Symptom) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.Symptom other) { + if (other == com.google.cloud.tpu.v2.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.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 16: + { + symptomType_ = input.readEnum(); + + break; + } // case 16 + case 26: + { + details_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 34: + { + workerId_ = input.readStringRequireUtf8(); + + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.v2.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.v2.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.v2.Symptom.SymptomType symptom_type = 2; + * + * @return The symptomType. + */ + @java.lang.Override + public com.google.cloud.tpu.v2.Symptom.SymptomType getSymptomType() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v2.Symptom.SymptomType result = + com.google.cloud.tpu.v2.Symptom.SymptomType.valueOf(symptomType_); + return result == null ? com.google.cloud.tpu.v2.Symptom.SymptomType.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Type of the Symptom.
+     * 
+ * + * .google.cloud.tpu.v2.Symptom.SymptomType symptom_type = 2; + * + * @param value The symptomType to set. + * @return This builder for chaining. + */ + public Builder setSymptomType(com.google.cloud.tpu.v2.Symptom.SymptomType value) { + if (value == null) { + throw new NullPointerException(); + } + + symptomType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Type of the Symptom.
+     * 
+ * + * .google.cloud.tpu.v2.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.v2.Symptom) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.Symptom) + private static final com.google.cloud.tpu.v2.Symptom DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.Symptom(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.Symptom getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/SymptomOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/SymptomOrBuilder.java new file mode 100644 index 000000000000..211b9dfd87b4 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/SymptomOrBuilder.java @@ -0,0 +1,135 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface SymptomOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.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.v2.Symptom.SymptomType symptom_type = 2; + * + * @return The enum numeric value on the wire for symptomType. + */ + int getSymptomTypeValue(); + /** + * + * + *
+   * Type of the Symptom.
+   * 
+ * + * .google.cloud.tpu.v2.Symptom.SymptomType symptom_type = 2; + * + * @return The symptomType. + */ + com.google.cloud.tpu.v2.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/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/UpdateNodeRequest.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/UpdateNodeRequest.java new file mode 100644 index 000000000000..72884c40b9ec --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/UpdateNodeRequest.java @@ -0,0 +1,992 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +/** + * + * + *
+ * Request for [UpdateNode][google.cloud.tpu.v2.Tpu.UpdateNode].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.UpdateNodeRequest} + */ +public final class UpdateNodeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_UpdateNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_UpdateNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.UpdateNodeRequest.class, + com.google.cloud.tpu.v2.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: [description, tags, labels, metadata,
+   * network_config.enable_external_ips].
+   * 
+ * + * .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: [description, tags, labels, metadata,
+   * network_config.enable_external_ips].
+   * 
+ * + * .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: [description, tags, labels, metadata,
+   * network_config.enable_external_ips].
+   * 
+ * + * .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.v2.Node node_; + /** + * + * + *
+   * Required. The node. Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.tpu.v2.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.v2.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The node. + */ + @java.lang.Override + public com.google.cloud.tpu.v2.Node getNode() { + return node_ == null ? com.google.cloud.tpu.v2.Node.getDefaultInstance() : node_; + } + /** + * + * + *
+   * Required. The node. Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.tpu.v2.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.tpu.v2.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()); + } + getUnknownFields().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 += getUnknownFields().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.v2.UpdateNodeRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2.UpdateNodeRequest other = + (com.google.cloud.tpu.v2.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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2.UpdateNodeRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.UpdateNodeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.UpdateNodeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2.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.v2.UpdateNodeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.UpdateNodeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2.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.v2.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.v2.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.v2.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.v2.Tpu.UpdateNode].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2.UpdateNodeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2.UpdateNodeRequest) + com.google.cloud.tpu.v2.UpdateNodeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_UpdateNodeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_UpdateNodeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2.UpdateNodeRequest.class, + com.google.cloud.tpu.v2.UpdateNodeRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2.UpdateNodeRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.v2.CloudTpuProto + .internal_static_google_cloud_tpu_v2_UpdateNodeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.UpdateNodeRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2.UpdateNodeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2.UpdateNodeRequest build() { + com.google.cloud.tpu.v2.UpdateNodeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2.UpdateNodeRequest buildPartial() { + com.google.cloud.tpu.v2.UpdateNodeRequest result = + new com.google.cloud.tpu.v2.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.v2.UpdateNodeRequest) { + return mergeFrom((com.google.cloud.tpu.v2.UpdateNodeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2.UpdateNodeRequest other) { + if (other == com.google.cloud.tpu.v2.UpdateNodeRequest.getDefaultInstance()) return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasNode()) { + mergeNode(other.getNode()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getNodeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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: [description, tags, labels, metadata,
+     * network_config.enable_external_ips].
+     * 
+ * + * .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: [description, tags, labels, metadata,
+     * network_config.enable_external_ips].
+     * 
+ * + * .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: [description, tags, labels, metadata,
+     * network_config.enable_external_ips].
+     * 
+ * + * .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: [description, tags, labels, metadata,
+     * network_config.enable_external_ips].
+     * 
+ * + * .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: [description, tags, labels, metadata,
+     * network_config.enable_external_ips].
+     * 
+ * + * .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: [description, tags, labels, metadata,
+     * network_config.enable_external_ips].
+     * 
+ * + * .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: [description, tags, labels, metadata,
+     * network_config.enable_external_ips].
+     * 
+ * + * .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: [description, tags, labels, metadata,
+     * network_config.enable_external_ips].
+     * 
+ * + * .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: [description, tags, labels, metadata,
+     * network_config.enable_external_ips].
+     * 
+ * + * .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.v2.Node node_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.Node, + com.google.cloud.tpu.v2.Node.Builder, + com.google.cloud.tpu.v2.NodeOrBuilder> + nodeBuilder_; + /** + * + * + *
+     * Required. The node. Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.tpu.v2.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.v2.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The node. + */ + public com.google.cloud.tpu.v2.Node getNode() { + if (nodeBuilder_ == null) { + return node_ == null ? com.google.cloud.tpu.v2.Node.getDefaultInstance() : node_; + } else { + return nodeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The node. Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.tpu.v2.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setNode(com.google.cloud.tpu.v2.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.v2.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setNode(com.google.cloud.tpu.v2.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.v2.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeNode(com.google.cloud.tpu.v2.Node value) { + if (nodeBuilder_ == null) { + if (node_ != null) { + node_ = com.google.cloud.tpu.v2.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.v2.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.v2.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.tpu.v2.Node.Builder getNodeBuilder() { + + onChanged(); + return getNodeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The node. Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.tpu.v2.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.tpu.v2.NodeOrBuilder getNodeOrBuilder() { + if (nodeBuilder_ != null) { + return nodeBuilder_.getMessageOrBuilder(); + } else { + return node_ == null ? com.google.cloud.tpu.v2.Node.getDefaultInstance() : node_; + } + } + /** + * + * + *
+     * Required. The node. Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.tpu.v2.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.Node, + com.google.cloud.tpu.v2.Node.Builder, + com.google.cloud.tpu.v2.NodeOrBuilder> + getNodeFieldBuilder() { + if (nodeBuilder_ == null) { + nodeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2.Node, + com.google.cloud.tpu.v2.Node.Builder, + com.google.cloud.tpu.v2.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.v2.UpdateNodeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2.UpdateNodeRequest) + private static final com.google.cloud.tpu.v2.UpdateNodeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2.UpdateNodeRequest(); + } + + public static com.google.cloud.tpu.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.v2.UpdateNodeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/UpdateNodeRequestOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/UpdateNodeRequestOrBuilder.java new file mode 100644 index 000000000000..e896002d359c --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/java/com/google/cloud/tpu/v2/UpdateNodeRequestOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2/cloud_tpu.proto + +package com.google.cloud.tpu.v2; + +public interface UpdateNodeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2.UpdateNodeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Mask of fields from [Node][Tpu.Node] to update.
+   * Supported fields: [description, tags, labels, metadata,
+   * network_config.enable_external_ips].
+   * 
+ * + * .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: [description, tags, labels, metadata,
+   * network_config.enable_external_ips].
+   * 
+ * + * .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: [description, tags, labels, metadata,
+   * network_config.enable_external_ips].
+   * 
+ * + * .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.v2.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.v2.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The node. + */ + com.google.cloud.tpu.v2.Node getNode(); + /** + * + * + *
+   * Required. The node. Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.tpu.v2.Node node = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.tpu.v2.NodeOrBuilder getNodeOrBuilder(); +} diff --git a/java-tpu/proto-google-cloud-tpu-v2/src/main/proto/google/cloud/tpu/v2/cloud_tpu.proto b/java-tpu/proto-google-cloud-tpu-v2/src/main/proto/google/cloud/tpu/v2/cloud_tpu.proto new file mode 100644 index 000000000000..b99a2013c2d2 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2/src/main/proto/google/cloud/tpu/v2/cloud_tpu.proto @@ -0,0 +1,795 @@ +// 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.v2; + +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/v2;tpu"; +option java_multiple_files = true; +option java_outer_classname = "CloudTpuProto"; +option java_package = "com.google.cloud.tpu.v2"; + +// Manages TPU nodes and other resources +// +// TPU API v2 +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: "/v2/{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: "/v2/{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: "/v2/{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: "/v2/{name=projects/*/locations/*/nodes/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + 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: "/v2/{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: "/v2/{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: "/v2/{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: "/v2/{parent=projects/*/locations/*}:generateServiceIdentity" + body: "*" + }; + } + + // Lists accelerator types supported by this API. + rpc ListAcceleratorTypes(ListAcceleratorTypesRequest) returns (ListAcceleratorTypesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/locations/*}/acceleratorTypes" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets AcceleratorType. + rpc GetAcceleratorType(GetAcceleratorTypeRequest) returns (AcceleratorType) { + option (google.api.http) = { + get: "/v2/{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: "/v2/{parent=projects/*/locations/*}/runtimeVersions" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a runtime version. + rpc GetRuntimeVersion(GetRuntimeVersionRequest) returns (RuntimeVersion) { + option (google.api.http) = { + get: "/v2/{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: "/v2/{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; + + // Allows the TPU node to send and receive packets with non-matching + // destination or source IPs. This is required if you plan to use the TPU + // workers to forward routes. + bool can_ip_forward = 4; +} + +// 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; + + // TPU API V2 version. + V2 = 4; + } + + // 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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Tpu.StopNode]. +message StopNodeRequest { + // Required. The resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "tpu.googleapis.com/Node" + } + ]; +} + +// Request for [StartNode][google.cloud.tpu.v2.Tpu.StartNode]. +message StartNodeRequest { + // Required. The resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "tpu.googleapis.com/Node" + } + ]; +} + +// Request for [UpdateNode][google.cloud.tpu.v2.Tpu.UpdateNode]. +message UpdateNodeRequest { + // Required. Mask of fields from [Node][Tpu.Node] to update. + // Supported fields: [description, tags, labels, metadata, + // network_config.enable_external_ips]. + 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.v2.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.v2.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.v2.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.v2.Tpu.ListAcceleratorTypes]. +message ListAcceleratorTypesRequest { + // Required. The parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_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.v2.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; +} + +// 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.v2.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.v2.Tpu.ListRuntimeVersions]. +message ListRuntimeVersionsRequest { + // Required. The parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_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.v2.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; +} + +// 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; +} + +// Request for [GetGuestAttributes][google.cloud.tpu.v2.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.v2.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; +} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorType.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorType.java index 72c0ba09017e..609a2944f2d8 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorType.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorType.java @@ -123,7 +123,7 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-   * the accelerator type.
+   * The accelerator type.
    * 
* * string type = 2; @@ -146,7 +146,7 @@ public java.lang.String getType() { * * *
-   * the accelerator type.
+   * The accelerator type.
    * 
* * string type = 2; @@ -628,7 +628,7 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * * *
-     * the accelerator type.
+     * The accelerator type.
      * 
* * string type = 2; @@ -650,7 +650,7 @@ public java.lang.String getType() { * * *
-     * the accelerator type.
+     * The accelerator type.
      * 
* * string type = 2; @@ -672,7 +672,7 @@ public com.google.protobuf.ByteString getTypeBytes() { * * *
-     * the accelerator type.
+     * The accelerator type.
      * 
* * string type = 2; @@ -693,7 +693,7 @@ public Builder setType(java.lang.String value) { * * *
-     * the accelerator type.
+     * The accelerator type.
      * 
* * string type = 2; @@ -710,7 +710,7 @@ public Builder clearType() { * * *
-     * the accelerator type.
+     * The accelerator type.
      * 
* * string type = 2; diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorTypeOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorTypeOrBuilder.java index eec7e4782b8d..3379a907db8e 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorTypeOrBuilder.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/AcceleratorTypeOrBuilder.java @@ -52,7 +52,7 @@ public interface AcceleratorTypeOrBuilder * * *
-   * the accelerator type.
+   * The accelerator type.
    * 
* * string type = 2; @@ -64,7 +64,7 @@ public interface AcceleratorTypeOrBuilder * * *
-   * the accelerator type.
+   * The accelerator type.
    * 
* * string type = 2; diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CloudTpuProto.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CloudTpuProto.java index ec199bd8634f..61124130baca 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CloudTpuProto.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CloudTpuProto.java @@ -75,6 +75,66 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r 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_QueuedResource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_QueuedResource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_QueuedResource_Tpu_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_QueuedResource_Tpu_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_QueuedResource_Tpu_NodeSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_QueuedResource_Tpu_NodeSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_QueuedResource_BestEffort_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_QueuedResource_BestEffort_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_QueuedResource_Guaranteed_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_QueuedResource_Guaranteed_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_QueuedResource_QueueingPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_QueuedResource_QueueingPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_CreatingData_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_CreatingData_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_AcceptedData_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_AcceptedData_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_ProvisioningData_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_ProvisioningData_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_FailedData_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_FailedData_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_DeletingData_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_DeletingData_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_ActiveData_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_ActiveData_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_SuspendingData_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_SuspendingData_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_SuspendedData_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_SuspendedData_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_tpu_v2alpha1_ListNodesRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -107,6 +167,26 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r 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_ListQueuedResourcesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_ListQueuedResourcesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_ListQueuedResourcesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_ListQueuedResourcesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_GetQueuedResourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_GetQueuedResourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_CreateQueuedResourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_CreateQueuedResourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_tpu_v2alpha1_DeleteQueuedResourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_DeleteQueuedResourceRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_tpu_v2alpha1_ServiceIdentity_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -135,10 +215,6 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r 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 @@ -155,6 +231,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r 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_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_Symptom_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -167,6 +247,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r 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_SimulateMaintenanceEventRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_tpu_v2alpha1_SimulateMaintenanceEventRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_tpu_v2alpha1_ShieldedInstanceConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -185,210 +269,322 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "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\n\005items\030\001 \003" + + "(\0132/.google.cloud.tpu.v2alpha1.GuestAttr" + + "ibutesEntry\"E\n\024GuestAttributesEntry\022\021\n\tn" + + "amespace\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\004mode\030\004 \001(\01620.google.cloud.tpu.v2alph" + + "a1.AttachedDisk.DiskMode\"D\n\010DiskMode\022\031\n\025" + + "DISK_MODE_UNSPECIFIED\020\000\022\016\n\nREAD_WRITE\020\001\022" + + "\r\n\tREAD_ONLY\020\002\"9\n\020SchedulingConfig\022\023\n\013pr" + + "eemptible\030\001 \001(\010\022\020\n\010reserved\030\002 \001(\010\"s\n\017Net" + + "workEndpoint\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.c" + + "loud.tpu.v2alpha1.AccessConfig\"(\n\014Access" + + "Config\022\030\n\013external_ip\030\001 \001(\tB\003\340A\003\"i\n\rNetw" + + "orkConfig\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\022\026\n\016c" + + "an_ip_forward\030\004 \001(\010\".\n\016ServiceAccount\022\r\n" + + "\005email\030\001 \001(\t\022\r\n\005scope\030\002 \003(\t\"\211\r\n\004Node\022\024\n\004" + + "name\030\001 \001(\tB\006\340A\003\340A\005\022\023\n\013description\030\003 \001(\t\022" + + "\030\n\020accelerator_type\030\005 \001(\t\0229\n\005state\030\t \001(\016" + + "2%.google.cloud.tpu.v2alpha1.Node.StateB" + + "\003\340A\003\022\037\n\022health_description\030\n \001(\tB\003\340A\003\022\034\n" + + "\017runtime_version\030\013 \001(\tB\003\340A\002\022@\n\016network_c" + + "onfig\030$ \001(\0132(.google.cloud.tpu.v2alpha1." + + "NetworkConfig\022\022\n\ncidr_block\030\r \001(\t\022B\n\017ser" + + "vice_account\030% \001(\0132).google.cloud.tpu.v2" + + "alpha1.ServiceAccount\0224\n\013create_time\030\020 \001" + + "(\0132\032.google.protobuf.TimestampB\003\340A\003\022F\n\021s" + + "cheduling_config\030\021 \001(\0132+.google.cloud.tp" + + "u.v2alpha1.SchedulingConfig\022J\n\021network_e" + + "ndpoints\030\025 \003(\0132*.google.cloud.tpu.v2alph" + + "a1.NetworkEndpointB\003\340A\003\0226\n\006health\030\026 \001(\0162" + + "&.google.cloud.tpu.v2alpha1.Node.Health\022" + + ";\n\006labels\030\030 \003(\0132+.google.cloud.tpu.v2alp" + + "ha1.Node.LabelsEntry\022?\n\010metadata\030\" \003(\0132-" + + ".google.cloud.tpu.v2alpha1.Node.Metadata" + + "Entry\022\014\n\004tags\030( \003(\t\022\017\n\002id\030! \001(\003B\003\340A\003\022;\n\n" + + "data_disks\030) \003(\0132\'.google.cloud.tpu.v2al" + + "pha1.AttachedDisk\022D\n\013api_version\030& \001(\0162*" + + ".google.cloud.tpu.v2alpha1.Node.ApiVersi" + + "onB\003\340A\003\0229\n\010symptoms\030\' \003(\0132\".google.cloud" + + ".tpu.v2alpha1.SymptomB\003\340A\003\022\034\n\017queued_res" + + "ource\030+ \001(\tB\003\340A\003\022S\n\030shielded_instance_co" + + "nfig\030- \001(\01321.google.cloud.tpu.v2alpha1.S" + + "hieldedInstanceConfig\032-\n\013LabelsEntry\022\013\n\003" + + "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032/\n\rMetadata" + + "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\"o\n\006Health\022\026\n\022H" + + "EALTH_UNSPECIFIED\020\000\022\013\n\007HEALTHY\020\001\022\013\n\007TIME" + + "OUT\020\003\022\030\n\024UNHEALTHY_TENSORFLOW\020\004\022\031\n\025UNHEA" + + "LTHY_MAINTENANCE\020\005\"O\n\nApiVersion\022\033\n\027API_" + + "VERSION_UNSPECIFIED\020\000\022\r\n\tV1_ALPHA1\020\001\022\006\n\002" + + "V1\020\002\022\r\n\tV2_ALPHA1\020\003:R\352AO\n\027tpu.googleapis" + + ".com/Node\0224projects/{project}/locations/" + + "{location}/nodes/{node}\"\252\t\n\016QueuedResour" + + "ce\022\024\n\004name\030\001 \001(\tB\006\340A\003\340A\005\022<\n\003tpu\030\002 \001(\0132-." + + "google.cloud.tpu.v2alpha1.QueuedResource" + + ".TpuH\000\022K\n\013best_effort\030\003 \001(\01324.google.clo" + + "ud.tpu.v2alpha1.QueuedResource.BestEffor" + + "tH\001\022J\n\nguaranteed\030\004 \001(\01324.google.cloud.t" + + "pu.v2alpha1.QueuedResource.GuaranteedH\001\022" + + "Q\n\017queueing_policy\030\005 \001(\01328.google.cloud." + + "tpu.v2alpha1.QueuedResource.QueueingPoli" + + "cy\022B\n\005state\030\006 \001(\0132..google.cloud.tpu.v2a" + + "lpha1.QueuedResourceStateB\003\340A\003\032\335\001\n\003Tpu\022I" + + "\n\tnode_spec\030\001 \003(\01326.google.cloud.tpu.v2a" + + "lpha1.QueuedResource.Tpu.NodeSpec\032\212\001\n\010No" + + "deSpec\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!location" + + "s.googleapis.com/Location\022\017\n\007node_id\030\002 \001" + + "(\t\0222\n\004node\030\003 \001(\0132\037.google.cloud.tpu.v2al" + + "pha1.NodeB\003\340A\002\032\014\n\nBestEffort\032Y\n\nGuarante" + + "ed\0224\n\014min_duration\030\001 \001(\0132\031.google.protob" + + "uf.DurationB\003\340A\001\022\025\n\010reserved\030\002 \001(\010B\003\340A\001\032" + + "\303\002\n\016QueueingPolicy\0229\n\024valid_until_durati" + + "on\030\001 \001(\0132\031.google.protobuf.DurationH\000\0226\n" + + "\020valid_until_time\030\002 \001(\0132\032.google.protobu" + + "f.TimestampH\000\0229\n\024valid_after_duration\030\003 " + + "\001(\0132\031.google.protobuf.DurationH\000\0226\n\020vali" + + "d_after_time\030\004 \001(\0132\032.google.protobuf.Tim" + + "estampH\000\022/\n\016valid_interval\030\005 \001(\0132\025.googl" + + "e.type.IntervalH\000B\032\n\030start_timing_constr" + + "aints:q\352An\n!tpu.googleapis.com/QueuedRes" + + "ource\022Iprojects/{project}/locations/{loc" + + "ation}/queuedResources/{queued_resource}" + + "B\n\n\010resourceB\006\n\004tier\"\330\010\n\023QueuedResourceS" + + "tate\022C\n\005state\030\001 \001(\01624.google.cloud.tpu.v" + + "2alpha1.QueuedResourceState.State\022T\n\rcre" + + "ating_data\030\002 \001(\0132;.google.cloud.tpu.v2al" + + "pha1.QueuedResourceState.CreatingDataH\000\022" + + "T\n\raccepted_data\030\003 \001(\0132;.google.cloud.tp" + + "u.v2alpha1.QueuedResourceState.AcceptedD" + + "ataH\000\022\\\n\021provisioning_data\030\004 \001(\0132?.googl" + + "e.cloud.tpu.v2alpha1.QueuedResourceState" + + ".ProvisioningDataH\000\022P\n\013failed_data\030\005 \001(\013" + + "29.google.cloud.tpu.v2alpha1.QueuedResou" + + "rceState.FailedDataH\000\022T\n\rdeleting_data\030\006" + + " \001(\0132;.google.cloud.tpu.v2alpha1.QueuedR" + + "esourceState.DeletingDataH\000\022P\n\013active_da" + + "ta\030\007 \001(\01329.google.cloud.tpu.v2alpha1.Que" + + "uedResourceState.ActiveDataH\000\022X\n\017suspend" + + "ing_data\030\010 \001(\0132=.google.cloud.tpu.v2alph" + + "a1.QueuedResourceState.SuspendingDataH\000\022" + + "V\n\016suspended_data\030\t \001(\0132<.google.cloud.t" + + "pu.v2alpha1.QueuedResourceState.Suspende" + + "dDataH\000\032\016\n\014CreatingData\032\016\n\014AcceptedData\032" + + "\022\n\020ProvisioningData\032/\n\nFailedData\022!\n\005err" + + "or\030\001 \001(\0132\022.google.rpc.Status\032\016\n\014Deleting" + + "Data\032\014\n\nActiveData\032\020\n\016SuspendingData\032\017\n\r" + + "SuspendedData\"\221\001\n\005State\022\025\n\021STATE_UNSPECI" + + "FIED\020\000\022\014\n\010CREATING\020\001\022\014\n\010ACCEPTED\020\002\022\020\n\014PR" + + "OVISIONING\020\003\022\n\n\006FAILED\020\004\022\014\n\010DELETING\020\005\022\n" + + "\n\006ACTIVE\020\006\022\016\n\nSUSPENDING\020\007\022\r\n\tSUSPENDED\020" + + "\010B\014\n\nstate_data\"j\n\020ListNodesRequest\022/\n\006p" + + "arent\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\"q\n\021ListNodesResponse\022.\n\005nodes\030\001 \003(\0132" + + "\037.google.cloud.tpu.v2alpha1.Node\022\027\n\017next" + + "_page_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"?" + + "\n\016GetNodeRequest\022-\n\004name\030\001 \001(\tB\037\340A\002\372A\031\n\027" + + "tpu.googleapis.com/Node\"\247\001\n\021CreateNodeRe" + + "quest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!locations" + + ".googleapis.com/Location\022\017\n\007node_id\030\002 \001(" + + "\t\0222\n\004node\030\003 \001(\0132\037.google.cloud.tpu.v2alp" + + "ha1.NodeB\003\340A\002\022\022\n\nrequest_id\030\006 \001(\t\"V\n\021Del" + + "eteNodeRequest\022-\n\004name\030\001 \001(\tB\037\340A\002\372A\031\n\027tp" + + "u.googleapis.com/Node\022\022\n\nrequest_id\030\003 \001(" + + "\t\"@\n\017StopNodeRequest\022-\n\004name\030\001 \001(\tB\037\340A\002\372" + + "A\031\n\027tpu.googleapis.com/Node\"A\n\020StartNode" + + "Request\022-\n\004name\030\001 \001(\tB\037\340A\002\372A\031\n\027tpu.googl" + + "eapis.com/Node\"}\n\021UpdateNodeRequest\0224\n\013u" + + "pdate_mask\030\001 \001(\0132\032.google.protobuf.Field" + + "MaskB\003\340A\002\0222\n\004node\030\002 \001(\0132\037.google.cloud.t" + + "pu.v2alpha1.NodeB\003\340A\002\"~\n\032ListQueuedResou" + + "rcesRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\022!tpu" + + ".googleapis.com/QueuedResource\022\021\n\tpage_s" + + "ize\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"\220\001\n\033ListQu" + + "euedResourcesResponse\022C\n\020queued_resource" + + "s\030\001 \003(\0132).google.cloud.tpu.v2alpha1.Queu" + + "edResource\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013u" + + "nreachable\030\003 \003(\t\"S\n\030GetQueuedResourceReq" + + "uest\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n!tpu.googleap" + + "is.com/QueuedResource\"\321\001\n\033CreateQueuedRe" + + "sourceRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!l" + + "ocations.googleapis.com/Location\022\032\n\022queu" + + "ed_resource_id\030\002 \001(\t\022G\n\017queued_resource\030" + + "\003 \001(\0132).google.cloud.tpu.v2alpha1.Queued" + + "ResourceB\003\340A\002\022\022\n\nrequest_id\030\004 \001(\t\"j\n\033Del" + + "eteQueuedResourceRequest\0227\n\004name\030\001 \001(\tB)" + + "\340A\002\372A#\n!tpu.googleapis.com/QueuedResourc" + + "e\022\022\n\nrequest_id\030\002 \001(\t\" \n\017ServiceIdentity" + + "\022\r\n\005email\030\001 \001(\t\"[\n\036GenerateServiceIdenti" + + "tyRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!locat" + + "ions.googleapis.com/Location\"_\n\037Generate" + + "ServiceIdentityResponse\022<\n\010identity\030\001 \001(" + + "\0132*.google.cloud.tpu.v2alpha1.ServiceIde" + + "ntity\"\243\001\n\017AcceleratorType\022\014\n\004name\030\001 \001(\t\022" + + "\014\n\004type\030\002 \001(\t:t\352Aq\n\"tpu.googleapis.com/A" + + "cceleratorType\022Kprojects/{project}/locat" + + "ions/{location}/acceleratorTypes/{accele" + + "rator_type}\"U\n\031GetAcceleratorTypeRequest" + + "\0228\n\004name\030\001 \001(\tB*\340A\002\372A$\n\"tpu.googleapis.c" + + "om/AcceleratorType\"\242\001\n\033ListAcceleratorTy" + + "pesRequest\022:\n\006parent\030\001 \001(\tB*\340A\002\372A$\022\"tpu." + + "googleapis.com/AcceleratorType\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\034ListAccelera" + + "torTypesResponse\022E\n\021accelerator_types\030\001 " + + "\003(\0132*.google.cloud.tpu.v2alpha1.Accelera" + + "torType\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unre" + + "achable\030\003 \003(\t\"\242\001\n\016RuntimeVersion\022\014\n\004name" + + "\030\001 \001(\t\022\017\n\007version\030\002 \001(\t:q\352An\n!tpu.google" + + "apis.com/RuntimeVersion\022Iprojects/{proje" + + "ct}/locations/{location}/runtimeVersions" + + "/{runtime_version}\"S\n\030GetRuntimeVersionR" + + "equest\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n!tpu.google" + + "apis.com/RuntimeVersion\"\240\001\n\032ListRuntimeV" + + "ersionsRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\022!" + + "tpu.googleapis.com/RuntimeVersion\022\021\n\tpag" + + "e_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n\006filt" + + "er\030\005 \001(\t\022\020\n\010order_by\030\006 \001(\t\"\220\001\n\033ListRunti" + + "meVersionsResponse\022C\n\020runtime_versions\030\001" + + " \003(\0132).google.cloud.tpu.v2alpha1.Runtime" + + "Version\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unre" + + "achable\030\003 \003(\t\"\326\001\n\021OperationMetadata\022/\n\013c" + + "reate_time\030\001 \001(\0132\032.google.protobuf.Times" + + "tamp\022,\n\010end_time\030\002 \001(\0132\032.google.protobuf" + + ".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_reques" + + "ted\030\006 \001(\010\022\023\n\013api_version\030\007 \001(\t\"\313\002\n\007Sympt" + + "om\022/\n\013create_time\030\001 \001(\0132\032.google.protobu" + + "f.Timestamp\022D\n\014symptom_type\030\002 \001(\0162..goog" + + "le.cloud.tpu.v2alpha1.Symptom.SymptomTyp" + + "e\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_UNSPECIFIE" + + "D\020\000\022\016\n\nLOW_MEMORY\020\001\022\021\n\rOUT_OF_MEMORY\020\002\022\025" + + "\n\021EXECUTE_TIMED_OUT\020\003\022\023\n\017MESH_BUILD_FAIL" + + "\020\004\022\025\n\021HBM_OUT_OF_MEMORY\020\005\022\021\n\rPROJECT_ABU" + + "SE\020\006\"r\n\031GetGuestAttributesRequest\022-\n\004nam" + + "e\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_ids\030\003 \003(\t" + + "\"b\n\032GetGuestAttributesResponse\022D\n\020guest_" + + "attributes\030\001 \003(\0132*.google.cloud.tpu.v2al" + + "pha1.GuestAttributes\"d\n\037SimulateMaintena" + + "nceEventRequest\022-\n\004name\030\001 \001(\tB\037\340A\002\372A\031\n\027t" + + "pu.googleapis.com/Node\022\022\n\nworker_ids\030\002 \003" + + "(\t\"4\n\026ShieldedInstanceConfig\022\032\n\022enable_s" + + "ecure_boot\030\001 \001(\0102\267\035\n\003Tpu\022\250\001\n\tListNodes\022+" + + ".google.cloud.tpu.v2alpha1.ListNodesRequ" + + "est\032,.google.cloud.tpu.v2alpha1.ListNode" + + "sResponse\"@\202\323\344\223\0021\022//v2alpha1/{parent=pro" + + "jects/*/locations/*}/nodes\332A\006parent\022\225\001\n\007" + + "GetNode\022).google.cloud.tpu.v2alpha1.GetN" + + "odeRequest\032\037.google.cloud.tpu.v2alpha1.N" + + "ode\">\202\323\344\223\0021\022//v2alpha1/{name=projects/*/" + + "locations/*/nodes/*}\332A\004name\022\312\001\n\nCreateNo" + + "de\022,.google.cloud.tpu.v2alpha1.CreateNod" + + "eRequest\032\035.google.longrunning.Operation\"" + + "o\202\323\344\223\0027\"//v2alpha1/{parent=projects/*/lo" + + "cations/*}/nodes:\004node\332A\023parent,node,nod" + + "e_id\312A\031\n\004Node\022\021OperationMetadata\022\306\001\n\nDel" + + "eteNode\022,.google.cloud.tpu.v2alpha1.Dele" + + "teNodeRequest\032\035.google.longrunning.Opera" + + "tion\"k\202\323\344\223\0021*//v2alpha1/{name=projects/*" + + "/locations/*/nodes/*}\332A\004name\312A*\n\025google." + + "protobuf.Empty\022\021OperationMetadata\022\262\001\n\010St" + + "opNode\022*.google.cloud.tpu.v2alpha1.StopN" + + "odeRequest\032\035.google.longrunning.Operatio" + + "n\"[\202\323\344\223\0029\"4/v2alpha1/{name=projects/*/lo" + + "cations/*/nodes/*}:stop:\001*\312A\031\n\004Node\022\021Ope" + + "rationMetadata\022\265\001\n\tStartNode\022+.google.cl" + + "oud.tpu.v2alpha1.StartNodeRequest\032\035.goog" + + "le.longrunning.Operation\"\\\202\323\344\223\002:\"5/v2alp" + + "ha1/{name=projects/*/locations/*/nodes/*" + + "}:start:\001*\312A\031\n\004Node\022\021OperationMetadata\022\314" + + "\001\n\nUpdateNode\022,.google.cloud.tpu.v2alpha" + + "1.UpdateNodeRequest\032\035.google.longrunning" + + ".Operation\"q\202\323\344\223\002<24/v2alpha1/{node.name" + + "=projects/*/locations/*/nodes/*}:\004node\332A" + + "\020node,update_mask\312A\031\n\004Node\022\021OperationMet" + + "adata\022\320\001\n\023ListQueuedResources\0225.google.c" + + "loud.tpu.v2alpha1.ListQueuedResourcesReq" + + "uest\0326.google.cloud.tpu.v2alpha1.ListQue" + + "uedResourcesResponse\"J\202\323\344\223\002;\0229/v2alpha1/" + + "{parent=projects/*/locations/*}/queuedRe" + + "sources\332A\006parent\022\275\001\n\021GetQueuedResource\0223" + + ".google.cloud.tpu.v2alpha1.GetQueuedReso" + + "urceRequest\032).google.cloud.tpu.v2alpha1." + + "QueuedResource\"H\202\323\344\223\002;\0229/v2alpha1/{name=" + + "projects/*/locations/*/queuedResources/*" + + "}\332A\004name\022\224\002\n\024CreateQueuedResource\0226.goog" + + "le.cloud.tpu.v2alpha1.CreateQueuedResour" + + "ceRequest\032\035.google.longrunning.Operation" + + "\"\244\001\202\323\344\223\002L\"9/v2alpha1/{parent=projects/*/" + + "locations/*}/queuedResources:\017queued_res" + + "ource\332A)parent,queued_resource,queued_re" + + "source_id\312A#\n\016QueuedResource\022\021OperationM" + + "etadata\022\335\001\n\024DeleteQueuedResource\0226.googl" + + "e.cloud.tpu.v2alpha1.DeleteQueuedResourc" + + "eRequest\032\035.google.longrunning.Operation\"" + + "n\202\323\344\223\002;*9/v2alpha1/{name=projects/*/loca" + + "tions/*/queuedResources/*}\332A\004name\312A#\n\016Qu" + + "euedResource\022\021OperationMetadata\022\336\001\n\027Gene" + + "rateServiceIdentity\0229.google.cloud.tpu.v" + + "2alpha1.GenerateServiceIdentityRequest\032:" + + ".google.cloud.tpu.v2alpha1.GenerateServi" + + "ceIdentityResponse\"L\202\323\344\223\002F\"A/v2alpha1/{p" + + "arent=projects/*/locations/*}:generateSe" + + "rviceIdentity:\001*\022\324\001\n\024ListAcceleratorType" + + "s\0226.google.cloud.tpu.v2alpha1.ListAccele" + + "ratorTypesRequest\0327.google.cloud.tpu.v2a" + + "lpha1.ListAcceleratorTypesResponse\"K\202\323\344\223" + + "\002<\022:/v2alpha1/{parent=projects/*/locatio" + + "ns/*}/acceleratorTypes\332A\006parent\022\301\001\n\022GetA" + + "cceleratorType\0224.google.cloud.tpu.v2alph" + + "a1.GetAcceleratorTypeRequest\032*.google.cl" + + "oud.tpu.v2alpha1.AcceleratorType\"I\202\323\344\223\002<" + + "\022:/v2alpha1/{name=projects/*/locations/*" + + "/acceleratorTypes/*}\332A\004name\022\320\001\n\023ListRunt" + + "imeVersions\0225.google.cloud.tpu.v2alpha1." + + "ListRuntimeVersionsRequest\0326.google.clou" + + "d.tpu.v2alpha1.ListRuntimeVersionsRespon" + + "se\"J\202\323\344\223\002;\0229/v2alpha1/{parent=projects/*" + + "/locations/*}/runtimeVersions\332A\006parent\022\275" + + "\001\n\021GetRuntimeVersion\0223.google.cloud.tpu." + + "v2alpha1.GetRuntimeVersionRequest\032).goog" + + "le.cloud.tpu.v2alpha1.RuntimeVersion\"H\202\323" + + "\344\223\002;\0229/v2alpha1/{name=projects/*/locatio" + + "ns/*/runtimeVersions/*}\332A\004name\022\320\001\n\022GetGu" + + "estAttributes\0224.google.cloud.tpu.v2alpha" + + "1.GetGuestAttributesRequest\0325.google.clo" + + "ud.tpu.v2alpha1.GetGuestAttributesRespon" + + "se\"M\202\323\344\223\002G\"B/v2alpha1/{name=projects/*/l" + + "ocations/*/nodes/*}:getGuestAttributes:\001" + + "*\022\346\001\n\030SimulateMaintenanceEvent\022:.google." + + "cloud.tpu.v2alpha1.SimulateMaintenanceEv" + + "entRequest\032\035.google.longrunning.Operatio" + + "n\"o\202\323\344\223\002M\"H/v2alpha1/{name=projects/*/lo" + + "cations/*/nodes/*}:simulateMaintenanceEv" + + "ent:\001*\312A\031\n\004Node\022\021OperationMetadata\032F\312A\022t" + + "pu.googleapis.com\322A.https://www.googleap" + + "is.com/auth/cloud-platformBn\n\035com.google" + + ".cloud.tpu.v2alpha1B\rCloudTpuProtoP\001Z buil private CreateNodeRequest() { parent_ = ""; nodeId_ = ""; + requestId_ = ""; } @java.lang.Override @@ -219,6 +220,55 @@ public com.google.cloud.tpu.v2alpha1.NodeOrBuilder getNodeOrBuilder() { return getNode(); } + public static final int REQUEST_ID_FIELD_NUMBER = 6; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 6; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 6; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -242,6 +292,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (node_ != null) { output.writeMessage(3, getNode()); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, requestId_); + } getUnknownFields().writeTo(output); } @@ -260,6 +313,9 @@ public int getSerializedSize() { if (node_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getNode()); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, requestId_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -282,6 +338,7 @@ public boolean equals(final java.lang.Object obj) { if (hasNode()) { if (!getNode().equals(other.getNode())) return false; } + if (!getRequestId().equals(other.getRequestId())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -301,6 +358,8 @@ public int hashCode() { hash = (37 * hash) + NODE_FIELD_NUMBER; hash = (53 * hash) + getNode().hashCode(); } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -449,6 +508,8 @@ public Builder clear() { node_ = null; nodeBuilder_ = null; } + requestId_ = ""; + return this; } @@ -483,6 +544,7 @@ public com.google.cloud.tpu.v2alpha1.CreateNodeRequest buildPartial() { } else { result.node_ = nodeBuilder_.build(); } + result.requestId_ = requestId_; onBuilt(); return result; } @@ -544,6 +606,10 @@ public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.CreateNodeRequest other) if (other.hasNode()) { mergeNode(other.getNode()); } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -588,6 +654,12 @@ public Builder mergeFrom( break; } // case 26 + case 50: + { + requestId_ = input.readStringRequireUtf8(); + + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1015,6 +1087,112 @@ public com.google.cloud.tpu.v2alpha1.NodeOrBuilder getNodeOrBuilder() { return nodeBuilder_; } + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 6; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 6; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 6; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 6; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 6; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CreateNodeRequestOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CreateNodeRequestOrBuilder.java index bdca5a4d9cef..122d2b9d295e 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CreateNodeRequestOrBuilder.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CreateNodeRequestOrBuilder.java @@ -114,4 +114,29 @@ public interface CreateNodeRequestOrBuilder * */ com.google.cloud.tpu.v2alpha1.NodeOrBuilder getNodeOrBuilder(); + + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 6; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 6; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); } diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CreateQueuedResourceRequest.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CreateQueuedResourceRequest.java new file mode 100644 index 000000000000..5533c053b41d --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CreateQueuedResourceRequest.java @@ -0,0 +1,1285 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Request for [CreateQueuedResource][google.cloud.tpu.v2alpha1.Tpu.CreateQueuedResource].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest} + */ +public final class CreateQueuedResourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest) + CreateQueuedResourceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateQueuedResourceRequest.newBuilder() to construct. + private CreateQueuedResourceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateQueuedResourceRequest() { + parent_ = ""; + queuedResourceId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateQueuedResourceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_CreateQueuedResourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_CreateQueuedResourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest.class, + com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest.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 QUEUED_RESOURCE_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object queuedResourceId_; + /** + * + * + *
+   * The unqualified resource name. Should follow the ^[A-Za-z0-9_.~+%-]+$
+   * regex format.
+   * 
+ * + * string queued_resource_id = 2; + * + * @return The queuedResourceId. + */ + @java.lang.Override + public java.lang.String getQueuedResourceId() { + java.lang.Object ref = queuedResourceId_; + 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(); + queuedResourceId_ = s; + return s; + } + } + /** + * + * + *
+   * The unqualified resource name. Should follow the ^[A-Za-z0-9_.~+%-]+$
+   * regex format.
+   * 
+ * + * string queued_resource_id = 2; + * + * @return The bytes for queuedResourceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueuedResourceIdBytes() { + java.lang.Object ref = queuedResourceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + queuedResourceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUEUED_RESOURCE_FIELD_NUMBER = 3; + private com.google.cloud.tpu.v2alpha1.QueuedResource queuedResource_; + /** + * + * + *
+   * Required. The queued resource.
+   * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResource queued_resource = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the queuedResource field is set. + */ + @java.lang.Override + public boolean hasQueuedResource() { + return queuedResource_ != null; + } + /** + * + * + *
+   * Required. The queued resource.
+   * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResource queued_resource = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The queuedResource. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource getQueuedResource() { + return queuedResource_ == null + ? com.google.cloud.tpu.v2alpha1.QueuedResource.getDefaultInstance() + : queuedResource_; + } + /** + * + * + *
+   * Required. The queued resource.
+   * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResource queued_resource = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceOrBuilder getQueuedResourceOrBuilder() { + return getQueuedResource(); + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 4; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 4; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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(queuedResourceId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, queuedResourceId_); + } + if (queuedResource_ != null) { + output.writeMessage(3, getQueuedResource()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + getUnknownFields().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(queuedResourceId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, queuedResourceId_); + } + if (queuedResource_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getQueuedResource()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + size += getUnknownFields().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.CreateQueuedResourceRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest other = + (com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getQueuedResourceId().equals(other.getQueuedResourceId())) return false; + if (hasQueuedResource() != other.hasQueuedResource()) return false; + if (hasQueuedResource()) { + if (!getQueuedResource().equals(other.getQueuedResource())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + QUEUED_RESOURCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getQueuedResourceId().hashCode(); + if (hasQueuedResource()) { + hash = (37 * hash) + QUEUED_RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getQueuedResource().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest 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.CreateQueuedResourceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest 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.CreateQueuedResourceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest 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.CreateQueuedResourceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest 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.CreateQueuedResourceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest 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.CreateQueuedResourceRequest 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.CreateQueuedResourceRequest 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.CreateQueuedResourceRequest 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 [CreateQueuedResource][google.cloud.tpu.v2alpha1.Tpu.CreateQueuedResource].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest) + com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_CreateQueuedResourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_CreateQueuedResourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest.class, + com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + queuedResourceId_ = ""; + + if (queuedResourceBuilder_ == null) { + queuedResource_ = null; + } else { + queuedResource_ = null; + queuedResourceBuilder_ = null; + } + requestId_ = ""; + + 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_CreateQueuedResourceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest build() { + com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest buildPartial() { + com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest result = + new com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest(this); + result.parent_ = parent_; + result.queuedResourceId_ = queuedResourceId_; + if (queuedResourceBuilder_ == null) { + result.queuedResource_ = queuedResource_; + } else { + result.queuedResource_ = queuedResourceBuilder_.build(); + } + result.requestId_ = requestId_; + 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.CreateQueuedResourceRequest) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest other) { + if (other == com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getQueuedResourceId().isEmpty()) { + queuedResourceId_ = other.queuedResourceId_; + onChanged(); + } + if (other.hasQueuedResource()) { + mergeQueuedResource(other.getQueuedResource()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + queuedResourceId_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + input.readMessage(getQueuedResourceFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + case 34: + { + requestId_ = input.readStringRequireUtf8(); + + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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 queuedResourceId_ = ""; + /** + * + * + *
+     * The unqualified resource name. Should follow the ^[A-Za-z0-9_.~+%-]+$
+     * regex format.
+     * 
+ * + * string queued_resource_id = 2; + * + * @return The queuedResourceId. + */ + public java.lang.String getQueuedResourceId() { + java.lang.Object ref = queuedResourceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + queuedResourceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The unqualified resource name. Should follow the ^[A-Za-z0-9_.~+%-]+$
+     * regex format.
+     * 
+ * + * string queued_resource_id = 2; + * + * @return The bytes for queuedResourceId. + */ + public com.google.protobuf.ByteString getQueuedResourceIdBytes() { + java.lang.Object ref = queuedResourceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + queuedResourceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The unqualified resource name. Should follow the ^[A-Za-z0-9_.~+%-]+$
+     * regex format.
+     * 
+ * + * string queued_resource_id = 2; + * + * @param value The queuedResourceId to set. + * @return This builder for chaining. + */ + public Builder setQueuedResourceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + queuedResourceId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The unqualified resource name. Should follow the ^[A-Za-z0-9_.~+%-]+$
+     * regex format.
+     * 
+ * + * string queued_resource_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearQueuedResourceId() { + + queuedResourceId_ = getDefaultInstance().getQueuedResourceId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The unqualified resource name. Should follow the ^[A-Za-z0-9_.~+%-]+$
+     * regex format.
+     * 
+ * + * string queued_resource_id = 2; + * + * @param value The bytes for queuedResourceId to set. + * @return This builder for chaining. + */ + public Builder setQueuedResourceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + queuedResourceId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.tpu.v2alpha1.QueuedResource queuedResource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResource, + com.google.cloud.tpu.v2alpha1.QueuedResource.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceOrBuilder> + queuedResourceBuilder_; + /** + * + * + *
+     * Required. The queued resource.
+     * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResource queued_resource = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the queuedResource field is set. + */ + public boolean hasQueuedResource() { + return queuedResourceBuilder_ != null || queuedResource_ != null; + } + /** + * + * + *
+     * Required. The queued resource.
+     * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResource queued_resource = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The queuedResource. + */ + public com.google.cloud.tpu.v2alpha1.QueuedResource getQueuedResource() { + if (queuedResourceBuilder_ == null) { + return queuedResource_ == null + ? com.google.cloud.tpu.v2alpha1.QueuedResource.getDefaultInstance() + : queuedResource_; + } else { + return queuedResourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The queued resource.
+     * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResource queued_resource = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQueuedResource(com.google.cloud.tpu.v2alpha1.QueuedResource value) { + if (queuedResourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queuedResource_ = value; + onChanged(); + } else { + queuedResourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The queued resource.
+     * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResource queued_resource = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQueuedResource( + com.google.cloud.tpu.v2alpha1.QueuedResource.Builder builderForValue) { + if (queuedResourceBuilder_ == null) { + queuedResource_ = builderForValue.build(); + onChanged(); + } else { + queuedResourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The queued resource.
+     * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResource queued_resource = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeQueuedResource(com.google.cloud.tpu.v2alpha1.QueuedResource value) { + if (queuedResourceBuilder_ == null) { + if (queuedResource_ != null) { + queuedResource_ = + com.google.cloud.tpu.v2alpha1.QueuedResource.newBuilder(queuedResource_) + .mergeFrom(value) + .buildPartial(); + } else { + queuedResource_ = value; + } + onChanged(); + } else { + queuedResourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The queued resource.
+     * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResource queued_resource = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearQueuedResource() { + if (queuedResourceBuilder_ == null) { + queuedResource_ = null; + onChanged(); + } else { + queuedResource_ = null; + queuedResourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The queued resource.
+     * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResource queued_resource = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.tpu.v2alpha1.QueuedResource.Builder getQueuedResourceBuilder() { + + onChanged(); + return getQueuedResourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The queued resource.
+     * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResource queued_resource = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.tpu.v2alpha1.QueuedResourceOrBuilder getQueuedResourceOrBuilder() { + if (queuedResourceBuilder_ != null) { + return queuedResourceBuilder_.getMessageOrBuilder(); + } else { + return queuedResource_ == null + ? com.google.cloud.tpu.v2alpha1.QueuedResource.getDefaultInstance() + : queuedResource_; + } + } + /** + * + * + *
+     * Required. The queued resource.
+     * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResource queued_resource = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResource, + com.google.cloud.tpu.v2alpha1.QueuedResource.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceOrBuilder> + getQueuedResourceFieldBuilder() { + if (queuedResourceBuilder_ == null) { + queuedResourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResource, + com.google.cloud.tpu.v2alpha1.QueuedResource.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceOrBuilder>( + getQueuedResource(), getParentForChildren(), isClean()); + queuedResource_ = null; + } + return queuedResourceBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 4; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 4; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 4; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 4; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + @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.CreateQueuedResourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest) + private static final com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest(); + } + + public static com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateQueuedResourceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.CreateQueuedResourceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CreateQueuedResourceRequestOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CreateQueuedResourceRequestOrBuilder.java new file mode 100644 index 000000000000..14bc6d7bcb85 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/CreateQueuedResourceRequestOrBuilder.java @@ -0,0 +1,147 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface CreateQueuedResourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest) + 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. Should follow the ^[A-Za-z0-9_.~+%-]+$
+   * regex format.
+   * 
+ * + * string queued_resource_id = 2; + * + * @return The queuedResourceId. + */ + java.lang.String getQueuedResourceId(); + /** + * + * + *
+   * The unqualified resource name. Should follow the ^[A-Za-z0-9_.~+%-]+$
+   * regex format.
+   * 
+ * + * string queued_resource_id = 2; + * + * @return The bytes for queuedResourceId. + */ + com.google.protobuf.ByteString getQueuedResourceIdBytes(); + + /** + * + * + *
+   * Required. The queued resource.
+   * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResource queued_resource = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the queuedResource field is set. + */ + boolean hasQueuedResource(); + /** + * + * + *
+   * Required. The queued resource.
+   * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResource queued_resource = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The queuedResource. + */ + com.google.cloud.tpu.v2alpha1.QueuedResource getQueuedResource(); + /** + * + * + *
+   * Required. The queued resource.
+   * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResource queued_resource = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.tpu.v2alpha1.QueuedResourceOrBuilder getQueuedResourceOrBuilder(); + + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 4; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 4; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteNodeRequest.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteNodeRequest.java index f3bf6d5c885c..1f0882906d24 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteNodeRequest.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteNodeRequest.java @@ -39,6 +39,7 @@ private DeleteNodeRequest(com.google.protobuf.GeneratedMessageV3.Builder buil private DeleteNodeRequest() { name_ = ""; + requestId_ = ""; } @java.lang.Override @@ -120,6 +121,55 @@ public com.google.protobuf.ByteString getNameBytes() { } } + public static final int REQUEST_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 3; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 3; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -137,6 +187,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } getUnknownFields().writeTo(output); } @@ -149,6 +202,9 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -166,6 +222,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.tpu.v2alpha1.DeleteNodeRequest) obj; if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -179,6 +236,8 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -319,6 +378,8 @@ public Builder clear() { super.clear(); name_ = ""; + requestId_ = ""; + return this; } @@ -347,6 +408,7 @@ 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_; + result.requestId_ = requestId_; onBuilt(); return result; } @@ -401,6 +463,10 @@ public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.DeleteNodeRequest other) name_ = other.name_; onChanged(); } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -433,6 +499,12 @@ public Builder mergeFrom( break; } // case 10 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + + break; + } // case 26 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -566,6 +638,112 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { return this; } + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 3; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 3; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 3; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 3; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteNodeRequestOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteNodeRequestOrBuilder.java index b725b22388ef..da7dfa7505e2 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteNodeRequestOrBuilder.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteNodeRequestOrBuilder.java @@ -51,4 +51,29 @@ public interface DeleteNodeRequestOrBuilder * @return The bytes for name. */ com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 3; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 3; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); } diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteQueuedResourceRequest.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteQueuedResourceRequest.java new file mode 100644 index 000000000000..152d9ae64ae7 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteQueuedResourceRequest.java @@ -0,0 +1,808 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Request for [DeleteQueuedResource][google.cloud.tpu.v2alpha1.Tpu.DeleteQueuedResource].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest} + */ +public final class DeleteQueuedResourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest) + DeleteQueuedResourceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteQueuedResourceRequest.newBuilder() to construct. + private DeleteQueuedResourceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteQueuedResourceRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteQueuedResourceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_DeleteQueuedResourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_DeleteQueuedResourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest.class, + com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest.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 REQUEST_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 2; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 2; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + size += getUnknownFields().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.DeleteQueuedResourceRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest other = + (com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest 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.DeleteQueuedResourceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest 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.DeleteQueuedResourceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest 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.DeleteQueuedResourceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest 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.DeleteQueuedResourceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest 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.DeleteQueuedResourceRequest 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.DeleteQueuedResourceRequest 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.DeleteQueuedResourceRequest 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 [DeleteQueuedResource][google.cloud.tpu.v2alpha1.Tpu.DeleteQueuedResource].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest) + com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_DeleteQueuedResourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_DeleteQueuedResourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest.class, + com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + requestId_ = ""; + + 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_DeleteQueuedResourceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest build() { + com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest buildPartial() { + com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest result = + new com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest(this); + result.name_ = name_; + result.requestId_ = requestId_; + 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.DeleteQueuedResourceRequest) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest other) { + if (other == com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 2; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 2; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 2; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 2; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + @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.DeleteQueuedResourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest) + private static final com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest(); + } + + public static com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteQueuedResourceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DeleteQueuedResourceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteQueuedResourceRequestOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteQueuedResourceRequestOrBuilder.java new file mode 100644 index 000000000000..831fed43c0b9 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/DeleteQueuedResourceRequestOrBuilder.java @@ -0,0 +1,79 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface DeleteQueuedResourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest) + 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(); + + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 2; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 2; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityRequest.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityRequest.java index 7ce9f18f94d0..b4fd6d1fcf0d 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityRequest.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityRequest.java @@ -22,8 +22,7 @@ * * *
- * Request for
- * [GenerateServiceIdentity][google.cloud.tpu.v2alpha1.Tpu.GenerateServiceIdentity].
+ * Request for [GenerateServiceIdentity][google.cloud.tpu.v2alpha1.Tpu.GenerateServiceIdentity].
  * 
* * Protobuf type {@code google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest} @@ -286,8 +285,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Request for
-   * [GenerateServiceIdentity][google.cloud.tpu.v2alpha1.Tpu.GenerateServiceIdentity].
+   * Request for [GenerateServiceIdentity][google.cloud.tpu.v2alpha1.Tpu.GenerateServiceIdentity].
    * 
* * Protobuf type {@code google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityResponse.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityResponse.java index 2addba1f4403..7615d22a61ef 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityResponse.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GenerateServiceIdentityResponse.java @@ -22,8 +22,7 @@ * * *
- * Response for
- * [GenerateServiceIdentity][google.cloud.tpu.v2alpha1.Tpu.GenerateServiceIdentity].
+ * Response for [GenerateServiceIdentity][google.cloud.tpu.v2alpha1.Tpu.GenerateServiceIdentity].
  * 
* * Protobuf type {@code google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse} @@ -284,8 +283,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Response for
-   * [GenerateServiceIdentity][google.cloud.tpu.v2alpha1.Tpu.GenerateServiceIdentity].
+   * Response for [GenerateServiceIdentity][google.cloud.tpu.v2alpha1.Tpu.GenerateServiceIdentity].
    * 
* * Protobuf type {@code google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetAcceleratorTypeRequest.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetAcceleratorTypeRequest.java index 0ea8f88362a0..a443448367b1 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetAcceleratorTypeRequest.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetAcceleratorTypeRequest.java @@ -22,8 +22,7 @@ * * *
- * Request for
- * [GetAcceleratorType][google.cloud.tpu.v2alpha1.Tpu.GetAcceleratorType].
+ * Request for [GetAcceleratorType][google.cloud.tpu.v2alpha1.Tpu.GetAcceleratorType].
  * 
* * Protobuf type {@code google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest} @@ -285,8 +284,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Request for
-   * [GetAcceleratorType][google.cloud.tpu.v2alpha1.Tpu.GetAcceleratorType].
+   * Request for [GetAcceleratorType][google.cloud.tpu.v2alpha1.Tpu.GetAcceleratorType].
    * 
* * Protobuf type {@code google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesRequest.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesRequest.java index 116002d7c025..ff443c6bfd20 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesRequest.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesRequest.java @@ -22,8 +22,7 @@ * * *
- * Request for
- * [GetGuestAttributes][google.cloud.tpu.v2alpha1.Tpu.GetGuestAttributes].
+ * Request for [GetGuestAttributes][google.cloud.tpu.v2alpha1.Tpu.GetGuestAttributes].
  * 
* * Protobuf type {@code google.cloud.tpu.v2alpha1.GetGuestAttributesRequest} @@ -426,8 +425,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Request for
-   * [GetGuestAttributes][google.cloud.tpu.v2alpha1.Tpu.GetGuestAttributes].
+   * Request for [GetGuestAttributes][google.cloud.tpu.v2alpha1.Tpu.GetGuestAttributes].
    * 
* * Protobuf type {@code google.cloud.tpu.v2alpha1.GetGuestAttributesRequest} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesResponse.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesResponse.java index c8fdd1ac7bda..1202e41b266f 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesResponse.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetGuestAttributesResponse.java @@ -22,8 +22,7 @@ * * *
- * Response for
- * [GetGuestAttributes][google.cloud.tpu.v2alpha1.Tpu.GetGuestAttributes].
+ * Response for [GetGuestAttributes][google.cloud.tpu.v2alpha1.Tpu.GetGuestAttributes].
  * 
* * Protobuf type {@code google.cloud.tpu.v2alpha1.GetGuestAttributesResponse} @@ -304,8 +303,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Response for
-   * [GetGuestAttributes][google.cloud.tpu.v2alpha1.Tpu.GetGuestAttributes].
+   * Response for [GetGuestAttributes][google.cloud.tpu.v2alpha1.Tpu.GetGuestAttributes].
    * 
* * Protobuf type {@code google.cloud.tpu.v2alpha1.GetGuestAttributesResponse} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetQueuedResourceRequest.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetQueuedResourceRequest.java new file mode 100644 index 000000000000..3269662a9980 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetQueuedResourceRequest.java @@ -0,0 +1,630 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Request for [GetQueuedResource][google.cloud.tpu.v2alpha1.Tpu.GetQueuedResource]
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.GetQueuedResourceRequest} + */ +public final class GetQueuedResourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.GetQueuedResourceRequest) + GetQueuedResourceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetQueuedResourceRequest.newBuilder() to construct. + private GetQueuedResourceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetQueuedResourceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetQueuedResourceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetQueuedResourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetQueuedResourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest.class, + com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest.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_); + } + getUnknownFields().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 += getUnknownFields().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.GetQueuedResourceRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest other = + (com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest 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.GetQueuedResourceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest 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.GetQueuedResourceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest 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.GetQueuedResourceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest 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.GetQueuedResourceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest 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.GetQueuedResourceRequest 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.GetQueuedResourceRequest 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.GetQueuedResourceRequest 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 [GetQueuedResource][google.cloud.tpu.v2alpha1.Tpu.GetQueuedResource]
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.GetQueuedResourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.GetQueuedResourceRequest) + com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetQueuedResourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_GetQueuedResourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest.class, + com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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_GetQueuedResourceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest build() { + com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest buildPartial() { + com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest result = + new com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest(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.GetQueuedResourceRequest) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest other) { + if (other == com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.GetQueuedResourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.GetQueuedResourceRequest) + private static final com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest(); + } + + public static com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetQueuedResourceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GetQueuedResourceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetQueuedResourceRequestOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetQueuedResourceRequestOrBuilder.java new file mode 100644 index 000000000000..633cbef6c24d --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetQueuedResourceRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface GetQueuedResourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.GetQueuedResourceRequest) + 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/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetRuntimeVersionRequest.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetRuntimeVersionRequest.java index 121a75455b0a..2a8f4bb6f706 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetRuntimeVersionRequest.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/GetRuntimeVersionRequest.java @@ -22,8 +22,7 @@ * * *
- * Request for
- * [GetRuntimeVersion][google.cloud.tpu.v2alpha1.Tpu.GetRuntimeVersion].
+ * Request for [GetRuntimeVersion][google.cloud.tpu.v2alpha1.Tpu.GetRuntimeVersion].
  * 
* * Protobuf type {@code google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest} @@ -285,8 +284,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Request for
-   * [GetRuntimeVersion][google.cloud.tpu.v2alpha1.Tpu.GetRuntimeVersion].
+   * Request for [GetRuntimeVersion][google.cloud.tpu.v2alpha1.Tpu.GetRuntimeVersion].
    * 
* * Protobuf type {@code google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesRequest.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesRequest.java index b82b55daf02a..84b07189b463 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesRequest.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesRequest.java @@ -22,8 +22,7 @@ * * *
- * Request for
- * [ListAcceleratorTypes][google.cloud.tpu.v2alpha1.Tpu.ListAcceleratorTypes].
+ * Request for [ListAcceleratorTypes][google.cloud.tpu.v2alpha1.Tpu.ListAcceleratorTypes].
  * 
* * Protobuf type {@code google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest} @@ -489,8 +488,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Request for
-   * [ListAcceleratorTypes][google.cloud.tpu.v2alpha1.Tpu.ListAcceleratorTypes].
+   * Request for [ListAcceleratorTypes][google.cloud.tpu.v2alpha1.Tpu.ListAcceleratorTypes].
    * 
* * Protobuf type {@code google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesResponse.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesResponse.java index 198eceaf6b7c..38bbc1facdf0 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesResponse.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListAcceleratorTypesResponse.java @@ -22,8 +22,7 @@ * * *
- * Response for
- * [ListAcceleratorTypes][google.cloud.tpu.v2alpha1.Tpu.ListAcceleratorTypes].
+ * Response for [ListAcceleratorTypes][google.cloud.tpu.v2alpha1.Tpu.ListAcceleratorTypes].
  * 
* * Protobuf type {@code google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse} @@ -441,8 +440,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Response for
-   * [ListAcceleratorTypes][google.cloud.tpu.v2alpha1.Tpu.ListAcceleratorTypes].
+   * Response for [ListAcceleratorTypes][google.cloud.tpu.v2alpha1.Tpu.ListAcceleratorTypes].
    * 
* * Protobuf type {@code google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListQueuedResourcesRequest.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListQueuedResourcesRequest.java new file mode 100644 index 000000000000..01e725dcd135 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListQueuedResourcesRequest.java @@ -0,0 +1,899 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Request for [ListQueuedResources][google.cloud.tpu.v2alpha1.Tpu.ListQueuedResources].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest} + */ +public final class ListQueuedResourcesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest) + ListQueuedResourcesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListQueuedResourcesRequest.newBuilder() to construct. + private ListQueuedResourcesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListQueuedResourcesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListQueuedResourcesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListQueuedResourcesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListQueuedResourcesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest.class, + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest.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_); + } + getUnknownFields().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 += getUnknownFields().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.ListQueuedResourcesRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest other = + (com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest 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.ListQueuedResourcesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest 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.ListQueuedResourcesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest 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.ListQueuedResourcesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest 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.ListQueuedResourcesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest 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.ListQueuedResourcesRequest 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.ListQueuedResourcesRequest 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.ListQueuedResourcesRequest 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 [ListQueuedResources][google.cloud.tpu.v2alpha1.Tpu.ListQueuedResources].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest) + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListQueuedResourcesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListQueuedResourcesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest.class, + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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_ListQueuedResourcesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest build() { + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest buildPartial() { + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest result = + new com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest(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.ListQueuedResourcesRequest) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest other) { + if (other == com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest.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.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.ListQueuedResourcesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest) + private static final com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest(); + } + + public static com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListQueuedResourcesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ListQueuedResourcesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListQueuedResourcesRequestOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListQueuedResourcesRequestOrBuilder.java new file mode 100644 index 000000000000..9fc4661ade68 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListQueuedResourcesRequestOrBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface ListQueuedResourcesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest) + 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/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListQueuedResourcesResponse.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListQueuedResourcesResponse.java new file mode 100644 index 000000000000..e7df41bef3f8 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListQueuedResourcesResponse.java @@ -0,0 +1,1386 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Response for [ListQueuedResources][google.cloud.tpu.v2alpha1.Tpu.ListQueuedResources].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse} + */ +public final class ListQueuedResourcesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse) + ListQueuedResourcesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListQueuedResourcesResponse.newBuilder() to construct. + private ListQueuedResourcesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListQueuedResourcesResponse() { + queuedResources_ = 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 ListQueuedResourcesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListQueuedResourcesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListQueuedResourcesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse.class, + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse.Builder.class); + } + + public static final int QUEUED_RESOURCES_FIELD_NUMBER = 1; + private java.util.List queuedResources_; + /** + * + * + *
+   * The listed queued resources.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + @java.lang.Override + public java.util.List getQueuedResourcesList() { + return queuedResources_; + } + /** + * + * + *
+   * The listed queued resources.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + @java.lang.Override + public java.util.List + getQueuedResourcesOrBuilderList() { + return queuedResources_; + } + /** + * + * + *
+   * The listed queued resources.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + @java.lang.Override + public int getQueuedResourcesCount() { + return queuedResources_.size(); + } + /** + * + * + *
+   * The listed queued resources.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource getQueuedResources(int index) { + return queuedResources_.get(index); + } + /** + * + * + *
+   * The listed queued resources.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceOrBuilder getQueuedResourcesOrBuilder( + int index) { + return queuedResources_.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 < queuedResources_.size(); i++) { + output.writeMessage(1, queuedResources_.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)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < queuedResources_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, queuedResources_.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 += getUnknownFields().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.ListQueuedResourcesResponse)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse other = + (com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse) obj; + + if (!getQueuedResourcesList().equals(other.getQueuedResourcesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getQueuedResourcesCount() > 0) { + hash = (37 * hash) + QUEUED_RESOURCES_FIELD_NUMBER; + hash = (53 * hash) + getQueuedResourcesList().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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse 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.ListQueuedResourcesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse 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.ListQueuedResourcesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse 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.ListQueuedResourcesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse 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.ListQueuedResourcesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse 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.ListQueuedResourcesResponse 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.ListQueuedResourcesResponse 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.ListQueuedResourcesResponse 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 [ListQueuedResources][google.cloud.tpu.v2alpha1.Tpu.ListQueuedResources].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse) + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListQueuedResourcesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_ListQueuedResourcesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse.class, + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (queuedResourcesBuilder_ == null) { + queuedResources_ = java.util.Collections.emptyList(); + } else { + queuedResources_ = null; + queuedResourcesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + 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_ListQueuedResourcesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse build() { + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse buildPartial() { + com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse result = + new com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse(this); + int from_bitField0_ = bitField0_; + if (queuedResourcesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + queuedResources_ = java.util.Collections.unmodifiableList(queuedResources_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.queuedResources_ = queuedResources_; + } else { + result.queuedResources_ = queuedResourcesBuilder_.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.ListQueuedResourcesResponse) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse other) { + if (other == com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse.getDefaultInstance()) + return this; + if (queuedResourcesBuilder_ == null) { + if (!other.queuedResources_.isEmpty()) { + if (queuedResources_.isEmpty()) { + queuedResources_ = other.queuedResources_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureQueuedResourcesIsMutable(); + queuedResources_.addAll(other.queuedResources_); + } + onChanged(); + } + } else { + if (!other.queuedResources_.isEmpty()) { + if (queuedResourcesBuilder_.isEmpty()) { + queuedResourcesBuilder_.dispose(); + queuedResourcesBuilder_ = null; + queuedResources_ = other.queuedResources_; + bitField0_ = (bitField0_ & ~0x00000001); + queuedResourcesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getQueuedResourcesFieldBuilder() + : null; + } else { + queuedResourcesBuilder_.addAllMessages(other.queuedResources_); + } + } + } + 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.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.tpu.v2alpha1.QueuedResource m = + input.readMessage( + com.google.cloud.tpu.v2alpha1.QueuedResource.parser(), extensionRegistry); + if (queuedResourcesBuilder_ == null) { + ensureQueuedResourcesIsMutable(); + queuedResources_.add(m); + } else { + queuedResourcesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List queuedResources_ = + java.util.Collections.emptyList(); + + private void ensureQueuedResourcesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + queuedResources_ = + new java.util.ArrayList(queuedResources_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResource, + com.google.cloud.tpu.v2alpha1.QueuedResource.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceOrBuilder> + queuedResourcesBuilder_; + + /** + * + * + *
+     * The listed queued resources.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + public java.util.List getQueuedResourcesList() { + if (queuedResourcesBuilder_ == null) { + return java.util.Collections.unmodifiableList(queuedResources_); + } else { + return queuedResourcesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The listed queued resources.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + public int getQueuedResourcesCount() { + if (queuedResourcesBuilder_ == null) { + return queuedResources_.size(); + } else { + return queuedResourcesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The listed queued resources.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + public com.google.cloud.tpu.v2alpha1.QueuedResource getQueuedResources(int index) { + if (queuedResourcesBuilder_ == null) { + return queuedResources_.get(index); + } else { + return queuedResourcesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The listed queued resources.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + public Builder setQueuedResources( + int index, com.google.cloud.tpu.v2alpha1.QueuedResource value) { + if (queuedResourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueuedResourcesIsMutable(); + queuedResources_.set(index, value); + onChanged(); + } else { + queuedResourcesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The listed queued resources.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + public Builder setQueuedResources( + int index, com.google.cloud.tpu.v2alpha1.QueuedResource.Builder builderForValue) { + if (queuedResourcesBuilder_ == null) { + ensureQueuedResourcesIsMutable(); + queuedResources_.set(index, builderForValue.build()); + onChanged(); + } else { + queuedResourcesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The listed queued resources.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + public Builder addQueuedResources(com.google.cloud.tpu.v2alpha1.QueuedResource value) { + if (queuedResourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueuedResourcesIsMutable(); + queuedResources_.add(value); + onChanged(); + } else { + queuedResourcesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The listed queued resources.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + public Builder addQueuedResources( + int index, com.google.cloud.tpu.v2alpha1.QueuedResource value) { + if (queuedResourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueuedResourcesIsMutable(); + queuedResources_.add(index, value); + onChanged(); + } else { + queuedResourcesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The listed queued resources.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + public Builder addQueuedResources( + com.google.cloud.tpu.v2alpha1.QueuedResource.Builder builderForValue) { + if (queuedResourcesBuilder_ == null) { + ensureQueuedResourcesIsMutable(); + queuedResources_.add(builderForValue.build()); + onChanged(); + } else { + queuedResourcesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The listed queued resources.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + public Builder addQueuedResources( + int index, com.google.cloud.tpu.v2alpha1.QueuedResource.Builder builderForValue) { + if (queuedResourcesBuilder_ == null) { + ensureQueuedResourcesIsMutable(); + queuedResources_.add(index, builderForValue.build()); + onChanged(); + } else { + queuedResourcesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The listed queued resources.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + public Builder addAllQueuedResources( + java.lang.Iterable values) { + if (queuedResourcesBuilder_ == null) { + ensureQueuedResourcesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, queuedResources_); + onChanged(); + } else { + queuedResourcesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The listed queued resources.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + public Builder clearQueuedResources() { + if (queuedResourcesBuilder_ == null) { + queuedResources_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + queuedResourcesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The listed queued resources.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + public Builder removeQueuedResources(int index) { + if (queuedResourcesBuilder_ == null) { + ensureQueuedResourcesIsMutable(); + queuedResources_.remove(index); + onChanged(); + } else { + queuedResourcesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The listed queued resources.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + public com.google.cloud.tpu.v2alpha1.QueuedResource.Builder getQueuedResourcesBuilder( + int index) { + return getQueuedResourcesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The listed queued resources.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + public com.google.cloud.tpu.v2alpha1.QueuedResourceOrBuilder getQueuedResourcesOrBuilder( + int index) { + if (queuedResourcesBuilder_ == null) { + return queuedResources_.get(index); + } else { + return queuedResourcesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The listed queued resources.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + public java.util.List + getQueuedResourcesOrBuilderList() { + if (queuedResourcesBuilder_ != null) { + return queuedResourcesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(queuedResources_); + } + } + /** + * + * + *
+     * The listed queued resources.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + public com.google.cloud.tpu.v2alpha1.QueuedResource.Builder addQueuedResourcesBuilder() { + return getQueuedResourcesFieldBuilder() + .addBuilder(com.google.cloud.tpu.v2alpha1.QueuedResource.getDefaultInstance()); + } + /** + * + * + *
+     * The listed queued resources.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + public com.google.cloud.tpu.v2alpha1.QueuedResource.Builder addQueuedResourcesBuilder( + int index) { + return getQueuedResourcesFieldBuilder() + .addBuilder(index, com.google.cloud.tpu.v2alpha1.QueuedResource.getDefaultInstance()); + } + /** + * + * + *
+     * The listed queued resources.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + public java.util.List + getQueuedResourcesBuilderList() { + return getQueuedResourcesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResource, + com.google.cloud.tpu.v2alpha1.QueuedResource.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceOrBuilder> + getQueuedResourcesFieldBuilder() { + if (queuedResourcesBuilder_ == null) { + queuedResourcesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResource, + com.google.cloud.tpu.v2alpha1.QueuedResource.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceOrBuilder>( + queuedResources_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + queuedResources_ = null; + } + return queuedResourcesBuilder_; + } + + 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.ListQueuedResourcesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse) + private static final com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse(); + } + + public static com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListQueuedResourcesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ListQueuedResourcesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListQueuedResourcesResponseOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListQueuedResourcesResponseOrBuilder.java new file mode 100644 index 000000000000..f01f464b03bb --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListQueuedResourcesResponseOrBuilder.java @@ -0,0 +1,153 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface ListQueuedResourcesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The listed queued resources.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + java.util.List getQueuedResourcesList(); + /** + * + * + *
+   * The listed queued resources.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + com.google.cloud.tpu.v2alpha1.QueuedResource getQueuedResources(int index); + /** + * + * + *
+   * The listed queued resources.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + int getQueuedResourcesCount(); + /** + * + * + *
+   * The listed queued resources.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + java.util.List + getQueuedResourcesOrBuilderList(); + /** + * + * + *
+   * The listed queued resources.
+   * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource queued_resources = 1; + */ + com.google.cloud.tpu.v2alpha1.QueuedResourceOrBuilder getQueuedResourcesOrBuilder(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/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsRequest.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsRequest.java index 2b8243436636..96a5ee076d7e 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsRequest.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsRequest.java @@ -22,8 +22,7 @@ * * *
- * Request for
- * [ListRuntimeVersions][google.cloud.tpu.v2alpha1.Tpu.ListRuntimeVersions].
+ * Request for [ListRuntimeVersions][google.cloud.tpu.v2alpha1.Tpu.ListRuntimeVersions].
  * 
* * Protobuf type {@code google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest} @@ -489,8 +488,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Request for
-   * [ListRuntimeVersions][google.cloud.tpu.v2alpha1.Tpu.ListRuntimeVersions].
+   * Request for [ListRuntimeVersions][google.cloud.tpu.v2alpha1.Tpu.ListRuntimeVersions].
    * 
* * Protobuf type {@code google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsResponse.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsResponse.java index de3b56447e45..740c73663af1 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsResponse.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/ListRuntimeVersionsResponse.java @@ -22,8 +22,7 @@ * * *
- * Response for
- * [ListRuntimeVersions][google.cloud.tpu.v2alpha1.Tpu.ListRuntimeVersions].
+ * Response for [ListRuntimeVersions][google.cloud.tpu.v2alpha1.Tpu.ListRuntimeVersions].
  * 
* * Protobuf type {@code google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse} @@ -441,8 +440,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Response for
-   * [ListRuntimeVersions][google.cloud.tpu.v2alpha1.Tpu.ListRuntimeVersions].
+   * Response for [ListRuntimeVersions][google.cloud.tpu.v2alpha1.Tpu.ListRuntimeVersions].
    * 
* * Protobuf type {@code google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfig.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfig.java index 004837586bd7..dd4f6f6bf6fa 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfig.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfig.java @@ -192,6 +192,26 @@ public boolean getEnableExternalIps() { return enableExternalIps_; } + public static final int CAN_IP_FORWARD_FIELD_NUMBER = 4; + private boolean canIpForward_; + /** + * + * + *
+   * Allows the TPU node to send and receive packets with non-matching
+   * destination or source IPs. This is required if you plan to use the TPU
+   * workers to forward routes.
+   * 
+ * + * bool can_ip_forward = 4; + * + * @return The canIpForward. + */ + @java.lang.Override + public boolean getCanIpForward() { + return canIpForward_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -215,6 +235,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (enableExternalIps_ != false) { output.writeBool(3, enableExternalIps_); } + if (canIpForward_ != false) { + output.writeBool(4, canIpForward_); + } getUnknownFields().writeTo(output); } @@ -233,6 +256,9 @@ public int getSerializedSize() { if (enableExternalIps_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, enableExternalIps_); } + if (canIpForward_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, canIpForward_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -252,6 +278,7 @@ public boolean equals(final java.lang.Object obj) { if (!getNetwork().equals(other.getNetwork())) return false; if (!getSubnetwork().equals(other.getSubnetwork())) return false; if (getEnableExternalIps() != other.getEnableExternalIps()) return false; + if (getCanIpForward() != other.getCanIpForward()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -269,6 +296,8 @@ public int hashCode() { hash = (53 * hash) + getSubnetwork().hashCode(); hash = (37 * hash) + ENABLE_EXTERNAL_IPS_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableExternalIps()); + hash = (37 * hash) + CAN_IP_FORWARD_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCanIpForward()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -413,6 +442,8 @@ public Builder clear() { enableExternalIps_ = false; + canIpForward_ = false; + return this; } @@ -443,6 +474,7 @@ public com.google.cloud.tpu.v2alpha1.NetworkConfig buildPartial() { result.network_ = network_; result.subnetwork_ = subnetwork_; result.enableExternalIps_ = enableExternalIps_; + result.canIpForward_ = canIpForward_; onBuilt(); return result; } @@ -503,6 +535,9 @@ public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.NetworkConfig other) { if (other.getEnableExternalIps() != false) { setEnableExternalIps(other.getEnableExternalIps()); } + if (other.getCanIpForward() != false) { + setCanIpForward(other.getCanIpForward()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -547,6 +582,12 @@ public Builder mergeFrom( break; } // case 24 + case 32: + { + canIpForward_ = input.readBool(); + + break; + } // case 32 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -849,6 +890,64 @@ public Builder clearEnableExternalIps() { return this; } + private boolean canIpForward_; + /** + * + * + *
+     * Allows the TPU node to send and receive packets with non-matching
+     * destination or source IPs. This is required if you plan to use the TPU
+     * workers to forward routes.
+     * 
+ * + * bool can_ip_forward = 4; + * + * @return The canIpForward. + */ + @java.lang.Override + public boolean getCanIpForward() { + return canIpForward_; + } + /** + * + * + *
+     * Allows the TPU node to send and receive packets with non-matching
+     * destination or source IPs. This is required if you plan to use the TPU
+     * workers to forward routes.
+     * 
+ * + * bool can_ip_forward = 4; + * + * @param value The canIpForward to set. + * @return This builder for chaining. + */ + public Builder setCanIpForward(boolean value) { + + canIpForward_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Allows the TPU node to send and receive packets with non-matching
+     * destination or source IPs. This is required if you plan to use the TPU
+     * workers to forward routes.
+     * 
+ * + * bool can_ip_forward = 4; + * + * @return This builder for chaining. + */ + public Builder clearCanIpForward() { + + canIpForward_ = false; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfigOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfigOrBuilder.java index 75b07d7aebf9..cb262342c834 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfigOrBuilder.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NetworkConfigOrBuilder.java @@ -93,4 +93,19 @@ public interface NetworkConfigOrBuilder * @return The enableExternalIps. */ boolean getEnableExternalIps(); + + /** + * + * + *
+   * Allows the TPU node to send and receive packets with non-matching
+   * destination or source IPs. This is required if you plan to use the TPU
+   * workers to forward routes.
+   * 
+ * + * bool can_ip_forward = 4; + * + * @return The canIpForward. + */ + boolean getCanIpForward(); } diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/Node.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/Node.java index 6de09b164900..cb429528686c 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/Node.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/Node.java @@ -51,6 +51,7 @@ private Node() { dataDisks_ = java.util.Collections.emptyList(); apiVersion_ = 0; symptoms_ = java.util.Collections.emptyList(); + queuedResource_ = ""; } @java.lang.Override @@ -167,7 +168,7 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * *
      * TPU node is being repaired and may be unusable. Details can be
-     * found in the `help_description` field.
+     * found in the 'help_description' field.
      * 
* * REPAIRING = 6; @@ -322,7 +323,7 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * *
      * TPU node is being repaired and may be unusable. Details can be
-     * found in the `help_description` field.
+     * found in the 'help_description' field.
      * 
* * REPAIRING = 6; @@ -1008,10 +1009,10 @@ public com.google.protobuf.ByteString getDescriptionBytes() { * * *
-   * Required. The type of hardware accelerators associated with this node.
+   * The type of hardware accelerators associated with this node.
    * 
* - * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * string accelerator_type = 5; * * @return The acceleratorType. */ @@ -1031,10 +1032,10 @@ public java.lang.String getAcceleratorType() { * * *
-   * Required. The type of hardware accelerators associated with this node.
+   * The type of hardware accelerators associated with this node.
    * 
* - * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * string accelerator_type = 5; * * @return The bytes for acceleratorType. */ @@ -1097,8 +1098,8 @@ public 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.
+   * 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]; @@ -1121,8 +1122,8 @@ public java.lang.String getHealthDescription() { * * *
-   * Output only. If this field is populated, it contains a description of why
-   * the TPU Node is unhealthy.
+   * 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]; @@ -2048,6 +2049,55 @@ public com.google.cloud.tpu.v2alpha1.SymptomOrBuilder getSymptomsOrBuilder(int i return symptoms_.get(index); } + public static final int QUEUED_RESOURCE_FIELD_NUMBER = 43; + private volatile java.lang.Object queuedResource_; + /** + * + * + *
+   * Output only. The qualified name of the QueuedResource that requested this Node.
+   * 
+ * + * string queued_resource = 43 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The queuedResource. + */ + @java.lang.Override + public java.lang.String getQueuedResource() { + java.lang.Object ref = queuedResource_; + 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(); + queuedResource_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The qualified name of the QueuedResource that requested this Node.
+   * 
+ * + * string queued_resource = 43 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for queuedResource. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueuedResourceBytes() { + java.lang.Object ref = queuedResource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + queuedResource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int SHIELDED_INSTANCE_CONFIG_FIELD_NUMBER = 45; private com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig shieldedInstanceConfig_; /** @@ -2170,6 +2220,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < dataDisks_.size(); i++) { output.writeMessage(41, dataDisks_.get(i)); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(queuedResource_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 43, queuedResource_); + } if (shieldedInstanceConfig_ != null) { output.writeMessage(45, getShieldedInstanceConfig()); } @@ -2263,6 +2316,9 @@ public int getSerializedSize() { for (int i = 0; i < dataDisks_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(41, dataDisks_.get(i)); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(queuedResource_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(43, queuedResource_); + } if (shieldedInstanceConfig_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(45, getShieldedInstanceConfig()); @@ -2314,6 +2370,7 @@ public boolean equals(final java.lang.Object obj) { if (!getDataDisksList().equals(other.getDataDisksList())) return false; if (apiVersion_ != other.apiVersion_) return false; if (!getSymptomsList().equals(other.getSymptomsList())) return false; + if (!getQueuedResource().equals(other.getQueuedResource())) return false; if (hasShieldedInstanceConfig() != other.hasShieldedInstanceConfig()) return false; if (hasShieldedInstanceConfig()) { if (!getShieldedInstanceConfig().equals(other.getShieldedInstanceConfig())) return false; @@ -2389,6 +2446,8 @@ public int hashCode() { hash = (37 * hash) + SYMPTOMS_FIELD_NUMBER; hash = (53 * hash) + getSymptomsList().hashCode(); } + hash = (37 * hash) + QUEUED_RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getQueuedResource().hashCode(); if (hasShieldedInstanceConfig()) { hash = (37 * hash) + SHIELDED_INSTANCE_CONFIG_FIELD_NUMBER; hash = (53 * hash) + getShieldedInstanceConfig().hashCode(); @@ -2623,6 +2682,8 @@ public Builder clear() { symptomsBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000020); + queuedResource_ = ""; + if (shieldedInstanceConfigBuilder_ == null) { shieldedInstanceConfig_ = null; } else { @@ -2722,6 +2783,7 @@ public com.google.cloud.tpu.v2alpha1.Node buildPartial() { } else { result.symptoms_ = symptomsBuilder_.build(); } + result.queuedResource_ = queuedResource_; if (shieldedInstanceConfigBuilder_ == null) { result.shieldedInstanceConfig_ = shieldedInstanceConfig_; } else { @@ -2917,6 +2979,10 @@ public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.Node other) { } } } + if (!other.getQueuedResource().isEmpty()) { + queuedResource_ = other.queuedResource_; + onChanged(); + } if (other.hasShieldedInstanceConfig()) { mergeShieldedInstanceConfig(other.getShieldedInstanceConfig()); } @@ -3099,6 +3165,12 @@ public Builder mergeFrom( } break; } // case 330 + case 346: + { + queuedResource_ = input.readStringRequireUtf8(); + + break; + } // case 346 case 362: { input.readMessage( @@ -3352,10 +3424,10 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { * * *
-     * Required. The type of hardware accelerators associated with this node.
+     * The type of hardware accelerators associated with this node.
      * 
* - * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * string accelerator_type = 5; * * @return The acceleratorType. */ @@ -3374,10 +3446,10 @@ public java.lang.String getAcceleratorType() { * * *
-     * Required. The type of hardware accelerators associated with this node.
+     * The type of hardware accelerators associated with this node.
      * 
* - * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * string accelerator_type = 5; * * @return The bytes for acceleratorType. */ @@ -3396,10 +3468,10 @@ public com.google.protobuf.ByteString getAcceleratorTypeBytes() { * * *
-     * Required. The type of hardware accelerators associated with this node.
+     * The type of hardware accelerators associated with this node.
      * 
* - * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * string accelerator_type = 5; * * @param value The acceleratorType to set. * @return This builder for chaining. @@ -3417,10 +3489,10 @@ public Builder setAcceleratorType(java.lang.String value) { * * *
-     * Required. The type of hardware accelerators associated with this node.
+     * The type of hardware accelerators associated with this node.
      * 
* - * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * string accelerator_type = 5; * * @return This builder for chaining. */ @@ -3434,10 +3506,10 @@ public Builder clearAcceleratorType() { * * *
-     * Required. The type of hardware accelerators associated with this node.
+     * The type of hardware accelerators associated with this node.
      * 
* - * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * string accelerator_type = 5; * * @param value The bytes for acceleratorType to set. * @return This builder for chaining. @@ -3559,8 +3631,8 @@ public Builder clearState() { * * *
-     * Output only. If this field is populated, it contains a description of why
-     * the TPU Node is unhealthy.
+     * 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]; @@ -3582,8 +3654,8 @@ public java.lang.String getHealthDescription() { * * *
-     * Output only. If this field is populated, it contains a description of why
-     * the TPU Node is unhealthy.
+     * 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]; @@ -3605,8 +3677,8 @@ public com.google.protobuf.ByteString getHealthDescriptionBytes() { * * *
-     * Output only. If this field is populated, it contains a description of why
-     * the TPU Node is unhealthy.
+     * 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]; @@ -3627,8 +3699,8 @@ public Builder setHealthDescription(java.lang.String value) { * * *
-     * Output only. If this field is populated, it contains a description of why
-     * the TPU Node is unhealthy.
+     * 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]; @@ -3645,8 +3717,8 @@ public Builder clearHealthDescription() { * * *
-     * Output only. If this field is populated, it contains a description of why
-     * the TPU Node is unhealthy.
+     * 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]; @@ -6592,6 +6664,112 @@ public java.util.List getSymptoms return symptomsBuilder_; } + private java.lang.Object queuedResource_ = ""; + /** + * + * + *
+     * Output only. The qualified name of the QueuedResource that requested this Node.
+     * 
+ * + * string queued_resource = 43 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The queuedResource. + */ + public java.lang.String getQueuedResource() { + java.lang.Object ref = queuedResource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + queuedResource_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The qualified name of the QueuedResource that requested this Node.
+     * 
+ * + * string queued_resource = 43 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for queuedResource. + */ + public com.google.protobuf.ByteString getQueuedResourceBytes() { + java.lang.Object ref = queuedResource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + queuedResource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The qualified name of the QueuedResource that requested this Node.
+     * 
+ * + * string queued_resource = 43 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The queuedResource to set. + * @return This builder for chaining. + */ + public Builder setQueuedResource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + queuedResource_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The qualified name of the QueuedResource that requested this Node.
+     * 
+ * + * string queued_resource = 43 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearQueuedResource() { + + queuedResource_ = getDefaultInstance().getQueuedResource(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The qualified name of the QueuedResource that requested this Node.
+     * 
+ * + * string queued_resource = 43 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for queuedResource to set. + * @return This builder for chaining. + */ + public Builder setQueuedResourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + queuedResource_ = value; + onChanged(); + return this; + } + private com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig shieldedInstanceConfig_; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig, diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NodeOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NodeOrBuilder.java index 9bce8749021f..155eb32abc34 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NodeOrBuilder.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/NodeOrBuilder.java @@ -81,10 +81,10 @@ public interface NodeOrBuilder * * *
-   * Required. The type of hardware accelerators associated with this node.
+   * The type of hardware accelerators associated with this node.
    * 
* - * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * string accelerator_type = 5; * * @return The acceleratorType. */ @@ -93,10 +93,10 @@ public interface NodeOrBuilder * * *
-   * Required. The type of hardware accelerators associated with this node.
+   * The type of hardware accelerators associated with this node.
    * 
* - * string accelerator_type = 5 [(.google.api.field_behavior) = REQUIRED]; + * string accelerator_type = 5; * * @return The bytes for acceleratorType. */ @@ -135,8 +135,8 @@ public interface NodeOrBuilder * * *
-   * Output only. If this field is populated, it contains a description of why
-   * the TPU Node is unhealthy.
+   * 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]; @@ -148,8 +148,8 @@ public interface NodeOrBuilder * * *
-   * Output only. If this field is populated, it contains a description of why
-   * the TPU Node is unhealthy.
+   * 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]; @@ -799,6 +799,31 @@ java.lang.String getMetadataOrDefault( */ com.google.cloud.tpu.v2alpha1.SymptomOrBuilder getSymptomsOrBuilder(int index); + /** + * + * + *
+   * Output only. The qualified name of the QueuedResource that requested this Node.
+   * 
+ * + * string queued_resource = 43 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The queuedResource. + */ + java.lang.String getQueuedResource(); + /** + * + * + *
+   * Output only. The qualified name of the QueuedResource that requested this Node.
+   * 
+ * + * string queued_resource = 43 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for queuedResource. + */ + com.google.protobuf.ByteString getQueuedResourceBytes(); + /** * * diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/QueuedResource.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/QueuedResource.java new file mode 100644 index 000000000000..520825861497 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/QueuedResource.java @@ -0,0 +1,7988 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * A QueuedResource represents a request for resources that will be placed
+ * in a queue and fulfilled when the necessary resources are available.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResource} + */ +public final class QueuedResource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.QueuedResource) + QueuedResourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueuedResource.newBuilder() to construct. + private QueuedResource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueuedResource() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueuedResource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResource.class, + com.google.cloud.tpu.v2alpha1.QueuedResource.Builder.class); + } + + public interface TpuOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.QueuedResource.Tpu) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The TPU node(s) being requested.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + java.util.List getNodeSpecList(); + /** + * + * + *
+     * The TPU node(s) being requested.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec getNodeSpec(int index); + /** + * + * + *
+     * The TPU node(s) being requested.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + int getNodeSpecCount(); + /** + * + * + *
+     * The TPU node(s) being requested.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + java.util.List + getNodeSpecOrBuilderList(); + /** + * + * + *
+     * The TPU node(s) being requested.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpecOrBuilder getNodeSpecOrBuilder( + int index); + } + /** + * + * + *
+   * Details of the TPU resource(s) being requested.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResource.Tpu} + */ + public static final class Tpu extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.QueuedResource.Tpu) + TpuOrBuilder { + private static final long serialVersionUID = 0L; + // Use Tpu.newBuilder() to construct. + private Tpu(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Tpu() { + nodeSpec_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Tpu(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_Tpu_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_Tpu_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.class, + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.Builder.class); + } + + public interface NodeSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec) + 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. Should follow the ^[A-Za-z0-9_.~+%-]+$
+       * regex format. This is only specified when requesting a single node.
+       * In case of multi-node requests, multi_node_params must be populated
+       * instead. It's an error to specify both node_id and multi_node_params.
+       * 
+ * + * string node_id = 2; + * + * @return The nodeId. + */ + java.lang.String getNodeId(); + /** + * + * + *
+       * The unqualified resource name. Should follow the ^[A-Za-z0-9_.~+%-]+$
+       * regex format. This is only specified when requesting a single node.
+       * In case of multi-node requests, multi_node_params must be populated
+       * instead. It's an error to specify both node_id and multi_node_params.
+       * 
+ * + * 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(); + } + /** + * + * + *
+     * Details of the TPU node(s) being requested. Users can request either a
+     * single node or multiple nodes.
+     * NodeSpec provides the specification for node(s) to be created.
+     * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec} + */ + public static final class NodeSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec) + NodeSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use NodeSpec.newBuilder() to construct. + private NodeSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NodeSpec() { + parent_ = ""; + nodeId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NodeSpec(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_Tpu_NodeSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_Tpu_NodeSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec.class, + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec.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. Should follow the ^[A-Za-z0-9_.~+%-]+$
+       * regex format. This is only specified when requesting a single node.
+       * In case of multi-node requests, multi_node_params must be populated
+       * instead. It's an error to specify both node_id and multi_node_params.
+       * 
+ * + * 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. Should follow the ^[A-Za-z0-9_.~+%-]+$
+       * regex format. This is only specified when requesting a single node.
+       * In case of multi-node requests, multi_node_params must be populated
+       * instead. It's an error to specify both node_id and multi_node_params.
+       * 
+ * + * 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()); + } + getUnknownFields().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 += getUnknownFields().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.QueuedResource.Tpu.NodeSpec)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec other = + (com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec) 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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec 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.QueuedResource.Tpu.NodeSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec 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.QueuedResource.Tpu.NodeSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec 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.QueuedResource.Tpu.NodeSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec 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.QueuedResource.Tpu.NodeSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec 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.QueuedResource.Tpu.NodeSpec 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.QueuedResource.Tpu.NodeSpec 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.QueuedResource.Tpu.NodeSpec 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; + } + /** + * + * + *
+       * Details of the TPU node(s) being requested. Users can request either a
+       * single node or multiple nodes.
+       * NodeSpec provides the specification for node(s) to be created.
+       * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec) + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_Tpu_NodeSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_Tpu_NodeSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec.class, + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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_QueuedResource_Tpu_NodeSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec + getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec build() { + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec buildPartial() { + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec result = + new com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec(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.QueuedResource.Tpu.NodeSpec) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec other) { + if (other + == com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec.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.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + nodeId_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + input.readMessage(getNodeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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. Should follow the ^[A-Za-z0-9_.~+%-]+$
+         * regex format. This is only specified when requesting a single node.
+         * In case of multi-node requests, multi_node_params must be populated
+         * instead. It's an error to specify both node_id and multi_node_params.
+         * 
+ * + * 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. Should follow the ^[A-Za-z0-9_.~+%-]+$
+         * regex format. This is only specified when requesting a single node.
+         * In case of multi-node requests, multi_node_params must be populated
+         * instead. It's an error to specify both node_id and multi_node_params.
+         * 
+ * + * 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. Should follow the ^[A-Za-z0-9_.~+%-]+$
+         * regex format. This is only specified when requesting a single node.
+         * In case of multi-node requests, multi_node_params must be populated
+         * instead. It's an error to specify both node_id and multi_node_params.
+         * 
+ * + * 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. Should follow the ^[A-Za-z0-9_.~+%-]+$
+         * regex format. This is only specified when requesting a single node.
+         * In case of multi-node requests, multi_node_params must be populated
+         * instead. It's an error to specify both node_id and multi_node_params.
+         * 
+ * + * string node_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearNodeId() { + + nodeId_ = getDefaultInstance().getNodeId(); + onChanged(); + return this; + } + /** + * + * + *
+         * The unqualified resource name. Should follow the ^[A-Za-z0-9_.~+%-]+$
+         * regex format. This is only specified when requesting a single node.
+         * In case of multi-node requests, multi_node_params must be populated
+         * instead. It's an error to specify both node_id and multi_node_params.
+         * 
+ * + * 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.QueuedResource.Tpu.NodeSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec) + private static final com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec(); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NodeSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.QueuedResource.Tpu.NodeSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NODE_SPEC_FIELD_NUMBER = 1; + private java.util.List nodeSpec_; + /** + * + * + *
+     * The TPU node(s) being requested.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + @java.lang.Override + public java.util.List + getNodeSpecList() { + return nodeSpec_; + } + /** + * + * + *
+     * The TPU node(s) being requested.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpecOrBuilder> + getNodeSpecOrBuilderList() { + return nodeSpec_; + } + /** + * + * + *
+     * The TPU node(s) being requested.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + @java.lang.Override + public int getNodeSpecCount() { + return nodeSpec_.size(); + } + /** + * + * + *
+     * The TPU node(s) being requested.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec getNodeSpec(int index) { + return nodeSpec_.get(index); + } + /** + * + * + *
+     * The TPU node(s) being requested.
+     * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpecOrBuilder getNodeSpecOrBuilder( + int index) { + return nodeSpec_.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 < nodeSpec_.size(); i++) { + output.writeMessage(1, nodeSpec_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < nodeSpec_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, nodeSpec_.get(i)); + } + size += getUnknownFields().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.QueuedResource.Tpu)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu other = + (com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu) obj; + + if (!getNodeSpecList().equals(other.getNodeSpecList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getNodeSpecCount() > 0) { + hash = (37 * hash) + NODE_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getNodeSpecList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu 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.QueuedResource.Tpu parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu 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.QueuedResource.Tpu parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu 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.QueuedResource.Tpu parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu 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.QueuedResource.Tpu parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu 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.QueuedResource.Tpu 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.QueuedResource.Tpu 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.QueuedResource.Tpu 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; + } + /** + * + * + *
+     * Details of the TPU resource(s) being requested.
+     * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResource.Tpu} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.QueuedResource.Tpu) + com.google.cloud.tpu.v2alpha1.QueuedResource.TpuOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_Tpu_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_Tpu_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.class, + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (nodeSpecBuilder_ == null) { + nodeSpec_ = java.util.Collections.emptyList(); + } else { + nodeSpec_ = null; + nodeSpecBuilder_.clear(); + } + 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_QueuedResource_Tpu_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu build() { + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu buildPartial() { + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu result = + new com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu(this); + int from_bitField0_ = bitField0_; + if (nodeSpecBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + nodeSpec_ = java.util.Collections.unmodifiableList(nodeSpec_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.nodeSpec_ = nodeSpec_; + } else { + result.nodeSpec_ = nodeSpecBuilder_.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.QueuedResource.Tpu) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu other) { + if (other == com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.getDefaultInstance()) + return this; + if (nodeSpecBuilder_ == null) { + if (!other.nodeSpec_.isEmpty()) { + if (nodeSpec_.isEmpty()) { + nodeSpec_ = other.nodeSpec_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNodeSpecIsMutable(); + nodeSpec_.addAll(other.nodeSpec_); + } + onChanged(); + } + } else { + if (!other.nodeSpec_.isEmpty()) { + if (nodeSpecBuilder_.isEmpty()) { + nodeSpecBuilder_.dispose(); + nodeSpecBuilder_ = null; + nodeSpec_ = other.nodeSpec_; + bitField0_ = (bitField0_ & ~0x00000001); + nodeSpecBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNodeSpecFieldBuilder() + : null; + } else { + nodeSpecBuilder_.addAllMessages(other.nodeSpec_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec m = + input.readMessage( + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec.parser(), + extensionRegistry); + if (nodeSpecBuilder_ == null) { + ensureNodeSpecIsMutable(); + nodeSpec_.add(m); + } else { + nodeSpecBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List nodeSpec_ = + java.util.Collections.emptyList(); + + private void ensureNodeSpecIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + nodeSpec_ = + new java.util.ArrayList( + nodeSpec_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec, + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpecOrBuilder> + nodeSpecBuilder_; + + /** + * + * + *
+       * The TPU node(s) being requested.
+       * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + public java.util.List + getNodeSpecList() { + if (nodeSpecBuilder_ == null) { + return java.util.Collections.unmodifiableList(nodeSpec_); + } else { + return nodeSpecBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * The TPU node(s) being requested.
+       * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + public int getNodeSpecCount() { + if (nodeSpecBuilder_ == null) { + return nodeSpec_.size(); + } else { + return nodeSpecBuilder_.getCount(); + } + } + /** + * + * + *
+       * The TPU node(s) being requested.
+       * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + public com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec getNodeSpec(int index) { + if (nodeSpecBuilder_ == null) { + return nodeSpec_.get(index); + } else { + return nodeSpecBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * The TPU node(s) being requested.
+       * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + public Builder setNodeSpec( + int index, com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec value) { + if (nodeSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeSpecIsMutable(); + nodeSpec_.set(index, value); + onChanged(); + } else { + nodeSpecBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The TPU node(s) being requested.
+       * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + public Builder setNodeSpec( + int index, + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec.Builder builderForValue) { + if (nodeSpecBuilder_ == null) { + ensureNodeSpecIsMutable(); + nodeSpec_.set(index, builderForValue.build()); + onChanged(); + } else { + nodeSpecBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The TPU node(s) being requested.
+       * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + public Builder addNodeSpec(com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec value) { + if (nodeSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeSpecIsMutable(); + nodeSpec_.add(value); + onChanged(); + } else { + nodeSpecBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * The TPU node(s) being requested.
+       * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + public Builder addNodeSpec( + int index, com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec value) { + if (nodeSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeSpecIsMutable(); + nodeSpec_.add(index, value); + onChanged(); + } else { + nodeSpecBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The TPU node(s) being requested.
+       * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + public Builder addNodeSpec( + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec.Builder builderForValue) { + if (nodeSpecBuilder_ == null) { + ensureNodeSpecIsMutable(); + nodeSpec_.add(builderForValue.build()); + onChanged(); + } else { + nodeSpecBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The TPU node(s) being requested.
+       * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + public Builder addNodeSpec( + int index, + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec.Builder builderForValue) { + if (nodeSpecBuilder_ == null) { + ensureNodeSpecIsMutable(); + nodeSpec_.add(index, builderForValue.build()); + onChanged(); + } else { + nodeSpecBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The TPU node(s) being requested.
+       * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + public Builder addAllNodeSpec( + java.lang.Iterable + values) { + if (nodeSpecBuilder_ == null) { + ensureNodeSpecIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, nodeSpec_); + onChanged(); + } else { + nodeSpecBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * The TPU node(s) being requested.
+       * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + public Builder clearNodeSpec() { + if (nodeSpecBuilder_ == null) { + nodeSpec_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + nodeSpecBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * The TPU node(s) being requested.
+       * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + public Builder removeNodeSpec(int index) { + if (nodeSpecBuilder_ == null) { + ensureNodeSpecIsMutable(); + nodeSpec_.remove(index); + onChanged(); + } else { + nodeSpecBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * The TPU node(s) being requested.
+       * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + public com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec.Builder getNodeSpecBuilder( + int index) { + return getNodeSpecFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * The TPU node(s) being requested.
+       * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + public com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpecOrBuilder + getNodeSpecOrBuilder(int index) { + if (nodeSpecBuilder_ == null) { + return nodeSpec_.get(index); + } else { + return nodeSpecBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * The TPU node(s) being requested.
+       * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + public java.util.List< + ? extends com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpecOrBuilder> + getNodeSpecOrBuilderList() { + if (nodeSpecBuilder_ != null) { + return nodeSpecBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nodeSpec_); + } + } + /** + * + * + *
+       * The TPU node(s) being requested.
+       * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + public com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec.Builder + addNodeSpecBuilder() { + return getNodeSpecFieldBuilder() + .addBuilder( + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec.getDefaultInstance()); + } + /** + * + * + *
+       * The TPU node(s) being requested.
+       * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + public com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec.Builder addNodeSpecBuilder( + int index) { + return getNodeSpecFieldBuilder() + .addBuilder( + index, + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec.getDefaultInstance()); + } + /** + * + * + *
+       * The TPU node(s) being requested.
+       * 
+ * + * repeated .google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec node_spec = 1; + */ + public java.util.List + getNodeSpecBuilderList() { + return getNodeSpecFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec, + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpecOrBuilder> + getNodeSpecFieldBuilder() { + if (nodeSpecBuilder_ == null) { + nodeSpecBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec, + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpec.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.NodeSpecOrBuilder>( + nodeSpec_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + nodeSpec_ = null; + } + return nodeSpecBuilder_; + } + + @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.QueuedResource.Tpu) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.QueuedResource.Tpu) + private static final com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu(); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Tpu parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.QueuedResource.Tpu getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface BestEffortOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.QueuedResource.BestEffort) + com.google.protobuf.MessageOrBuilder {} + /** + * + * + *
+   * BestEffort tier definition.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResource.BestEffort} + */ + public static final class BestEffort extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.QueuedResource.BestEffort) + BestEffortOrBuilder { + private static final long serialVersionUID = 0L; + // Use BestEffort.newBuilder() to construct. + private BestEffort(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BestEffort() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BestEffort(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_BestEffort_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_BestEffort_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort.class, + com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.QueuedResource.BestEffort)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort other = + (com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort 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.QueuedResource.BestEffort parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort 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.QueuedResource.BestEffort parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort 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.QueuedResource.BestEffort parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort 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.QueuedResource.BestEffort parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort 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.QueuedResource.BestEffort 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.QueuedResource.BestEffort 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.QueuedResource.BestEffort 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; + } + /** + * + * + *
+     * BestEffort tier definition.
+     * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResource.BestEffort} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.QueuedResource.BestEffort) + com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffortOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_BestEffort_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_BestEffort_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort.class, + com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.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_QueuedResource_BestEffort_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort build() { + com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort buildPartial() { + com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort result = + new com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort other) { + if (other == com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.QueuedResource.BestEffort) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.QueuedResource.BestEffort) + private static final com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort(); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BestEffort parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.QueuedResource.BestEffort getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface GuaranteedOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Optional. Defines the minimum duration of the guarantee. If specified,
+     * the requested resources will only be provisioned if they can be
+     * allocated for at least the given duration.
+     * 
+ * + * .google.protobuf.Duration min_duration = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the minDuration field is set. + */ + boolean hasMinDuration(); + /** + * + * + *
+     * Optional. Defines the minimum duration of the guarantee. If specified,
+     * the requested resources will only be provisioned if they can be
+     * allocated for at least the given duration.
+     * 
+ * + * .google.protobuf.Duration min_duration = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The minDuration. + */ + com.google.protobuf.Duration getMinDuration(); + /** + * + * + *
+     * Optional. Defines the minimum duration of the guarantee. If specified,
+     * the requested resources will only be provisioned if they can be
+     * allocated for at least the given duration.
+     * 
+ * + * .google.protobuf.Duration min_duration = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.DurationOrBuilder getMinDurationOrBuilder(); + + /** + * + * + *
+     * Optional. Specifies the request should be scheduled on reserved capacity.
+     * 
+ * + * bool reserved = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The reserved. + */ + boolean getReserved(); + } + /** + * + * + *
+   * Guaranteed tier definition.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed} + */ + public static final class Guaranteed extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed) + GuaranteedOrBuilder { + private static final long serialVersionUID = 0L; + // Use Guaranteed.newBuilder() to construct. + private Guaranteed(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Guaranteed() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Guaranteed(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_Guaranteed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_Guaranteed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed.class, + com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed.Builder.class); + } + + public static final int MIN_DURATION_FIELD_NUMBER = 1; + private com.google.protobuf.Duration minDuration_; + /** + * + * + *
+     * Optional. Defines the minimum duration of the guarantee. If specified,
+     * the requested resources will only be provisioned if they can be
+     * allocated for at least the given duration.
+     * 
+ * + * .google.protobuf.Duration min_duration = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the minDuration field is set. + */ + @java.lang.Override + public boolean hasMinDuration() { + return minDuration_ != null; + } + /** + * + * + *
+     * Optional. Defines the minimum duration of the guarantee. If specified,
+     * the requested resources will only be provisioned if they can be
+     * allocated for at least the given duration.
+     * 
+ * + * .google.protobuf.Duration min_duration = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The minDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getMinDuration() { + return minDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : minDuration_; + } + /** + * + * + *
+     * Optional. Defines the minimum duration of the guarantee. If specified,
+     * the requested resources will only be provisioned if they can be
+     * allocated for at least the given duration.
+     * 
+ * + * .google.protobuf.Duration min_duration = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getMinDurationOrBuilder() { + return getMinDuration(); + } + + public static final int RESERVED_FIELD_NUMBER = 2; + private boolean reserved_; + /** + * + * + *
+     * Optional. Specifies the request should be scheduled on reserved capacity.
+     * 
+ * + * bool reserved = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 (minDuration_ != null) { + output.writeMessage(1, getMinDuration()); + } + if (reserved_ != false) { + output.writeBool(2, reserved_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (minDuration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMinDuration()); + } + if (reserved_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, reserved_); + } + size += getUnknownFields().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.QueuedResource.Guaranteed)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed other = + (com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed) obj; + + if (hasMinDuration() != other.hasMinDuration()) return false; + if (hasMinDuration()) { + if (!getMinDuration().equals(other.getMinDuration())) return false; + } + if (getReserved() != other.getReserved()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMinDuration()) { + hash = (37 * hash) + MIN_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getMinDuration().hashCode(); + } + hash = (37 * hash) + RESERVED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReserved()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed 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.QueuedResource.Guaranteed parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed 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.QueuedResource.Guaranteed parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed 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.QueuedResource.Guaranteed parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed 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.QueuedResource.Guaranteed parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed 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.QueuedResource.Guaranteed 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.QueuedResource.Guaranteed 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.QueuedResource.Guaranteed 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; + } + /** + * + * + *
+     * Guaranteed tier definition.
+     * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed) + com.google.cloud.tpu.v2alpha1.QueuedResource.GuaranteedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_Guaranteed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_Guaranteed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed.class, + com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (minDurationBuilder_ == null) { + minDuration_ = null; + } else { + minDuration_ = null; + minDurationBuilder_ = null; + } + 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_QueuedResource_Guaranteed_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed build() { + com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed buildPartial() { + com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed result = + new com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed(this); + if (minDurationBuilder_ == null) { + result.minDuration_ = minDuration_; + } else { + result.minDuration_ = minDurationBuilder_.build(); + } + 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.QueuedResource.Guaranteed) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed other) { + if (other == com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed.getDefaultInstance()) + return this; + if (other.hasMinDuration()) { + mergeMinDuration(other.getMinDuration()); + } + if (other.getReserved() != false) { + setReserved(other.getReserved()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getMinDurationFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 16: + { + reserved_ = input.readBool(); + + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private com.google.protobuf.Duration minDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + minDurationBuilder_; + /** + * + * + *
+       * Optional. Defines the minimum duration of the guarantee. If specified,
+       * the requested resources will only be provisioned if they can be
+       * allocated for at least the given duration.
+       * 
+ * + * .google.protobuf.Duration min_duration = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the minDuration field is set. + */ + public boolean hasMinDuration() { + return minDurationBuilder_ != null || minDuration_ != null; + } + /** + * + * + *
+       * Optional. Defines the minimum duration of the guarantee. If specified,
+       * the requested resources will only be provisioned if they can be
+       * allocated for at least the given duration.
+       * 
+ * + * .google.protobuf.Duration min_duration = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The minDuration. + */ + public com.google.protobuf.Duration getMinDuration() { + if (minDurationBuilder_ == null) { + return minDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : minDuration_; + } else { + return minDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Optional. Defines the minimum duration of the guarantee. If specified,
+       * the requested resources will only be provisioned if they can be
+       * allocated for at least the given duration.
+       * 
+ * + * .google.protobuf.Duration min_duration = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setMinDuration(com.google.protobuf.Duration value) { + if (minDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + minDuration_ = value; + onChanged(); + } else { + minDurationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Optional. Defines the minimum duration of the guarantee. If specified,
+       * the requested resources will only be provisioned if they can be
+       * allocated for at least the given duration.
+       * 
+ * + * .google.protobuf.Duration min_duration = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setMinDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (minDurationBuilder_ == null) { + minDuration_ = builderForValue.build(); + onChanged(); + } else { + minDurationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Optional. Defines the minimum duration of the guarantee. If specified,
+       * the requested resources will only be provisioned if they can be
+       * allocated for at least the given duration.
+       * 
+ * + * .google.protobuf.Duration min_duration = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeMinDuration(com.google.protobuf.Duration value) { + if (minDurationBuilder_ == null) { + if (minDuration_ != null) { + minDuration_ = + com.google.protobuf.Duration.newBuilder(minDuration_) + .mergeFrom(value) + .buildPartial(); + } else { + minDuration_ = value; + } + onChanged(); + } else { + minDurationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Optional. Defines the minimum duration of the guarantee. If specified,
+       * the requested resources will only be provisioned if they can be
+       * allocated for at least the given duration.
+       * 
+ * + * .google.protobuf.Duration min_duration = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearMinDuration() { + if (minDurationBuilder_ == null) { + minDuration_ = null; + onChanged(); + } else { + minDuration_ = null; + minDurationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Optional. Defines the minimum duration of the guarantee. If specified,
+       * the requested resources will only be provisioned if they can be
+       * allocated for at least the given duration.
+       * 
+ * + * .google.protobuf.Duration min_duration = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Duration.Builder getMinDurationBuilder() { + + onChanged(); + return getMinDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Optional. Defines the minimum duration of the guarantee. If specified,
+       * the requested resources will only be provisioned if they can be
+       * allocated for at least the given duration.
+       * 
+ * + * .google.protobuf.Duration min_duration = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.DurationOrBuilder getMinDurationOrBuilder() { + if (minDurationBuilder_ != null) { + return minDurationBuilder_.getMessageOrBuilder(); + } else { + return minDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : minDuration_; + } + } + /** + * + * + *
+       * Optional. Defines the minimum duration of the guarantee. If specified,
+       * the requested resources will only be provisioned if they can be
+       * allocated for at least the given duration.
+       * 
+ * + * .google.protobuf.Duration min_duration = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getMinDurationFieldBuilder() { + if (minDurationBuilder_ == null) { + minDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getMinDuration(), getParentForChildren(), isClean()); + minDuration_ = null; + } + return minDurationBuilder_; + } + + private boolean reserved_; + /** + * + * + *
+       * Optional. Specifies the request should be scheduled on reserved capacity.
+       * 
+ * + * bool reserved = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The reserved. + */ + @java.lang.Override + public boolean getReserved() { + return reserved_; + } + /** + * + * + *
+       * Optional. Specifies the request should be scheduled on reserved capacity.
+       * 
+ * + * bool reserved = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The reserved to set. + * @return This builder for chaining. + */ + public Builder setReserved(boolean value) { + + reserved_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. Specifies the request should be scheduled on reserved capacity.
+       * 
+ * + * bool reserved = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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.QueuedResource.Guaranteed) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed) + private static final com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed(); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Guaranteed parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.QueuedResource.Guaranteed getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface QueueingPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * A relative time after which resources should not be created.
+     * If the request cannot be fulfilled by this time the request will be
+     * failed.
+     * 
+ * + * .google.protobuf.Duration valid_until_duration = 1; + * + * @return Whether the validUntilDuration field is set. + */ + boolean hasValidUntilDuration(); + /** + * + * + *
+     * A relative time after which resources should not be created.
+     * If the request cannot be fulfilled by this time the request will be
+     * failed.
+     * 
+ * + * .google.protobuf.Duration valid_until_duration = 1; + * + * @return The validUntilDuration. + */ + com.google.protobuf.Duration getValidUntilDuration(); + /** + * + * + *
+     * A relative time after which resources should not be created.
+     * If the request cannot be fulfilled by this time the request will be
+     * failed.
+     * 
+ * + * .google.protobuf.Duration valid_until_duration = 1; + */ + com.google.protobuf.DurationOrBuilder getValidUntilDurationOrBuilder(); + + /** + * + * + *
+     * An absolute time after which resources should not be created.
+     * If the request cannot be fulfilled by this time the request will be
+     * failed.
+     * 
+ * + * .google.protobuf.Timestamp valid_until_time = 2; + * + * @return Whether the validUntilTime field is set. + */ + boolean hasValidUntilTime(); + /** + * + * + *
+     * An absolute time after which resources should not be created.
+     * If the request cannot be fulfilled by this time the request will be
+     * failed.
+     * 
+ * + * .google.protobuf.Timestamp valid_until_time = 2; + * + * @return The validUntilTime. + */ + com.google.protobuf.Timestamp getValidUntilTime(); + /** + * + * + *
+     * An absolute time after which resources should not be created.
+     * If the request cannot be fulfilled by this time the request will be
+     * failed.
+     * 
+ * + * .google.protobuf.Timestamp valid_until_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getValidUntilTimeOrBuilder(); + + /** + * + * + *
+     * A relative time after which resources may be created.
+     * 
+ * + * .google.protobuf.Duration valid_after_duration = 3; + * + * @return Whether the validAfterDuration field is set. + */ + boolean hasValidAfterDuration(); + /** + * + * + *
+     * A relative time after which resources may be created.
+     * 
+ * + * .google.protobuf.Duration valid_after_duration = 3; + * + * @return The validAfterDuration. + */ + com.google.protobuf.Duration getValidAfterDuration(); + /** + * + * + *
+     * A relative time after which resources may be created.
+     * 
+ * + * .google.protobuf.Duration valid_after_duration = 3; + */ + com.google.protobuf.DurationOrBuilder getValidAfterDurationOrBuilder(); + + /** + * + * + *
+     * An absolute time at which resources may be created.
+     * 
+ * + * .google.protobuf.Timestamp valid_after_time = 4; + * + * @return Whether the validAfterTime field is set. + */ + boolean hasValidAfterTime(); + /** + * + * + *
+     * An absolute time at which resources may be created.
+     * 
+ * + * .google.protobuf.Timestamp valid_after_time = 4; + * + * @return The validAfterTime. + */ + com.google.protobuf.Timestamp getValidAfterTime(); + /** + * + * + *
+     * An absolute time at which resources may be created.
+     * 
+ * + * .google.protobuf.Timestamp valid_after_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getValidAfterTimeOrBuilder(); + + /** + * + * + *
+     * An absolute time interval within which resources may be created.
+     * 
+ * + * .google.type.Interval valid_interval = 5; + * + * @return Whether the validInterval field is set. + */ + boolean hasValidInterval(); + /** + * + * + *
+     * An absolute time interval within which resources may be created.
+     * 
+ * + * .google.type.Interval valid_interval = 5; + * + * @return The validInterval. + */ + com.google.type.Interval getValidInterval(); + /** + * + * + *
+     * An absolute time interval within which resources may be created.
+     * 
+ * + * .google.type.Interval valid_interval = 5; + */ + com.google.type.IntervalOrBuilder getValidIntervalOrBuilder(); + + public com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy.StartTimingConstraintsCase + getStartTimingConstraintsCase(); + } + /** + * + * + *
+   * Defines the policy of the QueuedRequest.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy} + */ + public static final class QueueingPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy) + QueueingPolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueueingPolicy.newBuilder() to construct. + private QueueingPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueueingPolicy() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueueingPolicy(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_QueueingPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_QueueingPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy.class, + com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy.Builder.class); + } + + private int startTimingConstraintsCase_ = 0; + private java.lang.Object startTimingConstraints_; + + public enum StartTimingConstraintsCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + VALID_UNTIL_DURATION(1), + VALID_UNTIL_TIME(2), + VALID_AFTER_DURATION(3), + VALID_AFTER_TIME(4), + VALID_INTERVAL(5), + STARTTIMINGCONSTRAINTS_NOT_SET(0); + private final int value; + + private StartTimingConstraintsCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static StartTimingConstraintsCase valueOf(int value) { + return forNumber(value); + } + + public static StartTimingConstraintsCase forNumber(int value) { + switch (value) { + case 1: + return VALID_UNTIL_DURATION; + case 2: + return VALID_UNTIL_TIME; + case 3: + return VALID_AFTER_DURATION; + case 4: + return VALID_AFTER_TIME; + case 5: + return VALID_INTERVAL; + case 0: + return STARTTIMINGCONSTRAINTS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public StartTimingConstraintsCase getStartTimingConstraintsCase() { + return StartTimingConstraintsCase.forNumber(startTimingConstraintsCase_); + } + + public static final int VALID_UNTIL_DURATION_FIELD_NUMBER = 1; + /** + * + * + *
+     * A relative time after which resources should not be created.
+     * If the request cannot be fulfilled by this time the request will be
+     * failed.
+     * 
+ * + * .google.protobuf.Duration valid_until_duration = 1; + * + * @return Whether the validUntilDuration field is set. + */ + @java.lang.Override + public boolean hasValidUntilDuration() { + return startTimingConstraintsCase_ == 1; + } + /** + * + * + *
+     * A relative time after which resources should not be created.
+     * If the request cannot be fulfilled by this time the request will be
+     * failed.
+     * 
+ * + * .google.protobuf.Duration valid_until_duration = 1; + * + * @return The validUntilDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getValidUntilDuration() { + if (startTimingConstraintsCase_ == 1) { + return (com.google.protobuf.Duration) startTimingConstraints_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + /** + * + * + *
+     * A relative time after which resources should not be created.
+     * If the request cannot be fulfilled by this time the request will be
+     * failed.
+     * 
+ * + * .google.protobuf.Duration valid_until_duration = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getValidUntilDurationOrBuilder() { + if (startTimingConstraintsCase_ == 1) { + return (com.google.protobuf.Duration) startTimingConstraints_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + public static final int VALID_UNTIL_TIME_FIELD_NUMBER = 2; + /** + * + * + *
+     * An absolute time after which resources should not be created.
+     * If the request cannot be fulfilled by this time the request will be
+     * failed.
+     * 
+ * + * .google.protobuf.Timestamp valid_until_time = 2; + * + * @return Whether the validUntilTime field is set. + */ + @java.lang.Override + public boolean hasValidUntilTime() { + return startTimingConstraintsCase_ == 2; + } + /** + * + * + *
+     * An absolute time after which resources should not be created.
+     * If the request cannot be fulfilled by this time the request will be
+     * failed.
+     * 
+ * + * .google.protobuf.Timestamp valid_until_time = 2; + * + * @return The validUntilTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getValidUntilTime() { + if (startTimingConstraintsCase_ == 2) { + return (com.google.protobuf.Timestamp) startTimingConstraints_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + /** + * + * + *
+     * An absolute time after which resources should not be created.
+     * If the request cannot be fulfilled by this time the request will be
+     * failed.
+     * 
+ * + * .google.protobuf.Timestamp valid_until_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getValidUntilTimeOrBuilder() { + if (startTimingConstraintsCase_ == 2) { + return (com.google.protobuf.Timestamp) startTimingConstraints_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + public static final int VALID_AFTER_DURATION_FIELD_NUMBER = 3; + /** + * + * + *
+     * A relative time after which resources may be created.
+     * 
+ * + * .google.protobuf.Duration valid_after_duration = 3; + * + * @return Whether the validAfterDuration field is set. + */ + @java.lang.Override + public boolean hasValidAfterDuration() { + return startTimingConstraintsCase_ == 3; + } + /** + * + * + *
+     * A relative time after which resources may be created.
+     * 
+ * + * .google.protobuf.Duration valid_after_duration = 3; + * + * @return The validAfterDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getValidAfterDuration() { + if (startTimingConstraintsCase_ == 3) { + return (com.google.protobuf.Duration) startTimingConstraints_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + /** + * + * + *
+     * A relative time after which resources may be created.
+     * 
+ * + * .google.protobuf.Duration valid_after_duration = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getValidAfterDurationOrBuilder() { + if (startTimingConstraintsCase_ == 3) { + return (com.google.protobuf.Duration) startTimingConstraints_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + public static final int VALID_AFTER_TIME_FIELD_NUMBER = 4; + /** + * + * + *
+     * An absolute time at which resources may be created.
+     * 
+ * + * .google.protobuf.Timestamp valid_after_time = 4; + * + * @return Whether the validAfterTime field is set. + */ + @java.lang.Override + public boolean hasValidAfterTime() { + return startTimingConstraintsCase_ == 4; + } + /** + * + * + *
+     * An absolute time at which resources may be created.
+     * 
+ * + * .google.protobuf.Timestamp valid_after_time = 4; + * + * @return The validAfterTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getValidAfterTime() { + if (startTimingConstraintsCase_ == 4) { + return (com.google.protobuf.Timestamp) startTimingConstraints_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + /** + * + * + *
+     * An absolute time at which resources may be created.
+     * 
+ * + * .google.protobuf.Timestamp valid_after_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getValidAfterTimeOrBuilder() { + if (startTimingConstraintsCase_ == 4) { + return (com.google.protobuf.Timestamp) startTimingConstraints_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + public static final int VALID_INTERVAL_FIELD_NUMBER = 5; + /** + * + * + *
+     * An absolute time interval within which resources may be created.
+     * 
+ * + * .google.type.Interval valid_interval = 5; + * + * @return Whether the validInterval field is set. + */ + @java.lang.Override + public boolean hasValidInterval() { + return startTimingConstraintsCase_ == 5; + } + /** + * + * + *
+     * An absolute time interval within which resources may be created.
+     * 
+ * + * .google.type.Interval valid_interval = 5; + * + * @return The validInterval. + */ + @java.lang.Override + public com.google.type.Interval getValidInterval() { + if (startTimingConstraintsCase_ == 5) { + return (com.google.type.Interval) startTimingConstraints_; + } + return com.google.type.Interval.getDefaultInstance(); + } + /** + * + * + *
+     * An absolute time interval within which resources may be created.
+     * 
+ * + * .google.type.Interval valid_interval = 5; + */ + @java.lang.Override + public com.google.type.IntervalOrBuilder getValidIntervalOrBuilder() { + if (startTimingConstraintsCase_ == 5) { + return (com.google.type.Interval) startTimingConstraints_; + } + return com.google.type.Interval.getDefaultInstance(); + } + + 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 (startTimingConstraintsCase_ == 1) { + output.writeMessage(1, (com.google.protobuf.Duration) startTimingConstraints_); + } + if (startTimingConstraintsCase_ == 2) { + output.writeMessage(2, (com.google.protobuf.Timestamp) startTimingConstraints_); + } + if (startTimingConstraintsCase_ == 3) { + output.writeMessage(3, (com.google.protobuf.Duration) startTimingConstraints_); + } + if (startTimingConstraintsCase_ == 4) { + output.writeMessage(4, (com.google.protobuf.Timestamp) startTimingConstraints_); + } + if (startTimingConstraintsCase_ == 5) { + output.writeMessage(5, (com.google.type.Interval) startTimingConstraints_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (startTimingConstraintsCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.protobuf.Duration) startTimingConstraints_); + } + if (startTimingConstraintsCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.protobuf.Timestamp) startTimingConstraints_); + } + if (startTimingConstraintsCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.protobuf.Duration) startTimingConstraints_); + } + if (startTimingConstraintsCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.protobuf.Timestamp) startTimingConstraints_); + } + if (startTimingConstraintsCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.type.Interval) startTimingConstraints_); + } + size += getUnknownFields().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.QueuedResource.QueueingPolicy)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy other = + (com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy) obj; + + if (!getStartTimingConstraintsCase().equals(other.getStartTimingConstraintsCase())) + return false; + switch (startTimingConstraintsCase_) { + case 1: + if (!getValidUntilDuration().equals(other.getValidUntilDuration())) return false; + break; + case 2: + if (!getValidUntilTime().equals(other.getValidUntilTime())) return false; + break; + case 3: + if (!getValidAfterDuration().equals(other.getValidAfterDuration())) return false; + break; + case 4: + if (!getValidAfterTime().equals(other.getValidAfterTime())) return false; + break; + case 5: + if (!getValidInterval().equals(other.getValidInterval())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (startTimingConstraintsCase_) { + case 1: + hash = (37 * hash) + VALID_UNTIL_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getValidUntilDuration().hashCode(); + break; + case 2: + hash = (37 * hash) + VALID_UNTIL_TIME_FIELD_NUMBER; + hash = (53 * hash) + getValidUntilTime().hashCode(); + break; + case 3: + hash = (37 * hash) + VALID_AFTER_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getValidAfterDuration().hashCode(); + break; + case 4: + hash = (37 * hash) + VALID_AFTER_TIME_FIELD_NUMBER; + hash = (53 * hash) + getValidAfterTime().hashCode(); + break; + case 5: + hash = (37 * hash) + VALID_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getValidInterval().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy 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.QueuedResource.QueueingPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy 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.QueuedResource.QueueingPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy 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.QueuedResource.QueueingPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy 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.QueuedResource.QueueingPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy 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.QueuedResource.QueueingPolicy 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.QueuedResource.QueueingPolicy 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.QueuedResource.QueueingPolicy 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; + } + /** + * + * + *
+     * Defines the policy of the QueuedRequest.
+     * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy) + com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_QueueingPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_QueueingPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy.class, + com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (validUntilDurationBuilder_ != null) { + validUntilDurationBuilder_.clear(); + } + if (validUntilTimeBuilder_ != null) { + validUntilTimeBuilder_.clear(); + } + if (validAfterDurationBuilder_ != null) { + validAfterDurationBuilder_.clear(); + } + if (validAfterTimeBuilder_ != null) { + validAfterTimeBuilder_.clear(); + } + if (validIntervalBuilder_ != null) { + validIntervalBuilder_.clear(); + } + startTimingConstraintsCase_ = 0; + startTimingConstraints_ = 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_QueuedResource_QueueingPolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy + getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy build() { + com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy buildPartial() { + com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy result = + new com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy(this); + if (startTimingConstraintsCase_ == 1) { + if (validUntilDurationBuilder_ == null) { + result.startTimingConstraints_ = startTimingConstraints_; + } else { + result.startTimingConstraints_ = validUntilDurationBuilder_.build(); + } + } + if (startTimingConstraintsCase_ == 2) { + if (validUntilTimeBuilder_ == null) { + result.startTimingConstraints_ = startTimingConstraints_; + } else { + result.startTimingConstraints_ = validUntilTimeBuilder_.build(); + } + } + if (startTimingConstraintsCase_ == 3) { + if (validAfterDurationBuilder_ == null) { + result.startTimingConstraints_ = startTimingConstraints_; + } else { + result.startTimingConstraints_ = validAfterDurationBuilder_.build(); + } + } + if (startTimingConstraintsCase_ == 4) { + if (validAfterTimeBuilder_ == null) { + result.startTimingConstraints_ = startTimingConstraints_; + } else { + result.startTimingConstraints_ = validAfterTimeBuilder_.build(); + } + } + if (startTimingConstraintsCase_ == 5) { + if (validIntervalBuilder_ == null) { + result.startTimingConstraints_ = startTimingConstraints_; + } else { + result.startTimingConstraints_ = validIntervalBuilder_.build(); + } + } + result.startTimingConstraintsCase_ = startTimingConstraintsCase_; + 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.QueuedResource.QueueingPolicy) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy other) { + if (other + == com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy.getDefaultInstance()) + return this; + switch (other.getStartTimingConstraintsCase()) { + case VALID_UNTIL_DURATION: + { + mergeValidUntilDuration(other.getValidUntilDuration()); + break; + } + case VALID_UNTIL_TIME: + { + mergeValidUntilTime(other.getValidUntilTime()); + break; + } + case VALID_AFTER_DURATION: + { + mergeValidAfterDuration(other.getValidAfterDuration()); + break; + } + case VALID_AFTER_TIME: + { + mergeValidAfterTime(other.getValidAfterTime()); + break; + } + case VALID_INTERVAL: + { + mergeValidInterval(other.getValidInterval()); + break; + } + case STARTTIMINGCONSTRAINTS_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getValidUntilDurationFieldBuilder().getBuilder(), extensionRegistry); + startTimingConstraintsCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + getValidUntilTimeFieldBuilder().getBuilder(), extensionRegistry); + startTimingConstraintsCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage( + getValidAfterDurationFieldBuilder().getBuilder(), extensionRegistry); + startTimingConstraintsCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage( + getValidAfterTimeFieldBuilder().getBuilder(), extensionRegistry); + startTimingConstraintsCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage(getValidIntervalFieldBuilder().getBuilder(), extensionRegistry); + startTimingConstraintsCase_ = 5; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int startTimingConstraintsCase_ = 0; + private java.lang.Object startTimingConstraints_; + + public StartTimingConstraintsCase getStartTimingConstraintsCase() { + return StartTimingConstraintsCase.forNumber(startTimingConstraintsCase_); + } + + public Builder clearStartTimingConstraints() { + startTimingConstraintsCase_ = 0; + startTimingConstraints_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + validUntilDurationBuilder_; + /** + * + * + *
+       * A relative time after which resources should not be created.
+       * If the request cannot be fulfilled by this time the request will be
+       * failed.
+       * 
+ * + * .google.protobuf.Duration valid_until_duration = 1; + * + * @return Whether the validUntilDuration field is set. + */ + @java.lang.Override + public boolean hasValidUntilDuration() { + return startTimingConstraintsCase_ == 1; + } + /** + * + * + *
+       * A relative time after which resources should not be created.
+       * If the request cannot be fulfilled by this time the request will be
+       * failed.
+       * 
+ * + * .google.protobuf.Duration valid_until_duration = 1; + * + * @return The validUntilDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getValidUntilDuration() { + if (validUntilDurationBuilder_ == null) { + if (startTimingConstraintsCase_ == 1) { + return (com.google.protobuf.Duration) startTimingConstraints_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } else { + if (startTimingConstraintsCase_ == 1) { + return validUntilDurationBuilder_.getMessage(); + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + /** + * + * + *
+       * A relative time after which resources should not be created.
+       * If the request cannot be fulfilled by this time the request will be
+       * failed.
+       * 
+ * + * .google.protobuf.Duration valid_until_duration = 1; + */ + public Builder setValidUntilDuration(com.google.protobuf.Duration value) { + if (validUntilDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTimingConstraints_ = value; + onChanged(); + } else { + validUntilDurationBuilder_.setMessage(value); + } + startTimingConstraintsCase_ = 1; + return this; + } + /** + * + * + *
+       * A relative time after which resources should not be created.
+       * If the request cannot be fulfilled by this time the request will be
+       * failed.
+       * 
+ * + * .google.protobuf.Duration valid_until_duration = 1; + */ + public Builder setValidUntilDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (validUntilDurationBuilder_ == null) { + startTimingConstraints_ = builderForValue.build(); + onChanged(); + } else { + validUntilDurationBuilder_.setMessage(builderForValue.build()); + } + startTimingConstraintsCase_ = 1; + return this; + } + /** + * + * + *
+       * A relative time after which resources should not be created.
+       * If the request cannot be fulfilled by this time the request will be
+       * failed.
+       * 
+ * + * .google.protobuf.Duration valid_until_duration = 1; + */ + public Builder mergeValidUntilDuration(com.google.protobuf.Duration value) { + if (validUntilDurationBuilder_ == null) { + if (startTimingConstraintsCase_ == 1 + && startTimingConstraints_ != com.google.protobuf.Duration.getDefaultInstance()) { + startTimingConstraints_ = + com.google.protobuf.Duration.newBuilder( + (com.google.protobuf.Duration) startTimingConstraints_) + .mergeFrom(value) + .buildPartial(); + } else { + startTimingConstraints_ = value; + } + onChanged(); + } else { + if (startTimingConstraintsCase_ == 1) { + validUntilDurationBuilder_.mergeFrom(value); + } else { + validUntilDurationBuilder_.setMessage(value); + } + } + startTimingConstraintsCase_ = 1; + return this; + } + /** + * + * + *
+       * A relative time after which resources should not be created.
+       * If the request cannot be fulfilled by this time the request will be
+       * failed.
+       * 
+ * + * .google.protobuf.Duration valid_until_duration = 1; + */ + public Builder clearValidUntilDuration() { + if (validUntilDurationBuilder_ == null) { + if (startTimingConstraintsCase_ == 1) { + startTimingConstraintsCase_ = 0; + startTimingConstraints_ = null; + onChanged(); + } + } else { + if (startTimingConstraintsCase_ == 1) { + startTimingConstraintsCase_ = 0; + startTimingConstraints_ = null; + } + validUntilDurationBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * A relative time after which resources should not be created.
+       * If the request cannot be fulfilled by this time the request will be
+       * failed.
+       * 
+ * + * .google.protobuf.Duration valid_until_duration = 1; + */ + public com.google.protobuf.Duration.Builder getValidUntilDurationBuilder() { + return getValidUntilDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * A relative time after which resources should not be created.
+       * If the request cannot be fulfilled by this time the request will be
+       * failed.
+       * 
+ * + * .google.protobuf.Duration valid_until_duration = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getValidUntilDurationOrBuilder() { + if ((startTimingConstraintsCase_ == 1) && (validUntilDurationBuilder_ != null)) { + return validUntilDurationBuilder_.getMessageOrBuilder(); + } else { + if (startTimingConstraintsCase_ == 1) { + return (com.google.protobuf.Duration) startTimingConstraints_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + /** + * + * + *
+       * A relative time after which resources should not be created.
+       * If the request cannot be fulfilled by this time the request will be
+       * failed.
+       * 
+ * + * .google.protobuf.Duration valid_until_duration = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getValidUntilDurationFieldBuilder() { + if (validUntilDurationBuilder_ == null) { + if (!(startTimingConstraintsCase_ == 1)) { + startTimingConstraints_ = com.google.protobuf.Duration.getDefaultInstance(); + } + validUntilDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + (com.google.protobuf.Duration) startTimingConstraints_, + getParentForChildren(), + isClean()); + startTimingConstraints_ = null; + } + startTimingConstraintsCase_ = 1; + onChanged(); + ; + return validUntilDurationBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + validUntilTimeBuilder_; + /** + * + * + *
+       * An absolute time after which resources should not be created.
+       * If the request cannot be fulfilled by this time the request will be
+       * failed.
+       * 
+ * + * .google.protobuf.Timestamp valid_until_time = 2; + * + * @return Whether the validUntilTime field is set. + */ + @java.lang.Override + public boolean hasValidUntilTime() { + return startTimingConstraintsCase_ == 2; + } + /** + * + * + *
+       * An absolute time after which resources should not be created.
+       * If the request cannot be fulfilled by this time the request will be
+       * failed.
+       * 
+ * + * .google.protobuf.Timestamp valid_until_time = 2; + * + * @return The validUntilTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getValidUntilTime() { + if (validUntilTimeBuilder_ == null) { + if (startTimingConstraintsCase_ == 2) { + return (com.google.protobuf.Timestamp) startTimingConstraints_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (startTimingConstraintsCase_ == 2) { + return validUntilTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+       * An absolute time after which resources should not be created.
+       * If the request cannot be fulfilled by this time the request will be
+       * failed.
+       * 
+ * + * .google.protobuf.Timestamp valid_until_time = 2; + */ + public Builder setValidUntilTime(com.google.protobuf.Timestamp value) { + if (validUntilTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTimingConstraints_ = value; + onChanged(); + } else { + validUntilTimeBuilder_.setMessage(value); + } + startTimingConstraintsCase_ = 2; + return this; + } + /** + * + * + *
+       * An absolute time after which resources should not be created.
+       * If the request cannot be fulfilled by this time the request will be
+       * failed.
+       * 
+ * + * .google.protobuf.Timestamp valid_until_time = 2; + */ + public Builder setValidUntilTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (validUntilTimeBuilder_ == null) { + startTimingConstraints_ = builderForValue.build(); + onChanged(); + } else { + validUntilTimeBuilder_.setMessage(builderForValue.build()); + } + startTimingConstraintsCase_ = 2; + return this; + } + /** + * + * + *
+       * An absolute time after which resources should not be created.
+       * If the request cannot be fulfilled by this time the request will be
+       * failed.
+       * 
+ * + * .google.protobuf.Timestamp valid_until_time = 2; + */ + public Builder mergeValidUntilTime(com.google.protobuf.Timestamp value) { + if (validUntilTimeBuilder_ == null) { + if (startTimingConstraintsCase_ == 2 + && startTimingConstraints_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + startTimingConstraints_ = + com.google.protobuf.Timestamp.newBuilder( + (com.google.protobuf.Timestamp) startTimingConstraints_) + .mergeFrom(value) + .buildPartial(); + } else { + startTimingConstraints_ = value; + } + onChanged(); + } else { + if (startTimingConstraintsCase_ == 2) { + validUntilTimeBuilder_.mergeFrom(value); + } else { + validUntilTimeBuilder_.setMessage(value); + } + } + startTimingConstraintsCase_ = 2; + return this; + } + /** + * + * + *
+       * An absolute time after which resources should not be created.
+       * If the request cannot be fulfilled by this time the request will be
+       * failed.
+       * 
+ * + * .google.protobuf.Timestamp valid_until_time = 2; + */ + public Builder clearValidUntilTime() { + if (validUntilTimeBuilder_ == null) { + if (startTimingConstraintsCase_ == 2) { + startTimingConstraintsCase_ = 0; + startTimingConstraints_ = null; + onChanged(); + } + } else { + if (startTimingConstraintsCase_ == 2) { + startTimingConstraintsCase_ = 0; + startTimingConstraints_ = null; + } + validUntilTimeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * An absolute time after which resources should not be created.
+       * If the request cannot be fulfilled by this time the request will be
+       * failed.
+       * 
+ * + * .google.protobuf.Timestamp valid_until_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getValidUntilTimeBuilder() { + return getValidUntilTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * An absolute time after which resources should not be created.
+       * If the request cannot be fulfilled by this time the request will be
+       * failed.
+       * 
+ * + * .google.protobuf.Timestamp valid_until_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getValidUntilTimeOrBuilder() { + if ((startTimingConstraintsCase_ == 2) && (validUntilTimeBuilder_ != null)) { + return validUntilTimeBuilder_.getMessageOrBuilder(); + } else { + if (startTimingConstraintsCase_ == 2) { + return (com.google.protobuf.Timestamp) startTimingConstraints_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+       * An absolute time after which resources should not be created.
+       * If the request cannot be fulfilled by this time the request will be
+       * failed.
+       * 
+ * + * .google.protobuf.Timestamp valid_until_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getValidUntilTimeFieldBuilder() { + if (validUntilTimeBuilder_ == null) { + if (!(startTimingConstraintsCase_ == 2)) { + startTimingConstraints_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + validUntilTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) startTimingConstraints_, + getParentForChildren(), + isClean()); + startTimingConstraints_ = null; + } + startTimingConstraintsCase_ = 2; + onChanged(); + ; + return validUntilTimeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + validAfterDurationBuilder_; + /** + * + * + *
+       * A relative time after which resources may be created.
+       * 
+ * + * .google.protobuf.Duration valid_after_duration = 3; + * + * @return Whether the validAfterDuration field is set. + */ + @java.lang.Override + public boolean hasValidAfterDuration() { + return startTimingConstraintsCase_ == 3; + } + /** + * + * + *
+       * A relative time after which resources may be created.
+       * 
+ * + * .google.protobuf.Duration valid_after_duration = 3; + * + * @return The validAfterDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getValidAfterDuration() { + if (validAfterDurationBuilder_ == null) { + if (startTimingConstraintsCase_ == 3) { + return (com.google.protobuf.Duration) startTimingConstraints_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } else { + if (startTimingConstraintsCase_ == 3) { + return validAfterDurationBuilder_.getMessage(); + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + /** + * + * + *
+       * A relative time after which resources may be created.
+       * 
+ * + * .google.protobuf.Duration valid_after_duration = 3; + */ + public Builder setValidAfterDuration(com.google.protobuf.Duration value) { + if (validAfterDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTimingConstraints_ = value; + onChanged(); + } else { + validAfterDurationBuilder_.setMessage(value); + } + startTimingConstraintsCase_ = 3; + return this; + } + /** + * + * + *
+       * A relative time after which resources may be created.
+       * 
+ * + * .google.protobuf.Duration valid_after_duration = 3; + */ + public Builder setValidAfterDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (validAfterDurationBuilder_ == null) { + startTimingConstraints_ = builderForValue.build(); + onChanged(); + } else { + validAfterDurationBuilder_.setMessage(builderForValue.build()); + } + startTimingConstraintsCase_ = 3; + return this; + } + /** + * + * + *
+       * A relative time after which resources may be created.
+       * 
+ * + * .google.protobuf.Duration valid_after_duration = 3; + */ + public Builder mergeValidAfterDuration(com.google.protobuf.Duration value) { + if (validAfterDurationBuilder_ == null) { + if (startTimingConstraintsCase_ == 3 + && startTimingConstraints_ != com.google.protobuf.Duration.getDefaultInstance()) { + startTimingConstraints_ = + com.google.protobuf.Duration.newBuilder( + (com.google.protobuf.Duration) startTimingConstraints_) + .mergeFrom(value) + .buildPartial(); + } else { + startTimingConstraints_ = value; + } + onChanged(); + } else { + if (startTimingConstraintsCase_ == 3) { + validAfterDurationBuilder_.mergeFrom(value); + } else { + validAfterDurationBuilder_.setMessage(value); + } + } + startTimingConstraintsCase_ = 3; + return this; + } + /** + * + * + *
+       * A relative time after which resources may be created.
+       * 
+ * + * .google.protobuf.Duration valid_after_duration = 3; + */ + public Builder clearValidAfterDuration() { + if (validAfterDurationBuilder_ == null) { + if (startTimingConstraintsCase_ == 3) { + startTimingConstraintsCase_ = 0; + startTimingConstraints_ = null; + onChanged(); + } + } else { + if (startTimingConstraintsCase_ == 3) { + startTimingConstraintsCase_ = 0; + startTimingConstraints_ = null; + } + validAfterDurationBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * A relative time after which resources may be created.
+       * 
+ * + * .google.protobuf.Duration valid_after_duration = 3; + */ + public com.google.protobuf.Duration.Builder getValidAfterDurationBuilder() { + return getValidAfterDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * A relative time after which resources may be created.
+       * 
+ * + * .google.protobuf.Duration valid_after_duration = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getValidAfterDurationOrBuilder() { + if ((startTimingConstraintsCase_ == 3) && (validAfterDurationBuilder_ != null)) { + return validAfterDurationBuilder_.getMessageOrBuilder(); + } else { + if (startTimingConstraintsCase_ == 3) { + return (com.google.protobuf.Duration) startTimingConstraints_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + /** + * + * + *
+       * A relative time after which resources may be created.
+       * 
+ * + * .google.protobuf.Duration valid_after_duration = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getValidAfterDurationFieldBuilder() { + if (validAfterDurationBuilder_ == null) { + if (!(startTimingConstraintsCase_ == 3)) { + startTimingConstraints_ = com.google.protobuf.Duration.getDefaultInstance(); + } + validAfterDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + (com.google.protobuf.Duration) startTimingConstraints_, + getParentForChildren(), + isClean()); + startTimingConstraints_ = null; + } + startTimingConstraintsCase_ = 3; + onChanged(); + ; + return validAfterDurationBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + validAfterTimeBuilder_; + /** + * + * + *
+       * An absolute time at which resources may be created.
+       * 
+ * + * .google.protobuf.Timestamp valid_after_time = 4; + * + * @return Whether the validAfterTime field is set. + */ + @java.lang.Override + public boolean hasValidAfterTime() { + return startTimingConstraintsCase_ == 4; + } + /** + * + * + *
+       * An absolute time at which resources may be created.
+       * 
+ * + * .google.protobuf.Timestamp valid_after_time = 4; + * + * @return The validAfterTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getValidAfterTime() { + if (validAfterTimeBuilder_ == null) { + if (startTimingConstraintsCase_ == 4) { + return (com.google.protobuf.Timestamp) startTimingConstraints_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (startTimingConstraintsCase_ == 4) { + return validAfterTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+       * An absolute time at which resources may be created.
+       * 
+ * + * .google.protobuf.Timestamp valid_after_time = 4; + */ + public Builder setValidAfterTime(com.google.protobuf.Timestamp value) { + if (validAfterTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTimingConstraints_ = value; + onChanged(); + } else { + validAfterTimeBuilder_.setMessage(value); + } + startTimingConstraintsCase_ = 4; + return this; + } + /** + * + * + *
+       * An absolute time at which resources may be created.
+       * 
+ * + * .google.protobuf.Timestamp valid_after_time = 4; + */ + public Builder setValidAfterTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (validAfterTimeBuilder_ == null) { + startTimingConstraints_ = builderForValue.build(); + onChanged(); + } else { + validAfterTimeBuilder_.setMessage(builderForValue.build()); + } + startTimingConstraintsCase_ = 4; + return this; + } + /** + * + * + *
+       * An absolute time at which resources may be created.
+       * 
+ * + * .google.protobuf.Timestamp valid_after_time = 4; + */ + public Builder mergeValidAfterTime(com.google.protobuf.Timestamp value) { + if (validAfterTimeBuilder_ == null) { + if (startTimingConstraintsCase_ == 4 + && startTimingConstraints_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + startTimingConstraints_ = + com.google.protobuf.Timestamp.newBuilder( + (com.google.protobuf.Timestamp) startTimingConstraints_) + .mergeFrom(value) + .buildPartial(); + } else { + startTimingConstraints_ = value; + } + onChanged(); + } else { + if (startTimingConstraintsCase_ == 4) { + validAfterTimeBuilder_.mergeFrom(value); + } else { + validAfterTimeBuilder_.setMessage(value); + } + } + startTimingConstraintsCase_ = 4; + return this; + } + /** + * + * + *
+       * An absolute time at which resources may be created.
+       * 
+ * + * .google.protobuf.Timestamp valid_after_time = 4; + */ + public Builder clearValidAfterTime() { + if (validAfterTimeBuilder_ == null) { + if (startTimingConstraintsCase_ == 4) { + startTimingConstraintsCase_ = 0; + startTimingConstraints_ = null; + onChanged(); + } + } else { + if (startTimingConstraintsCase_ == 4) { + startTimingConstraintsCase_ = 0; + startTimingConstraints_ = null; + } + validAfterTimeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * An absolute time at which resources may be created.
+       * 
+ * + * .google.protobuf.Timestamp valid_after_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getValidAfterTimeBuilder() { + return getValidAfterTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * An absolute time at which resources may be created.
+       * 
+ * + * .google.protobuf.Timestamp valid_after_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getValidAfterTimeOrBuilder() { + if ((startTimingConstraintsCase_ == 4) && (validAfterTimeBuilder_ != null)) { + return validAfterTimeBuilder_.getMessageOrBuilder(); + } else { + if (startTimingConstraintsCase_ == 4) { + return (com.google.protobuf.Timestamp) startTimingConstraints_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+       * An absolute time at which resources may be created.
+       * 
+ * + * .google.protobuf.Timestamp valid_after_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getValidAfterTimeFieldBuilder() { + if (validAfterTimeBuilder_ == null) { + if (!(startTimingConstraintsCase_ == 4)) { + startTimingConstraints_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + validAfterTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) startTimingConstraints_, + getParentForChildren(), + isClean()); + startTimingConstraints_ = null; + } + startTimingConstraintsCase_ = 4; + onChanged(); + ; + return validAfterTimeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder> + validIntervalBuilder_; + /** + * + * + *
+       * An absolute time interval within which resources may be created.
+       * 
+ * + * .google.type.Interval valid_interval = 5; + * + * @return Whether the validInterval field is set. + */ + @java.lang.Override + public boolean hasValidInterval() { + return startTimingConstraintsCase_ == 5; + } + /** + * + * + *
+       * An absolute time interval within which resources may be created.
+       * 
+ * + * .google.type.Interval valid_interval = 5; + * + * @return The validInterval. + */ + @java.lang.Override + public com.google.type.Interval getValidInterval() { + if (validIntervalBuilder_ == null) { + if (startTimingConstraintsCase_ == 5) { + return (com.google.type.Interval) startTimingConstraints_; + } + return com.google.type.Interval.getDefaultInstance(); + } else { + if (startTimingConstraintsCase_ == 5) { + return validIntervalBuilder_.getMessage(); + } + return com.google.type.Interval.getDefaultInstance(); + } + } + /** + * + * + *
+       * An absolute time interval within which resources may be created.
+       * 
+ * + * .google.type.Interval valid_interval = 5; + */ + public Builder setValidInterval(com.google.type.Interval value) { + if (validIntervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTimingConstraints_ = value; + onChanged(); + } else { + validIntervalBuilder_.setMessage(value); + } + startTimingConstraintsCase_ = 5; + return this; + } + /** + * + * + *
+       * An absolute time interval within which resources may be created.
+       * 
+ * + * .google.type.Interval valid_interval = 5; + */ + public Builder setValidInterval(com.google.type.Interval.Builder builderForValue) { + if (validIntervalBuilder_ == null) { + startTimingConstraints_ = builderForValue.build(); + onChanged(); + } else { + validIntervalBuilder_.setMessage(builderForValue.build()); + } + startTimingConstraintsCase_ = 5; + return this; + } + /** + * + * + *
+       * An absolute time interval within which resources may be created.
+       * 
+ * + * .google.type.Interval valid_interval = 5; + */ + public Builder mergeValidInterval(com.google.type.Interval value) { + if (validIntervalBuilder_ == null) { + if (startTimingConstraintsCase_ == 5 + && startTimingConstraints_ != com.google.type.Interval.getDefaultInstance()) { + startTimingConstraints_ = + com.google.type.Interval.newBuilder( + (com.google.type.Interval) startTimingConstraints_) + .mergeFrom(value) + .buildPartial(); + } else { + startTimingConstraints_ = value; + } + onChanged(); + } else { + if (startTimingConstraintsCase_ == 5) { + validIntervalBuilder_.mergeFrom(value); + } else { + validIntervalBuilder_.setMessage(value); + } + } + startTimingConstraintsCase_ = 5; + return this; + } + /** + * + * + *
+       * An absolute time interval within which resources may be created.
+       * 
+ * + * .google.type.Interval valid_interval = 5; + */ + public Builder clearValidInterval() { + if (validIntervalBuilder_ == null) { + if (startTimingConstraintsCase_ == 5) { + startTimingConstraintsCase_ = 0; + startTimingConstraints_ = null; + onChanged(); + } + } else { + if (startTimingConstraintsCase_ == 5) { + startTimingConstraintsCase_ = 0; + startTimingConstraints_ = null; + } + validIntervalBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * An absolute time interval within which resources may be created.
+       * 
+ * + * .google.type.Interval valid_interval = 5; + */ + public com.google.type.Interval.Builder getValidIntervalBuilder() { + return getValidIntervalFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * An absolute time interval within which resources may be created.
+       * 
+ * + * .google.type.Interval valid_interval = 5; + */ + @java.lang.Override + public com.google.type.IntervalOrBuilder getValidIntervalOrBuilder() { + if ((startTimingConstraintsCase_ == 5) && (validIntervalBuilder_ != null)) { + return validIntervalBuilder_.getMessageOrBuilder(); + } else { + if (startTimingConstraintsCase_ == 5) { + return (com.google.type.Interval) startTimingConstraints_; + } + return com.google.type.Interval.getDefaultInstance(); + } + } + /** + * + * + *
+       * An absolute time interval within which resources may be created.
+       * 
+ * + * .google.type.Interval valid_interval = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder> + getValidIntervalFieldBuilder() { + if (validIntervalBuilder_ == null) { + if (!(startTimingConstraintsCase_ == 5)) { + startTimingConstraints_ = com.google.type.Interval.getDefaultInstance(); + } + validIntervalBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder>( + (com.google.type.Interval) startTimingConstraints_, + getParentForChildren(), + isClean()); + startTimingConstraints_ = null; + } + startTimingConstraintsCase_ = 5; + onChanged(); + ; + return validIntervalBuilder_; + } + + @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.QueuedResource.QueueingPolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy) + private static final com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy(); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueueingPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.QueuedResource.QueueingPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int resourceCase_ = 0; + private java.lang.Object resource_; + + public enum ResourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TPU(2), + RESOURCE_NOT_SET(0); + private final int value; + + private ResourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ResourceCase valueOf(int value) { + return forNumber(value); + } + + public static ResourceCase forNumber(int value) { + switch (value) { + case 2: + return TPU; + case 0: + return RESOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ResourceCase getResourceCase() { + return ResourceCase.forNumber(resourceCase_); + } + + private int tierCase_ = 0; + private java.lang.Object tier_; + + public enum TierCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BEST_EFFORT(3), + GUARANTEED(4), + TIER_NOT_SET(0); + private final int value; + + private TierCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static TierCase valueOf(int value) { + return forNumber(value); + } + + public static TierCase forNumber(int value) { + switch (value) { + case 3: + return BEST_EFFORT; + case 4: + return GUARANTEED; + case 0: + return TIER_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public TierCase getTierCase() { + return TierCase.forNumber(tierCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. Immutable. The name of the QueuedResource.
+   * 
+ * + * + * 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 QueuedResource.
+   * 
+ * + * + * 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 TPU_FIELD_NUMBER = 2; + /** + * + * + *
+   * Defines a TPU resource.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Tpu tpu = 2; + * + * @return Whether the tpu field is set. + */ + @java.lang.Override + public boolean hasTpu() { + return resourceCase_ == 2; + } + /** + * + * + *
+   * Defines a TPU resource.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Tpu tpu = 2; + * + * @return The tpu. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu getTpu() { + if (resourceCase_ == 2) { + return (com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu) resource_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.getDefaultInstance(); + } + /** + * + * + *
+   * Defines a TPU resource.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Tpu tpu = 2; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.TpuOrBuilder getTpuOrBuilder() { + if (resourceCase_ == 2) { + return (com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu) resource_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.getDefaultInstance(); + } + + public static final int BEST_EFFORT_FIELD_NUMBER = 3; + /** + * + * + *
+   * The BestEffort tier.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.BestEffort best_effort = 3; + * + * @return Whether the bestEffort field is set. + */ + @java.lang.Override + public boolean hasBestEffort() { + return tierCase_ == 3; + } + /** + * + * + *
+   * The BestEffort tier.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.BestEffort best_effort = 3; + * + * @return The bestEffort. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort getBestEffort() { + if (tierCase_ == 3) { + return (com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort) tier_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort.getDefaultInstance(); + } + /** + * + * + *
+   * The BestEffort tier.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.BestEffort best_effort = 3; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffortOrBuilder getBestEffortOrBuilder() { + if (tierCase_ == 3) { + return (com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort) tier_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort.getDefaultInstance(); + } + + public static final int GUARANTEED_FIELD_NUMBER = 4; + /** + * + * + *
+   * The Guaranteed tier
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed guaranteed = 4; + * + * @return Whether the guaranteed field is set. + */ + @java.lang.Override + public boolean hasGuaranteed() { + return tierCase_ == 4; + } + /** + * + * + *
+   * The Guaranteed tier
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed guaranteed = 4; + * + * @return The guaranteed. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed getGuaranteed() { + if (tierCase_ == 4) { + return (com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed) tier_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed.getDefaultInstance(); + } + /** + * + * + *
+   * The Guaranteed tier
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed guaranteed = 4; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.GuaranteedOrBuilder getGuaranteedOrBuilder() { + if (tierCase_ == 4) { + return (com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed) tier_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed.getDefaultInstance(); + } + + public static final int QUEUEING_POLICY_FIELD_NUMBER = 5; + private com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy queueingPolicy_; + /** + * + * + *
+   * The queueing policy of the QueuedRequest.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy queueing_policy = 5; + * + * @return Whether the queueingPolicy field is set. + */ + @java.lang.Override + public boolean hasQueueingPolicy() { + return queueingPolicy_ != null; + } + /** + * + * + *
+   * The queueing policy of the QueuedRequest.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy queueing_policy = 5; + * + * @return The queueingPolicy. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy getQueueingPolicy() { + return queueingPolicy_ == null + ? com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy.getDefaultInstance() + : queueingPolicy_; + } + /** + * + * + *
+   * The queueing policy of the QueuedRequest.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy queueing_policy = 5; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicyOrBuilder + getQueueingPolicyOrBuilder() { + return getQueueingPolicy(); + } + + public static final int STATE_FIELD_NUMBER = 6; + private com.google.cloud.tpu.v2alpha1.QueuedResourceState state_; + /** + * + * + *
+   * Output only. State of the QueuedResource request
+   * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResourceState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the state field is set. + */ + @java.lang.Override + public boolean hasState() { + return state_ != null; + } + /** + * + * + *
+   * Output only. State of the QueuedResource request
+   * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResourceState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState getState() { + return state_ == null + ? com.google.cloud.tpu.v2alpha1.QueuedResourceState.getDefaultInstance() + : state_; + } + /** + * + * + *
+   * Output only. State of the QueuedResource request
+   * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResourceState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceStateOrBuilder getStateOrBuilder() { + return getState(); + } + + 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 (resourceCase_ == 2) { + output.writeMessage(2, (com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu) resource_); + } + if (tierCase_ == 3) { + output.writeMessage(3, (com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort) tier_); + } + if (tierCase_ == 4) { + output.writeMessage(4, (com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed) tier_); + } + if (queueingPolicy_ != null) { + output.writeMessage(5, getQueueingPolicy()); + } + if (state_ != null) { + output.writeMessage(6, getState()); + } + getUnknownFields().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 (resourceCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu) resource_); + } + if (tierCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort) tier_); + } + if (tierCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed) tier_); + } + if (queueingPolicy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getQueueingPolicy()); + } + if (state_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getState()); + } + size += getUnknownFields().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.QueuedResource)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.QueuedResource other = + (com.google.cloud.tpu.v2alpha1.QueuedResource) obj; + + if (!getName().equals(other.getName())) return false; + if (hasQueueingPolicy() != other.hasQueueingPolicy()) return false; + if (hasQueueingPolicy()) { + if (!getQueueingPolicy().equals(other.getQueueingPolicy())) return false; + } + if (hasState() != other.hasState()) return false; + if (hasState()) { + if (!getState().equals(other.getState())) return false; + } + if (!getResourceCase().equals(other.getResourceCase())) return false; + switch (resourceCase_) { + case 2: + if (!getTpu().equals(other.getTpu())) return false; + break; + case 0: + default: + } + if (!getTierCase().equals(other.getTierCase())) return false; + switch (tierCase_) { + case 3: + if (!getBestEffort().equals(other.getBestEffort())) return false; + break; + case 4: + if (!getGuaranteed().equals(other.getGuaranteed())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasQueueingPolicy()) { + hash = (37 * hash) + QUEUEING_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getQueueingPolicy().hashCode(); + } + if (hasState()) { + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + getState().hashCode(); + } + switch (resourceCase_) { + case 2: + hash = (37 * hash) + TPU_FIELD_NUMBER; + hash = (53 * hash) + getTpu().hashCode(); + break; + case 0: + default: + } + switch (tierCase_) { + case 3: + hash = (37 * hash) + BEST_EFFORT_FIELD_NUMBER; + hash = (53 * hash) + getBestEffort().hashCode(); + break; + case 4: + hash = (37 * hash) + GUARANTEED_FIELD_NUMBER; + hash = (53 * hash) + getGuaranteed().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource 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.QueuedResource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource 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.QueuedResource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource 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.QueuedResource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource 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.QueuedResource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource 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.QueuedResource 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.QueuedResource 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.QueuedResource 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 QueuedResource represents a request for resources that will be placed
+   * in a queue and fulfilled when the necessary resources are available.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.QueuedResource) + com.google.cloud.tpu.v2alpha1.QueuedResourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResource.class, + com.google.cloud.tpu.v2alpha1.QueuedResource.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.QueuedResource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (tpuBuilder_ != null) { + tpuBuilder_.clear(); + } + if (bestEffortBuilder_ != null) { + bestEffortBuilder_.clear(); + } + if (guaranteedBuilder_ != null) { + guaranteedBuilder_.clear(); + } + if (queueingPolicyBuilder_ == null) { + queueingPolicy_ = null; + } else { + queueingPolicy_ = null; + queueingPolicyBuilder_ = null; + } + if (stateBuilder_ == null) { + state_ = null; + } else { + state_ = null; + stateBuilder_ = null; + } + resourceCase_ = 0; + resource_ = null; + tierCase_ = 0; + tier_ = 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_QueuedResource_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.QueuedResource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource build() { + com.google.cloud.tpu.v2alpha1.QueuedResource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource buildPartial() { + com.google.cloud.tpu.v2alpha1.QueuedResource result = + new com.google.cloud.tpu.v2alpha1.QueuedResource(this); + result.name_ = name_; + if (resourceCase_ == 2) { + if (tpuBuilder_ == null) { + result.resource_ = resource_; + } else { + result.resource_ = tpuBuilder_.build(); + } + } + if (tierCase_ == 3) { + if (bestEffortBuilder_ == null) { + result.tier_ = tier_; + } else { + result.tier_ = bestEffortBuilder_.build(); + } + } + if (tierCase_ == 4) { + if (guaranteedBuilder_ == null) { + result.tier_ = tier_; + } else { + result.tier_ = guaranteedBuilder_.build(); + } + } + if (queueingPolicyBuilder_ == null) { + result.queueingPolicy_ = queueingPolicy_; + } else { + result.queueingPolicy_ = queueingPolicyBuilder_.build(); + } + if (stateBuilder_ == null) { + result.state_ = state_; + } else { + result.state_ = stateBuilder_.build(); + } + result.resourceCase_ = resourceCase_; + result.tierCase_ = tierCase_; + 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.QueuedResource) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.QueuedResource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.QueuedResource other) { + if (other == com.google.cloud.tpu.v2alpha1.QueuedResource.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasQueueingPolicy()) { + mergeQueueingPolicy(other.getQueueingPolicy()); + } + if (other.hasState()) { + mergeState(other.getState()); + } + switch (other.getResourceCase()) { + case TPU: + { + mergeTpu(other.getTpu()); + break; + } + case RESOURCE_NOT_SET: + { + break; + } + } + switch (other.getTierCase()) { + case BEST_EFFORT: + { + mergeBestEffort(other.getBestEffort()); + break; + } + case GUARANTEED: + { + mergeGuaranteed(other.getGuaranteed()); + break; + } + case TIER_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getTpuFieldBuilder().getBuilder(), extensionRegistry); + resourceCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getBestEffortFieldBuilder().getBuilder(), extensionRegistry); + tierCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage(getGuaranteedFieldBuilder().getBuilder(), extensionRegistry); + tierCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage(getQueueingPolicyFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 42 + case 50: + { + input.readMessage(getStateFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int resourceCase_ = 0; + private java.lang.Object resource_; + + public ResourceCase getResourceCase() { + return ResourceCase.forNumber(resourceCase_); + } + + public Builder clearResource() { + resourceCase_ = 0; + resource_ = null; + onChanged(); + return this; + } + + private int tierCase_ = 0; + private java.lang.Object tier_; + + public TierCase getTierCase() { + return TierCase.forNumber(tierCase_); + } + + public Builder clearTier() { + tierCase_ = 0; + tier_ = null; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. Immutable. The name of the QueuedResource.
+     * 
+ * + * + * 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 QueuedResource.
+     * 
+ * + * + * 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 QueuedResource.
+     * 
+ * + * + * 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 QueuedResource.
+     * 
+ * + * + * 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 QueuedResource.
+     * 
+ * + * + * 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 com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu, + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResource.TpuOrBuilder> + tpuBuilder_; + /** + * + * + *
+     * Defines a TPU resource.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Tpu tpu = 2; + * + * @return Whether the tpu field is set. + */ + @java.lang.Override + public boolean hasTpu() { + return resourceCase_ == 2; + } + /** + * + * + *
+     * Defines a TPU resource.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Tpu tpu = 2; + * + * @return The tpu. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu getTpu() { + if (tpuBuilder_ == null) { + if (resourceCase_ == 2) { + return (com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu) resource_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.getDefaultInstance(); + } else { + if (resourceCase_ == 2) { + return tpuBuilder_.getMessage(); + } + return com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.getDefaultInstance(); + } + } + /** + * + * + *
+     * Defines a TPU resource.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Tpu tpu = 2; + */ + public Builder setTpu(com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu value) { + if (tpuBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resource_ = value; + onChanged(); + } else { + tpuBuilder_.setMessage(value); + } + resourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Defines a TPU resource.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Tpu tpu = 2; + */ + public Builder setTpu( + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.Builder builderForValue) { + if (tpuBuilder_ == null) { + resource_ = builderForValue.build(); + onChanged(); + } else { + tpuBuilder_.setMessage(builderForValue.build()); + } + resourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Defines a TPU resource.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Tpu tpu = 2; + */ + public Builder mergeTpu(com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu value) { + if (tpuBuilder_ == null) { + if (resourceCase_ == 2 + && resource_ != com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.getDefaultInstance()) { + resource_ = + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.newBuilder( + (com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu) resource_) + .mergeFrom(value) + .buildPartial(); + } else { + resource_ = value; + } + onChanged(); + } else { + if (resourceCase_ == 2) { + tpuBuilder_.mergeFrom(value); + } else { + tpuBuilder_.setMessage(value); + } + } + resourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Defines a TPU resource.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Tpu tpu = 2; + */ + public Builder clearTpu() { + if (tpuBuilder_ == null) { + if (resourceCase_ == 2) { + resourceCase_ = 0; + resource_ = null; + onChanged(); + } + } else { + if (resourceCase_ == 2) { + resourceCase_ = 0; + resource_ = null; + } + tpuBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Defines a TPU resource.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Tpu tpu = 2; + */ + public com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.Builder getTpuBuilder() { + return getTpuFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Defines a TPU resource.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Tpu tpu = 2; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.TpuOrBuilder getTpuOrBuilder() { + if ((resourceCase_ == 2) && (tpuBuilder_ != null)) { + return tpuBuilder_.getMessageOrBuilder(); + } else { + if (resourceCase_ == 2) { + return (com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu) resource_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.getDefaultInstance(); + } + } + /** + * + * + *
+     * Defines a TPU resource.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Tpu tpu = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu, + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResource.TpuOrBuilder> + getTpuFieldBuilder() { + if (tpuBuilder_ == null) { + if (!(resourceCase_ == 2)) { + resource_ = com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.getDefaultInstance(); + } + tpuBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu, + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResource.TpuOrBuilder>( + (com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu) resource_, + getParentForChildren(), + isClean()); + resource_ = null; + } + resourceCase_ = 2; + onChanged(); + ; + return tpuBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort, + com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffortOrBuilder> + bestEffortBuilder_; + /** + * + * + *
+     * The BestEffort tier.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.BestEffort best_effort = 3; + * + * @return Whether the bestEffort field is set. + */ + @java.lang.Override + public boolean hasBestEffort() { + return tierCase_ == 3; + } + /** + * + * + *
+     * The BestEffort tier.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.BestEffort best_effort = 3; + * + * @return The bestEffort. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort getBestEffort() { + if (bestEffortBuilder_ == null) { + if (tierCase_ == 3) { + return (com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort) tier_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort.getDefaultInstance(); + } else { + if (tierCase_ == 3) { + return bestEffortBuilder_.getMessage(); + } + return com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort.getDefaultInstance(); + } + } + /** + * + * + *
+     * The BestEffort tier.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.BestEffort best_effort = 3; + */ + public Builder setBestEffort(com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort value) { + if (bestEffortBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tier_ = value; + onChanged(); + } else { + bestEffortBuilder_.setMessage(value); + } + tierCase_ = 3; + return this; + } + /** + * + * + *
+     * The BestEffort tier.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.BestEffort best_effort = 3; + */ + public Builder setBestEffort( + com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort.Builder builderForValue) { + if (bestEffortBuilder_ == null) { + tier_ = builderForValue.build(); + onChanged(); + } else { + bestEffortBuilder_.setMessage(builderForValue.build()); + } + tierCase_ = 3; + return this; + } + /** + * + * + *
+     * The BestEffort tier.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.BestEffort best_effort = 3; + */ + public Builder mergeBestEffort(com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort value) { + if (bestEffortBuilder_ == null) { + if (tierCase_ == 3 + && tier_ + != com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort.getDefaultInstance()) { + tier_ = + com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort.newBuilder( + (com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort) tier_) + .mergeFrom(value) + .buildPartial(); + } else { + tier_ = value; + } + onChanged(); + } else { + if (tierCase_ == 3) { + bestEffortBuilder_.mergeFrom(value); + } else { + bestEffortBuilder_.setMessage(value); + } + } + tierCase_ = 3; + return this; + } + /** + * + * + *
+     * The BestEffort tier.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.BestEffort best_effort = 3; + */ + public Builder clearBestEffort() { + if (bestEffortBuilder_ == null) { + if (tierCase_ == 3) { + tierCase_ = 0; + tier_ = null; + onChanged(); + } + } else { + if (tierCase_ == 3) { + tierCase_ = 0; + tier_ = null; + } + bestEffortBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The BestEffort tier.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.BestEffort best_effort = 3; + */ + public com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort.Builder getBestEffortBuilder() { + return getBestEffortFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The BestEffort tier.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.BestEffort best_effort = 3; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffortOrBuilder + getBestEffortOrBuilder() { + if ((tierCase_ == 3) && (bestEffortBuilder_ != null)) { + return bestEffortBuilder_.getMessageOrBuilder(); + } else { + if (tierCase_ == 3) { + return (com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort) tier_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort.getDefaultInstance(); + } + } + /** + * + * + *
+     * The BestEffort tier.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.BestEffort best_effort = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort, + com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffortOrBuilder> + getBestEffortFieldBuilder() { + if (bestEffortBuilder_ == null) { + if (!(tierCase_ == 3)) { + tier_ = com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort.getDefaultInstance(); + } + bestEffortBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort, + com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffortOrBuilder>( + (com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort) tier_, + getParentForChildren(), + isClean()); + tier_ = null; + } + tierCase_ = 3; + onChanged(); + ; + return bestEffortBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed, + com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResource.GuaranteedOrBuilder> + guaranteedBuilder_; + /** + * + * + *
+     * The Guaranteed tier
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed guaranteed = 4; + * + * @return Whether the guaranteed field is set. + */ + @java.lang.Override + public boolean hasGuaranteed() { + return tierCase_ == 4; + } + /** + * + * + *
+     * The Guaranteed tier
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed guaranteed = 4; + * + * @return The guaranteed. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed getGuaranteed() { + if (guaranteedBuilder_ == null) { + if (tierCase_ == 4) { + return (com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed) tier_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed.getDefaultInstance(); + } else { + if (tierCase_ == 4) { + return guaranteedBuilder_.getMessage(); + } + return com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed.getDefaultInstance(); + } + } + /** + * + * + *
+     * The Guaranteed tier
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed guaranteed = 4; + */ + public Builder setGuaranteed(com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed value) { + if (guaranteedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tier_ = value; + onChanged(); + } else { + guaranteedBuilder_.setMessage(value); + } + tierCase_ = 4; + return this; + } + /** + * + * + *
+     * The Guaranteed tier
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed guaranteed = 4; + */ + public Builder setGuaranteed( + com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed.Builder builderForValue) { + if (guaranteedBuilder_ == null) { + tier_ = builderForValue.build(); + onChanged(); + } else { + guaranteedBuilder_.setMessage(builderForValue.build()); + } + tierCase_ = 4; + return this; + } + /** + * + * + *
+     * The Guaranteed tier
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed guaranteed = 4; + */ + public Builder mergeGuaranteed(com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed value) { + if (guaranteedBuilder_ == null) { + if (tierCase_ == 4 + && tier_ + != com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed.getDefaultInstance()) { + tier_ = + com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed.newBuilder( + (com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed) tier_) + .mergeFrom(value) + .buildPartial(); + } else { + tier_ = value; + } + onChanged(); + } else { + if (tierCase_ == 4) { + guaranteedBuilder_.mergeFrom(value); + } else { + guaranteedBuilder_.setMessage(value); + } + } + tierCase_ = 4; + return this; + } + /** + * + * + *
+     * The Guaranteed tier
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed guaranteed = 4; + */ + public Builder clearGuaranteed() { + if (guaranteedBuilder_ == null) { + if (tierCase_ == 4) { + tierCase_ = 0; + tier_ = null; + onChanged(); + } + } else { + if (tierCase_ == 4) { + tierCase_ = 0; + tier_ = null; + } + guaranteedBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The Guaranteed tier
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed guaranteed = 4; + */ + public com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed.Builder getGuaranteedBuilder() { + return getGuaranteedFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Guaranteed tier
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed guaranteed = 4; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResource.GuaranteedOrBuilder + getGuaranteedOrBuilder() { + if ((tierCase_ == 4) && (guaranteedBuilder_ != null)) { + return guaranteedBuilder_.getMessageOrBuilder(); + } else { + if (tierCase_ == 4) { + return (com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed) tier_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed.getDefaultInstance(); + } + } + /** + * + * + *
+     * The Guaranteed tier
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed guaranteed = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed, + com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResource.GuaranteedOrBuilder> + getGuaranteedFieldBuilder() { + if (guaranteedBuilder_ == null) { + if (!(tierCase_ == 4)) { + tier_ = com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed.getDefaultInstance(); + } + guaranteedBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed, + com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResource.GuaranteedOrBuilder>( + (com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed) tier_, + getParentForChildren(), + isClean()); + tier_ = null; + } + tierCase_ = 4; + onChanged(); + ; + return guaranteedBuilder_; + } + + private com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy queueingPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy, + com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicyOrBuilder> + queueingPolicyBuilder_; + /** + * + * + *
+     * The queueing policy of the QueuedRequest.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy queueing_policy = 5; + * + * @return Whether the queueingPolicy field is set. + */ + public boolean hasQueueingPolicy() { + return queueingPolicyBuilder_ != null || queueingPolicy_ != null; + } + /** + * + * + *
+     * The queueing policy of the QueuedRequest.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy queueing_policy = 5; + * + * @return The queueingPolicy. + */ + public com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy getQueueingPolicy() { + if (queueingPolicyBuilder_ == null) { + return queueingPolicy_ == null + ? com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy.getDefaultInstance() + : queueingPolicy_; + } else { + return queueingPolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The queueing policy of the QueuedRequest.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy queueing_policy = 5; + */ + public Builder setQueueingPolicy( + com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy value) { + if (queueingPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queueingPolicy_ = value; + onChanged(); + } else { + queueingPolicyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The queueing policy of the QueuedRequest.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy queueing_policy = 5; + */ + public Builder setQueueingPolicy( + com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy.Builder builderForValue) { + if (queueingPolicyBuilder_ == null) { + queueingPolicy_ = builderForValue.build(); + onChanged(); + } else { + queueingPolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The queueing policy of the QueuedRequest.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy queueing_policy = 5; + */ + public Builder mergeQueueingPolicy( + com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy value) { + if (queueingPolicyBuilder_ == null) { + if (queueingPolicy_ != null) { + queueingPolicy_ = + com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy.newBuilder( + queueingPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + queueingPolicy_ = value; + } + onChanged(); + } else { + queueingPolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The queueing policy of the QueuedRequest.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy queueing_policy = 5; + */ + public Builder clearQueueingPolicy() { + if (queueingPolicyBuilder_ == null) { + queueingPolicy_ = null; + onChanged(); + } else { + queueingPolicy_ = null; + queueingPolicyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The queueing policy of the QueuedRequest.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy queueing_policy = 5; + */ + public com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy.Builder + getQueueingPolicyBuilder() { + + onChanged(); + return getQueueingPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The queueing policy of the QueuedRequest.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy queueing_policy = 5; + */ + public com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicyOrBuilder + getQueueingPolicyOrBuilder() { + if (queueingPolicyBuilder_ != null) { + return queueingPolicyBuilder_.getMessageOrBuilder(); + } else { + return queueingPolicy_ == null + ? com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy.getDefaultInstance() + : queueingPolicy_; + } + } + /** + * + * + *
+     * The queueing policy of the QueuedRequest.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy queueing_policy = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy, + com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicyOrBuilder> + getQueueingPolicyFieldBuilder() { + if (queueingPolicyBuilder_ == null) { + queueingPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy, + com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicyOrBuilder>( + getQueueingPolicy(), getParentForChildren(), isClean()); + queueingPolicy_ = null; + } + return queueingPolicyBuilder_; + } + + private com.google.cloud.tpu.v2alpha1.QueuedResourceState state_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceStateOrBuilder> + stateBuilder_; + /** + * + * + *
+     * Output only. State of the QueuedResource request
+     * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResourceState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the state field is set. + */ + public boolean hasState() { + return stateBuilder_ != null || state_ != null; + } + /** + * + * + *
+     * Output only. State of the QueuedResource request
+     * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResourceState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + public com.google.cloud.tpu.v2alpha1.QueuedResourceState getState() { + if (stateBuilder_ == null) { + return state_ == null + ? com.google.cloud.tpu.v2alpha1.QueuedResourceState.getDefaultInstance() + : state_; + } else { + return stateBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. State of the QueuedResource request
+     * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResourceState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setState(com.google.cloud.tpu.v2alpha1.QueuedResourceState value) { + if (stateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + state_ = value; + onChanged(); + } else { + stateBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. State of the QueuedResource request
+     * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResourceState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setState( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.Builder builderForValue) { + if (stateBuilder_ == null) { + state_ = builderForValue.build(); + onChanged(); + } else { + stateBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. State of the QueuedResource request
+     * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResourceState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeState(com.google.cloud.tpu.v2alpha1.QueuedResourceState value) { + if (stateBuilder_ == null) { + if (state_ != null) { + state_ = + com.google.cloud.tpu.v2alpha1.QueuedResourceState.newBuilder(state_) + .mergeFrom(value) + .buildPartial(); + } else { + state_ = value; + } + onChanged(); + } else { + stateBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. State of the QueuedResource request
+     * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResourceState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearState() { + if (stateBuilder_ == null) { + state_ = null; + onChanged(); + } else { + state_ = null; + stateBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. State of the QueuedResource request
+     * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResourceState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.Builder getStateBuilder() { + + onChanged(); + return getStateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. State of the QueuedResource request
+     * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResourceState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.tpu.v2alpha1.QueuedResourceStateOrBuilder getStateOrBuilder() { + if (stateBuilder_ != null) { + return stateBuilder_.getMessageOrBuilder(); + } else { + return state_ == null + ? com.google.cloud.tpu.v2alpha1.QueuedResourceState.getDefaultInstance() + : state_; + } + } + /** + * + * + *
+     * Output only. State of the QueuedResource request
+     * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResourceState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceStateOrBuilder> + getStateFieldBuilder() { + if (stateBuilder_ == null) { + stateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceStateOrBuilder>( + getState(), getParentForChildren(), isClean()); + state_ = null; + } + return stateBuilder_; + } + + @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.QueuedResource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.QueuedResource) + private static final com.google.cloud.tpu.v2alpha1.QueuedResource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.QueuedResource(); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueuedResource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.QueuedResource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/QueuedResourceName.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/QueuedResourceName.java new file mode 100644 index 000000000000..84248b824032 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/QueuedResourceName.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 QueuedResourceName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_QUEUED_RESOURCE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/queuedResources/{queued_resource}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String queuedResource; + + @Deprecated + protected QueuedResourceName() { + project = null; + location = null; + queuedResource = null; + } + + private QueuedResourceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + queuedResource = Preconditions.checkNotNull(builder.getQueuedResource()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getQueuedResource() { + return queuedResource; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static QueuedResourceName of(String project, String location, String queuedResource) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setQueuedResource(queuedResource) + .build(); + } + + public static String format(String project, String location, String queuedResource) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setQueuedResource(queuedResource) + .build() + .toString(); + } + + public static QueuedResourceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_QUEUED_RESOURCE.validatedMatch( + formattedString, "QueuedResourceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("queued_resource")); + } + + 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 (QueuedResourceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_QUEUED_RESOURCE.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 (queuedResource != null) { + fieldMapBuilder.put("queued_resource", queuedResource); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_QUEUED_RESOURCE.instantiate( + "project", project, "location", location, "queued_resource", queuedResource); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + QueuedResourceName that = ((QueuedResourceName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.queuedResource, that.queuedResource); + } + 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(queuedResource); + return h; + } + + /** Builder for projects/{project}/locations/{location}/queuedResources/{queued_resource}. */ + public static class Builder { + private String project; + private String location; + private String queuedResource; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getQueuedResource() { + return queuedResource; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setQueuedResource(String queuedResource) { + this.queuedResource = queuedResource; + return this; + } + + private Builder(QueuedResourceName queuedResourceName) { + this.project = queuedResourceName.project; + this.location = queuedResourceName.location; + this.queuedResource = queuedResourceName.queuedResource; + } + + public QueuedResourceName build() { + return new QueuedResourceName(this); + } + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/QueuedResourceOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/QueuedResourceOrBuilder.java new file mode 100644 index 000000000000..5aaf8a103580 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/QueuedResourceOrBuilder.java @@ -0,0 +1,239 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface QueuedResourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.QueuedResource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Immutable. The name of the QueuedResource.
+   * 
+ * + * + * 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 QueuedResource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Defines a TPU resource.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Tpu tpu = 2; + * + * @return Whether the tpu field is set. + */ + boolean hasTpu(); + /** + * + * + *
+   * Defines a TPU resource.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Tpu tpu = 2; + * + * @return The tpu. + */ + com.google.cloud.tpu.v2alpha1.QueuedResource.Tpu getTpu(); + /** + * + * + *
+   * Defines a TPU resource.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Tpu tpu = 2; + */ + com.google.cloud.tpu.v2alpha1.QueuedResource.TpuOrBuilder getTpuOrBuilder(); + + /** + * + * + *
+   * The BestEffort tier.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.BestEffort best_effort = 3; + * + * @return Whether the bestEffort field is set. + */ + boolean hasBestEffort(); + /** + * + * + *
+   * The BestEffort tier.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.BestEffort best_effort = 3; + * + * @return The bestEffort. + */ + com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffort getBestEffort(); + /** + * + * + *
+   * The BestEffort tier.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.BestEffort best_effort = 3; + */ + com.google.cloud.tpu.v2alpha1.QueuedResource.BestEffortOrBuilder getBestEffortOrBuilder(); + + /** + * + * + *
+   * The Guaranteed tier
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed guaranteed = 4; + * + * @return Whether the guaranteed field is set. + */ + boolean hasGuaranteed(); + /** + * + * + *
+   * The Guaranteed tier
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed guaranteed = 4; + * + * @return The guaranteed. + */ + com.google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed getGuaranteed(); + /** + * + * + *
+   * The Guaranteed tier
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.Guaranteed guaranteed = 4; + */ + com.google.cloud.tpu.v2alpha1.QueuedResource.GuaranteedOrBuilder getGuaranteedOrBuilder(); + + /** + * + * + *
+   * The queueing policy of the QueuedRequest.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy queueing_policy = 5; + * + * @return Whether the queueingPolicy field is set. + */ + boolean hasQueueingPolicy(); + /** + * + * + *
+   * The queueing policy of the QueuedRequest.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy queueing_policy = 5; + * + * @return The queueingPolicy. + */ + com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy getQueueingPolicy(); + /** + * + * + *
+   * The queueing policy of the QueuedRequest.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicy queueing_policy = 5; + */ + com.google.cloud.tpu.v2alpha1.QueuedResource.QueueingPolicyOrBuilder getQueueingPolicyOrBuilder(); + + /** + * + * + *
+   * Output only. State of the QueuedResource request
+   * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResourceState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the state field is set. + */ + boolean hasState(); + /** + * + * + *
+   * Output only. State of the QueuedResource request
+   * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResourceState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.tpu.v2alpha1.QueuedResourceState getState(); + /** + * + * + *
+   * Output only. State of the QueuedResource request
+   * 
+ * + * + * .google.cloud.tpu.v2alpha1.QueuedResourceState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.tpu.v2alpha1.QueuedResourceStateOrBuilder getStateOrBuilder(); + + public com.google.cloud.tpu.v2alpha1.QueuedResource.ResourceCase getResourceCase(); + + public com.google.cloud.tpu.v2alpha1.QueuedResource.TierCase getTierCase(); +} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/QueuedResourceState.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/QueuedResourceState.java new file mode 100644 index 000000000000..29e16adf9b35 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/QueuedResourceState.java @@ -0,0 +1,7251 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * QueuedResourceState defines the details of the QueuedResource request.
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResourceState} + */ +public final class QueuedResourceState extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.QueuedResourceState) + QueuedResourceStateOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueuedResourceState.newBuilder() to construct. + private QueuedResourceState(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueuedResourceState() { + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueuedResourceState(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.class, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.Builder.class); + } + + /** + * + * + *
+   * Output only state of the request
+   * 
+ * + * Protobuf enum {@code google.cloud.tpu.v2alpha1.QueuedResourceState.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * State of the QueuedResource request is not known/set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The QueuedResource request has been received. We're still working on
+     * determining if we will be able to honor this request.
+     * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + * + * + *
+     * The QueuedResource request has passed initial validation/admission
+     * control and has been persisted in the queue.
+     * 
+ * + * ACCEPTED = 2; + */ + ACCEPTED(2), + /** + * + * + *
+     * The QueuedResource request has been selected. The
+     * associated resources are currently being provisioned (or very soon
+     * will begin provisioning).
+     * 
+ * + * PROVISIONING = 3; + */ + PROVISIONING(3), + /** + * + * + *
+     * The request could not be completed. This may be due to some
+     * late-discovered problem with the request itself, or due to
+     * unavailability of resources within the constraints of the request
+     * (e.g., the 'valid until' start timing constraint expired).
+     * 
+ * + * FAILED = 4; + */ + FAILED(4), + /** + * + * + *
+     * The QueuedResource is being deleted.
+     * 
+ * + * DELETING = 5; + */ + DELETING(5), + /** + * + * + *
+     * The resources specified in the QueuedResource request have been
+     * provisioned and are ready for use by the end-user/consumer.
+     * 
+ * + * ACTIVE = 6; + */ + ACTIVE(6), + /** + * + * + *
+     * The resources specified in the QueuedResource request are being
+     * deleted. This may have been initiated by the user, or
+     * the Cloud TPU service. Inspect the state data for more details.
+     * 
+ * + * SUSPENDING = 7; + */ + SUSPENDING(7), + /** + * + * + *
+     * The resources specified in the QueuedResource request have been
+     * deleted.
+     * 
+ * + * SUSPENDED = 8; + */ + SUSPENDED(8), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * State of the QueuedResource request is not known/set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The QueuedResource request has been received. We're still working on
+     * determining if we will be able to honor this request.
+     * 
+ * + * CREATING = 1; + */ + public static final int CREATING_VALUE = 1; + /** + * + * + *
+     * The QueuedResource request has passed initial validation/admission
+     * control and has been persisted in the queue.
+     * 
+ * + * ACCEPTED = 2; + */ + public static final int ACCEPTED_VALUE = 2; + /** + * + * + *
+     * The QueuedResource request has been selected. The
+     * associated resources are currently being provisioned (or very soon
+     * will begin provisioning).
+     * 
+ * + * PROVISIONING = 3; + */ + public static final int PROVISIONING_VALUE = 3; + /** + * + * + *
+     * The request could not be completed. This may be due to some
+     * late-discovered problem with the request itself, or due to
+     * unavailability of resources within the constraints of the request
+     * (e.g., the 'valid until' start timing constraint expired).
+     * 
+ * + * FAILED = 4; + */ + public static final int FAILED_VALUE = 4; + /** + * + * + *
+     * The QueuedResource is being deleted.
+     * 
+ * + * DELETING = 5; + */ + public static final int DELETING_VALUE = 5; + /** + * + * + *
+     * The resources specified in the QueuedResource request have been
+     * provisioned and are ready for use by the end-user/consumer.
+     * 
+ * + * ACTIVE = 6; + */ + public static final int ACTIVE_VALUE = 6; + /** + * + * + *
+     * The resources specified in the QueuedResource request are being
+     * deleted. This may have been initiated by the user, or
+     * the Cloud TPU service. Inspect the state data for more details.
+     * 
+ * + * SUSPENDING = 7; + */ + public static final int SUSPENDING_VALUE = 7; + /** + * + * + *
+     * The resources specified in the QueuedResource request have been
+     * deleted.
+     * 
+ * + * SUSPENDED = 8; + */ + public static final int SUSPENDED_VALUE = 8; + + 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 ACCEPTED; + case 3: + return PROVISIONING; + case 4: + return FAILED; + case 5: + return DELETING; + case 6: + return ACTIVE; + case 7: + return SUSPENDING; + case 8: + return SUSPENDED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.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.QueuedResourceState.State) + } + + public interface CreatingDataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData) + com.google.protobuf.MessageOrBuilder {} + /** + * + * + *
+   * Further data for the creating state.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData} + */ + public static final class CreatingData extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData) + CreatingDataOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreatingData.newBuilder() to construct. + private CreatingData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreatingData() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreatingData(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_CreatingData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_CreatingData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData.class, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.QueuedResourceState.CreatingData)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData other = + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData 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.QueuedResourceState.CreatingData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData 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.QueuedResourceState.CreatingData parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData 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.QueuedResourceState.CreatingData parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData 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.QueuedResourceState.CreatingData parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData 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.QueuedResourceState.CreatingData 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.QueuedResourceState.CreatingData 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.QueuedResourceState.CreatingData 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; + } + /** + * + * + *
+     * Further data for the creating state.
+     * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData) + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_CreatingData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_CreatingData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData.class, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.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_QueuedResourceState_CreatingData_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData + getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData build() { + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData buildPartial() { + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData result = + new com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData other) { + if (other + == com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.QueuedResourceState.CreatingData) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData) + private static final com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData(); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreatingData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.QueuedResourceState.CreatingData + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AcceptedDataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData) + com.google.protobuf.MessageOrBuilder {} + /** + * + * + *
+   * Further data for the accepted state.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData} + */ + public static final class AcceptedData extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData) + AcceptedDataOrBuilder { + private static final long serialVersionUID = 0L; + // Use AcceptedData.newBuilder() to construct. + private AcceptedData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AcceptedData() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AcceptedData(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_AcceptedData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_AcceptedData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData.class, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.QueuedResourceState.AcceptedData)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData other = + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData 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.QueuedResourceState.AcceptedData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData 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.QueuedResourceState.AcceptedData parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData 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.QueuedResourceState.AcceptedData parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData 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.QueuedResourceState.AcceptedData parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData 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.QueuedResourceState.AcceptedData 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.QueuedResourceState.AcceptedData 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.QueuedResourceState.AcceptedData 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; + } + /** + * + * + *
+     * Further data for the accepted state.
+     * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData) + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_AcceptedData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_AcceptedData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData.class, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.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_QueuedResourceState_AcceptedData_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData + getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData build() { + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData buildPartial() { + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData result = + new com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData other) { + if (other + == com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.QueuedResourceState.AcceptedData) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData) + private static final com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData(); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AcceptedData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.QueuedResourceState.AcceptedData + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ProvisioningDataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData) + com.google.protobuf.MessageOrBuilder {} + /** + * + * + *
+   * Further data for the provisioning state.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData} + */ + public static final class ProvisioningData extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData) + ProvisioningDataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProvisioningData.newBuilder() to construct. + private ProvisioningData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProvisioningData() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProvisioningData(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_ProvisioningData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_ProvisioningData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData.class, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.QueuedResourceState.ProvisioningData)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData other = + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData 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.QueuedResourceState.ProvisioningData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData 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.QueuedResourceState.ProvisioningData parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData 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.QueuedResourceState.ProvisioningData parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData 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.QueuedResourceState.ProvisioningData + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData + 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.QueuedResourceState.ProvisioningData 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.QueuedResourceState.ProvisioningData 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.QueuedResourceState.ProvisioningData 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; + } + /** + * + * + *
+     * Further data for the provisioning state.
+     * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData) + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_ProvisioningData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_ProvisioningData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData.class, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData.Builder.class); + } + + // Construct using + // com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.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_QueuedResourceState_ProvisioningData_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData + getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData build() { + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData buildPartial() { + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData result = + new com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData) { + return mergeFrom( + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData other) { + if (other + == com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData + .getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.QueuedResourceState.ProvisioningData) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData) + private static final com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData(); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProvisioningData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.QueuedResourceState.ProvisioningData + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface FailedDataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The error that caused the queued resource to enter the FAILED state.
+     * 
+ * + * .google.rpc.Status error = 1; + * + * @return Whether the error field is set. + */ + boolean hasError(); + /** + * + * + *
+     * The error that caused the queued resource to enter the FAILED state.
+     * 
+ * + * .google.rpc.Status error = 1; + * + * @return The error. + */ + com.google.rpc.Status getError(); + /** + * + * + *
+     * The error that caused the queued resource to enter the FAILED state.
+     * 
+ * + * .google.rpc.Status error = 1; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); + } + /** + * + * + *
+   * Further data for the failed state.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData} + */ + public static final class FailedData extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData) + FailedDataOrBuilder { + private static final long serialVersionUID = 0L; + // Use FailedData.newBuilder() to construct. + private FailedData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FailedData() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FailedData(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_FailedData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_FailedData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData.class, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData.Builder.class); + } + + public static final int ERROR_FIELD_NUMBER = 1; + private com.google.rpc.Status error_; + /** + * + * + *
+     * The error that caused the queued resource to enter the FAILED state.
+     * 
+ * + * .google.rpc.Status error = 1; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return error_ != null; + } + /** + * + * + *
+     * The error that caused the queued resource to enter the FAILED state.
+     * 
+ * + * .google.rpc.Status error = 1; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + /** + * + * + *
+     * The error that caused the queued resource to enter the FAILED state.
+     * 
+ * + * .google.rpc.Status error = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + return getError(); + } + + 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 (error_ != null) { + output.writeMessage(1, getError()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (error_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getError()); + } + size += getUnknownFields().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.QueuedResourceState.FailedData)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData other = + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData) obj; + + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData 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.QueuedResourceState.FailedData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData 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.QueuedResourceState.FailedData parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData 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.QueuedResourceState.FailedData parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData 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.QueuedResourceState.FailedData parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData 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.QueuedResourceState.FailedData 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.QueuedResourceState.FailedData 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.QueuedResourceState.FailedData 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; + } + /** + * + * + *
+     * Further data for the failed state.
+     * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData) + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_FailedData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_FailedData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData.class, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (errorBuilder_ == null) { + error_ = null; + } else { + error_ = null; + errorBuilder_ = 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_QueuedResourceState_FailedData_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData + getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData build() { + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData buildPartial() { + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData result = + new com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData(this); + if (errorBuilder_ == null) { + result.error_ = error_; + } else { + result.error_ = errorBuilder_.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.QueuedResourceState.FailedData) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData other) { + if (other + == com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData.getDefaultInstance()) + return this; + if (other.hasError()) { + mergeError(other.getError()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getErrorFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private com.google.rpc.Status error_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorBuilder_; + /** + * + * + *
+       * The error that caused the queued resource to enter the FAILED state.
+       * 
+ * + * .google.rpc.Status error = 1; + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return errorBuilder_ != null || error_ != null; + } + /** + * + * + *
+       * The error that caused the queued resource to enter the FAILED state.
+       * 
+ * + * .google.rpc.Status error = 1; + * + * @return The error. + */ + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } else { + return errorBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The error that caused the queued resource to enter the FAILED state.
+       * 
+ * + * .google.rpc.Status error = 1; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The error that caused the queued resource to enter the FAILED state.
+       * 
+ * + * .google.rpc.Status error = 1; + */ + public Builder setError(com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The error that caused the queued resource to enter the FAILED state.
+       * 
+ * + * .google.rpc.Status error = 1; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (error_ != null) { + error_ = com.google.rpc.Status.newBuilder(error_).mergeFrom(value).buildPartial(); + } else { + error_ = value; + } + onChanged(); + } else { + errorBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The error that caused the queued resource to enter the FAILED state.
+       * 
+ * + * .google.rpc.Status error = 1; + */ + public Builder clearError() { + if (errorBuilder_ == null) { + error_ = null; + onChanged(); + } else { + error_ = null; + errorBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The error that caused the queued resource to enter the FAILED state.
+       * 
+ * + * .google.rpc.Status error = 1; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + + onChanged(); + return getErrorFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The error that caused the queued resource to enter the FAILED state.
+       * 
+ * + * .google.rpc.Status error = 1; + */ + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + } + /** + * + * + *
+       * The error that caused the queued resource to enter the FAILED state.
+       * 
+ * + * .google.rpc.Status error = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + @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.QueuedResourceState.FailedData) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData) + private static final com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData(); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FailedData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.QueuedResourceState.FailedData + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DeletingDataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData) + com.google.protobuf.MessageOrBuilder {} + /** + * + * + *
+   * Further data for the deleting state.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData} + */ + public static final class DeletingData extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData) + DeletingDataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeletingData.newBuilder() to construct. + private DeletingData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeletingData() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeletingData(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_DeletingData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_DeletingData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData.class, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.QueuedResourceState.DeletingData)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData other = + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData 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.QueuedResourceState.DeletingData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData 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.QueuedResourceState.DeletingData parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData 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.QueuedResourceState.DeletingData parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData 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.QueuedResourceState.DeletingData parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData 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.QueuedResourceState.DeletingData 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.QueuedResourceState.DeletingData 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.QueuedResourceState.DeletingData 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; + } + /** + * + * + *
+     * Further data for the deleting state.
+     * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData) + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_DeletingData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_DeletingData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData.class, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.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_QueuedResourceState_DeletingData_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData + getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData build() { + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData buildPartial() { + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData result = + new com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData other) { + if (other + == com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.QueuedResourceState.DeletingData) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData) + private static final com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData(); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeletingData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.QueuedResourceState.DeletingData + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ActiveDataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData) + com.google.protobuf.MessageOrBuilder {} + /** + * + * + *
+   * Further data for the active state.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData} + */ + public static final class ActiveData extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData) + ActiveDataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ActiveData.newBuilder() to construct. + private ActiveData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ActiveData() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ActiveData(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_ActiveData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_ActiveData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData.class, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.QueuedResourceState.ActiveData)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData other = + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData 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.QueuedResourceState.ActiveData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData 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.QueuedResourceState.ActiveData parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData 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.QueuedResourceState.ActiveData parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData 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.QueuedResourceState.ActiveData parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData 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.QueuedResourceState.ActiveData 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.QueuedResourceState.ActiveData 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.QueuedResourceState.ActiveData 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; + } + /** + * + * + *
+     * Further data for the active state.
+     * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData) + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_ActiveData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_ActiveData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData.class, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.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_QueuedResourceState_ActiveData_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData + getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData build() { + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData buildPartial() { + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData result = + new com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData other) { + if (other + == com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.QueuedResourceState.ActiveData) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData) + private static final com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData(); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ActiveData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.QueuedResourceState.ActiveData + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SuspendingDataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData) + com.google.protobuf.MessageOrBuilder {} + /** + * + * + *
+   * Further data for the suspending state.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData} + */ + public static final class SuspendingData extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData) + SuspendingDataOrBuilder { + private static final long serialVersionUID = 0L; + // Use SuspendingData.newBuilder() to construct. + private SuspendingData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SuspendingData() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SuspendingData(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_SuspendingData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_SuspendingData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData.class, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.QueuedResourceState.SuspendingData)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData other = + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData 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.QueuedResourceState.SuspendingData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData 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.QueuedResourceState.SuspendingData parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData 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.QueuedResourceState.SuspendingData parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData 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.QueuedResourceState.SuspendingData + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData + 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.QueuedResourceState.SuspendingData 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.QueuedResourceState.SuspendingData 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.QueuedResourceState.SuspendingData 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; + } + /** + * + * + *
+     * Further data for the suspending state.
+     * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData) + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_SuspendingData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_SuspendingData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData.class, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData.Builder.class); + } + + // Construct using + // com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.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_QueuedResourceState_SuspendingData_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData + getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData build() { + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData buildPartial() { + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData result = + new com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData) { + return mergeFrom( + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData other) { + if (other + == com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData + .getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.QueuedResourceState.SuspendingData) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData) + private static final com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData(); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SuspendingData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.QueuedResourceState.SuspendingData + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SuspendedDataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData) + com.google.protobuf.MessageOrBuilder {} + /** + * + * + *
+   * Further data for the suspended state.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData} + */ + public static final class SuspendedData extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData) + SuspendedDataOrBuilder { + private static final long serialVersionUID = 0L; + // Use SuspendedData.newBuilder() to construct. + private SuspendedData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SuspendedData() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SuspendedData(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_SuspendedData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_SuspendedData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData.class, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.QueuedResourceState.SuspendedData)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData other = + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData 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.QueuedResourceState.SuspendedData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData 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.QueuedResourceState.SuspendedData parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData 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.QueuedResourceState.SuspendedData parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData 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.QueuedResourceState.SuspendedData + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData + 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.QueuedResourceState.SuspendedData 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.QueuedResourceState.SuspendedData 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.QueuedResourceState.SuspendedData 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; + } + /** + * + * + *
+     * Further data for the suspended state.
+     * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData) + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_SuspendedData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_SuspendedData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData.class, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData.Builder.class); + } + + // Construct using + // com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.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_QueuedResourceState_SuspendedData_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData + getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData build() { + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData buildPartial() { + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData result = + new com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData other) { + if (other + == com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.QueuedResourceState.SuspendedData) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData) + private static final com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData(); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SuspendedData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.QueuedResourceState.SuspendedData + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int stateDataCase_ = 0; + private java.lang.Object stateData_; + + public enum StateDataCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CREATING_DATA(2), + ACCEPTED_DATA(3), + PROVISIONING_DATA(4), + FAILED_DATA(5), + DELETING_DATA(6), + ACTIVE_DATA(7), + SUSPENDING_DATA(8), + SUSPENDED_DATA(9), + STATEDATA_NOT_SET(0); + private final int value; + + private StateDataCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static StateDataCase valueOf(int value) { + return forNumber(value); + } + + public static StateDataCase forNumber(int value) { + switch (value) { + case 2: + return CREATING_DATA; + case 3: + return ACCEPTED_DATA; + case 4: + return PROVISIONING_DATA; + case 5: + return FAILED_DATA; + case 6: + return DELETING_DATA; + case 7: + return ACTIVE_DATA; + case 8: + return SUSPENDING_DATA; + case 9: + return SUSPENDED_DATA; + case 0: + return STATEDATA_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public StateDataCase getStateDataCase() { + return StateDataCase.forNumber(stateDataCase_); + } + + public static final int STATE_FIELD_NUMBER = 1; + private int state_; + /** + * + * + *
+   * State of the QueuedResource request.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * State of the QueuedResource request.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.State state = 1; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v2alpha1.QueuedResourceState.State result = + com.google.cloud.tpu.v2alpha1.QueuedResourceState.State.valueOf(state_); + return result == null + ? com.google.cloud.tpu.v2alpha1.QueuedResourceState.State.UNRECOGNIZED + : result; + } + + public static final int CREATING_DATA_FIELD_NUMBER = 2; + /** + * + * + *
+   * Further data for the creating state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData creating_data = 2; + * + * @return Whether the creatingData field is set. + */ + @java.lang.Override + public boolean hasCreatingData() { + return stateDataCase_ == 2; + } + /** + * + * + *
+   * Further data for the creating state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData creating_data = 2; + * + * @return The creatingData. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData getCreatingData() { + if (stateDataCase_ == 2) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData.getDefaultInstance(); + } + /** + * + * + *
+   * Further data for the creating state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData creating_data = 2; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingDataOrBuilder + getCreatingDataOrBuilder() { + if (stateDataCase_ == 2) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData.getDefaultInstance(); + } + + public static final int ACCEPTED_DATA_FIELD_NUMBER = 3; + /** + * + * + *
+   * Further data for the accepted state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData accepted_data = 3; + * + * @return Whether the acceptedData field is set. + */ + @java.lang.Override + public boolean hasAcceptedData() { + return stateDataCase_ == 3; + } + /** + * + * + *
+   * Further data for the accepted state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData accepted_data = 3; + * + * @return The acceptedData. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData getAcceptedData() { + if (stateDataCase_ == 3) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData.getDefaultInstance(); + } + /** + * + * + *
+   * Further data for the accepted state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData accepted_data = 3; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedDataOrBuilder + getAcceptedDataOrBuilder() { + if (stateDataCase_ == 3) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData.getDefaultInstance(); + } + + public static final int PROVISIONING_DATA_FIELD_NUMBER = 4; + /** + * + * + *
+   * Further data for the provisioning state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData provisioning_data = 4; + * + * + * @return Whether the provisioningData field is set. + */ + @java.lang.Override + public boolean hasProvisioningData() { + return stateDataCase_ == 4; + } + /** + * + * + *
+   * Further data for the provisioning state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData provisioning_data = 4; + * + * + * @return The provisioningData. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData getProvisioningData() { + if (stateDataCase_ == 4) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData.getDefaultInstance(); + } + /** + * + * + *
+   * Further data for the provisioning state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData provisioning_data = 4; + * + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningDataOrBuilder + getProvisioningDataOrBuilder() { + if (stateDataCase_ == 4) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData.getDefaultInstance(); + } + + public static final int FAILED_DATA_FIELD_NUMBER = 5; + /** + * + * + *
+   * Further data for the failed state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData failed_data = 5; + * + * @return Whether the failedData field is set. + */ + @java.lang.Override + public boolean hasFailedData() { + return stateDataCase_ == 5; + } + /** + * + * + *
+   * Further data for the failed state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData failed_data = 5; + * + * @return The failedData. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData getFailedData() { + if (stateDataCase_ == 5) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData.getDefaultInstance(); + } + /** + * + * + *
+   * Further data for the failed state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData failed_data = 5; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedDataOrBuilder + getFailedDataOrBuilder() { + if (stateDataCase_ == 5) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData.getDefaultInstance(); + } + + public static final int DELETING_DATA_FIELD_NUMBER = 6; + /** + * + * + *
+   * Further data for the deleting state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData deleting_data = 6; + * + * @return Whether the deletingData field is set. + */ + @java.lang.Override + public boolean hasDeletingData() { + return stateDataCase_ == 6; + } + /** + * + * + *
+   * Further data for the deleting state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData deleting_data = 6; + * + * @return The deletingData. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData getDeletingData() { + if (stateDataCase_ == 6) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData.getDefaultInstance(); + } + /** + * + * + *
+   * Further data for the deleting state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData deleting_data = 6; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingDataOrBuilder + getDeletingDataOrBuilder() { + if (stateDataCase_ == 6) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData.getDefaultInstance(); + } + + public static final int ACTIVE_DATA_FIELD_NUMBER = 7; + /** + * + * + *
+   * Further data for the active state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData active_data = 7; + * + * @return Whether the activeData field is set. + */ + @java.lang.Override + public boolean hasActiveData() { + return stateDataCase_ == 7; + } + /** + * + * + *
+   * Further data for the active state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData active_data = 7; + * + * @return The activeData. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData getActiveData() { + if (stateDataCase_ == 7) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData.getDefaultInstance(); + } + /** + * + * + *
+   * Further data for the active state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData active_data = 7; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveDataOrBuilder + getActiveDataOrBuilder() { + if (stateDataCase_ == 7) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData.getDefaultInstance(); + } + + public static final int SUSPENDING_DATA_FIELD_NUMBER = 8; + /** + * + * + *
+   * Further data for the suspending state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData suspending_data = 8; + * + * @return Whether the suspendingData field is set. + */ + @java.lang.Override + public boolean hasSuspendingData() { + return stateDataCase_ == 8; + } + /** + * + * + *
+   * Further data for the suspending state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData suspending_data = 8; + * + * @return The suspendingData. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData getSuspendingData() { + if (stateDataCase_ == 8) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData.getDefaultInstance(); + } + /** + * + * + *
+   * Further data for the suspending state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData suspending_data = 8; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingDataOrBuilder + getSuspendingDataOrBuilder() { + if (stateDataCase_ == 8) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData.getDefaultInstance(); + } + + public static final int SUSPENDED_DATA_FIELD_NUMBER = 9; + /** + * + * + *
+   * Further data for the suspended state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData suspended_data = 9; + * + * @return Whether the suspendedData field is set. + */ + @java.lang.Override + public boolean hasSuspendedData() { + return stateDataCase_ == 9; + } + /** + * + * + *
+   * Further data for the suspended state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData suspended_data = 9; + * + * @return The suspendedData. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData getSuspendedData() { + if (stateDataCase_ == 9) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData.getDefaultInstance(); + } + /** + * + * + *
+   * Further data for the suspended state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData suspended_data = 9; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedDataOrBuilder + getSuspendedDataOrBuilder() { + if (stateDataCase_ == 9) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (state_ + != com.google.cloud.tpu.v2alpha1.QueuedResourceState.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, state_); + } + if (stateDataCase_ == 2) { + output.writeMessage( + 2, (com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData) stateData_); + } + if (stateDataCase_ == 3) { + output.writeMessage( + 3, (com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData) stateData_); + } + if (stateDataCase_ == 4) { + output.writeMessage( + 4, (com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData) stateData_); + } + if (stateDataCase_ == 5) { + output.writeMessage( + 5, (com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData) stateData_); + } + if (stateDataCase_ == 6) { + output.writeMessage( + 6, (com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData) stateData_); + } + if (stateDataCase_ == 7) { + output.writeMessage( + 7, (com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData) stateData_); + } + if (stateDataCase_ == 8) { + output.writeMessage( + 8, (com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData) stateData_); + } + if (stateDataCase_ == 9) { + output.writeMessage( + 9, (com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData) stateData_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (state_ + != com.google.cloud.tpu.v2alpha1.QueuedResourceState.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, state_); + } + if (stateDataCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData) stateData_); + } + if (stateDataCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData) stateData_); + } + if (stateDataCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData) stateData_); + } + if (stateDataCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData) stateData_); + } + if (stateDataCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData) stateData_); + } + if (stateDataCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData) stateData_); + } + if (stateDataCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData) stateData_); + } + if (stateDataCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, (com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData) stateData_); + } + size += getUnknownFields().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.QueuedResourceState)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.QueuedResourceState other = + (com.google.cloud.tpu.v2alpha1.QueuedResourceState) obj; + + if (state_ != other.state_) return false; + if (!getStateDataCase().equals(other.getStateDataCase())) return false; + switch (stateDataCase_) { + case 2: + if (!getCreatingData().equals(other.getCreatingData())) return false; + break; + case 3: + if (!getAcceptedData().equals(other.getAcceptedData())) return false; + break; + case 4: + if (!getProvisioningData().equals(other.getProvisioningData())) return false; + break; + case 5: + if (!getFailedData().equals(other.getFailedData())) return false; + break; + case 6: + if (!getDeletingData().equals(other.getDeletingData())) return false; + break; + case 7: + if (!getActiveData().equals(other.getActiveData())) return false; + break; + case 8: + if (!getSuspendingData().equals(other.getSuspendingData())) return false; + break; + case 9: + if (!getSuspendedData().equals(other.getSuspendedData())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + switch (stateDataCase_) { + case 2: + hash = (37 * hash) + CREATING_DATA_FIELD_NUMBER; + hash = (53 * hash) + getCreatingData().hashCode(); + break; + case 3: + hash = (37 * hash) + ACCEPTED_DATA_FIELD_NUMBER; + hash = (53 * hash) + getAcceptedData().hashCode(); + break; + case 4: + hash = (37 * hash) + PROVISIONING_DATA_FIELD_NUMBER; + hash = (53 * hash) + getProvisioningData().hashCode(); + break; + case 5: + hash = (37 * hash) + FAILED_DATA_FIELD_NUMBER; + hash = (53 * hash) + getFailedData().hashCode(); + break; + case 6: + hash = (37 * hash) + DELETING_DATA_FIELD_NUMBER; + hash = (53 * hash) + getDeletingData().hashCode(); + break; + case 7: + hash = (37 * hash) + ACTIVE_DATA_FIELD_NUMBER; + hash = (53 * hash) + getActiveData().hashCode(); + break; + case 8: + hash = (37 * hash) + SUSPENDING_DATA_FIELD_NUMBER; + hash = (53 * hash) + getSuspendingData().hashCode(); + break; + case 9: + hash = (37 * hash) + SUSPENDED_DATA_FIELD_NUMBER; + hash = (53 * hash) + getSuspendedData().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState 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.QueuedResourceState parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState 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.QueuedResourceState parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState 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.QueuedResourceState parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState 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.QueuedResourceState parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState 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.QueuedResourceState 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.QueuedResourceState 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.QueuedResourceState 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; + } + /** + * + * + *
+   * QueuedResourceState defines the details of the QueuedResource request.
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.QueuedResourceState} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.QueuedResourceState) + com.google.cloud.tpu.v2alpha1.QueuedResourceStateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_QueuedResourceState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.class, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.QueuedResourceState.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + state_ = 0; + + if (creatingDataBuilder_ != null) { + creatingDataBuilder_.clear(); + } + if (acceptedDataBuilder_ != null) { + acceptedDataBuilder_.clear(); + } + if (provisioningDataBuilder_ != null) { + provisioningDataBuilder_.clear(); + } + if (failedDataBuilder_ != null) { + failedDataBuilder_.clear(); + } + if (deletingDataBuilder_ != null) { + deletingDataBuilder_.clear(); + } + if (activeDataBuilder_ != null) { + activeDataBuilder_.clear(); + } + if (suspendingDataBuilder_ != null) { + suspendingDataBuilder_.clear(); + } + if (suspendedDataBuilder_ != null) { + suspendedDataBuilder_.clear(); + } + stateDataCase_ = 0; + stateData_ = 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_QueuedResourceState_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState build() { + com.google.cloud.tpu.v2alpha1.QueuedResourceState result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState buildPartial() { + com.google.cloud.tpu.v2alpha1.QueuedResourceState result = + new com.google.cloud.tpu.v2alpha1.QueuedResourceState(this); + result.state_ = state_; + if (stateDataCase_ == 2) { + if (creatingDataBuilder_ == null) { + result.stateData_ = stateData_; + } else { + result.stateData_ = creatingDataBuilder_.build(); + } + } + if (stateDataCase_ == 3) { + if (acceptedDataBuilder_ == null) { + result.stateData_ = stateData_; + } else { + result.stateData_ = acceptedDataBuilder_.build(); + } + } + if (stateDataCase_ == 4) { + if (provisioningDataBuilder_ == null) { + result.stateData_ = stateData_; + } else { + result.stateData_ = provisioningDataBuilder_.build(); + } + } + if (stateDataCase_ == 5) { + if (failedDataBuilder_ == null) { + result.stateData_ = stateData_; + } else { + result.stateData_ = failedDataBuilder_.build(); + } + } + if (stateDataCase_ == 6) { + if (deletingDataBuilder_ == null) { + result.stateData_ = stateData_; + } else { + result.stateData_ = deletingDataBuilder_.build(); + } + } + if (stateDataCase_ == 7) { + if (activeDataBuilder_ == null) { + result.stateData_ = stateData_; + } else { + result.stateData_ = activeDataBuilder_.build(); + } + } + if (stateDataCase_ == 8) { + if (suspendingDataBuilder_ == null) { + result.stateData_ = stateData_; + } else { + result.stateData_ = suspendingDataBuilder_.build(); + } + } + if (stateDataCase_ == 9) { + if (suspendedDataBuilder_ == null) { + result.stateData_ = stateData_; + } else { + result.stateData_ = suspendedDataBuilder_.build(); + } + } + result.stateDataCase_ = stateDataCase_; + 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.QueuedResourceState) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.QueuedResourceState) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.QueuedResourceState other) { + if (other == com.google.cloud.tpu.v2alpha1.QueuedResourceState.getDefaultInstance()) + return this; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + switch (other.getStateDataCase()) { + case CREATING_DATA: + { + mergeCreatingData(other.getCreatingData()); + break; + } + case ACCEPTED_DATA: + { + mergeAcceptedData(other.getAcceptedData()); + break; + } + case PROVISIONING_DATA: + { + mergeProvisioningData(other.getProvisioningData()); + break; + } + case FAILED_DATA: + { + mergeFailedData(other.getFailedData()); + break; + } + case DELETING_DATA: + { + mergeDeletingData(other.getDeletingData()); + break; + } + case ACTIVE_DATA: + { + mergeActiveData(other.getActiveData()); + break; + } + case SUSPENDING_DATA: + { + mergeSuspendingData(other.getSuspendingData()); + break; + } + case SUSPENDED_DATA: + { + mergeSuspendedData(other.getSuspendedData()); + break; + } + case STATEDATA_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + state_ = input.readEnum(); + + break; + } // case 8 + case 18: + { + input.readMessage(getCreatingDataFieldBuilder().getBuilder(), extensionRegistry); + stateDataCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getAcceptedDataFieldBuilder().getBuilder(), extensionRegistry); + stateDataCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage( + getProvisioningDataFieldBuilder().getBuilder(), extensionRegistry); + stateDataCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage(getFailedDataFieldBuilder().getBuilder(), extensionRegistry); + stateDataCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage(getDeletingDataFieldBuilder().getBuilder(), extensionRegistry); + stateDataCase_ = 6; + break; + } // case 50 + case 58: + { + input.readMessage(getActiveDataFieldBuilder().getBuilder(), extensionRegistry); + stateDataCase_ = 7; + break; + } // case 58 + case 66: + { + input.readMessage(getSuspendingDataFieldBuilder().getBuilder(), extensionRegistry); + stateDataCase_ = 8; + break; + } // case 66 + case 74: + { + input.readMessage(getSuspendedDataFieldBuilder().getBuilder(), extensionRegistry); + stateDataCase_ = 9; + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int stateDataCase_ = 0; + private java.lang.Object stateData_; + + public StateDataCase getStateDataCase() { + return StateDataCase.forNumber(stateDataCase_); + } + + public Builder clearStateData() { + stateDataCase_ = 0; + stateData_ = null; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * State of the QueuedResource request.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * State of the QueuedResource request.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.State state = 1; + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * State of the QueuedResource request.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.State state = 1; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.tpu.v2alpha1.QueuedResourceState.State result = + com.google.cloud.tpu.v2alpha1.QueuedResourceState.State.valueOf(state_); + return result == null + ? com.google.cloud.tpu.v2alpha1.QueuedResourceState.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * State of the QueuedResource request.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.State state = 1; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.tpu.v2alpha1.QueuedResourceState.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * State of the QueuedResource request.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.State state = 1; + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingDataOrBuilder> + creatingDataBuilder_; + /** + * + * + *
+     * Further data for the creating state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData creating_data = 2; + * + * @return Whether the creatingData field is set. + */ + @java.lang.Override + public boolean hasCreatingData() { + return stateDataCase_ == 2; + } + /** + * + * + *
+     * Further data for the creating state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData creating_data = 2; + * + * @return The creatingData. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData getCreatingData() { + if (creatingDataBuilder_ == null) { + if (stateDataCase_ == 2) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData.getDefaultInstance(); + } else { + if (stateDataCase_ == 2) { + return creatingDataBuilder_.getMessage(); + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData.getDefaultInstance(); + } + } + /** + * + * + *
+     * Further data for the creating state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData creating_data = 2; + */ + public Builder setCreatingData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData value) { + if (creatingDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stateData_ = value; + onChanged(); + } else { + creatingDataBuilder_.setMessage(value); + } + stateDataCase_ = 2; + return this; + } + /** + * + * + *
+     * Further data for the creating state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData creating_data = 2; + */ + public Builder setCreatingData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData.Builder builderForValue) { + if (creatingDataBuilder_ == null) { + stateData_ = builderForValue.build(); + onChanged(); + } else { + creatingDataBuilder_.setMessage(builderForValue.build()); + } + stateDataCase_ = 2; + return this; + } + /** + * + * + *
+     * Further data for the creating state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData creating_data = 2; + */ + public Builder mergeCreatingData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData value) { + if (creatingDataBuilder_ == null) { + if (stateDataCase_ == 2 + && stateData_ + != com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData + .getDefaultInstance()) { + stateData_ = + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData.newBuilder( + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData) stateData_) + .mergeFrom(value) + .buildPartial(); + } else { + stateData_ = value; + } + onChanged(); + } else { + if (stateDataCase_ == 2) { + creatingDataBuilder_.mergeFrom(value); + } else { + creatingDataBuilder_.setMessage(value); + } + } + stateDataCase_ = 2; + return this; + } + /** + * + * + *
+     * Further data for the creating state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData creating_data = 2; + */ + public Builder clearCreatingData() { + if (creatingDataBuilder_ == null) { + if (stateDataCase_ == 2) { + stateDataCase_ = 0; + stateData_ = null; + onChanged(); + } + } else { + if (stateDataCase_ == 2) { + stateDataCase_ = 0; + stateData_ = null; + } + creatingDataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Further data for the creating state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData creating_data = 2; + */ + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData.Builder + getCreatingDataBuilder() { + return getCreatingDataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Further data for the creating state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData creating_data = 2; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingDataOrBuilder + getCreatingDataOrBuilder() { + if ((stateDataCase_ == 2) && (creatingDataBuilder_ != null)) { + return creatingDataBuilder_.getMessageOrBuilder(); + } else { + if (stateDataCase_ == 2) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData.getDefaultInstance(); + } + } + /** + * + * + *
+     * Further data for the creating state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData creating_data = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingDataOrBuilder> + getCreatingDataFieldBuilder() { + if (creatingDataBuilder_ == null) { + if (!(stateDataCase_ == 2)) { + stateData_ = + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData.getDefaultInstance(); + } + creatingDataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingDataOrBuilder>( + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData) stateData_, + getParentForChildren(), + isClean()); + stateData_ = null; + } + stateDataCase_ = 2; + onChanged(); + ; + return creatingDataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedDataOrBuilder> + acceptedDataBuilder_; + /** + * + * + *
+     * Further data for the accepted state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData accepted_data = 3; + * + * @return Whether the acceptedData field is set. + */ + @java.lang.Override + public boolean hasAcceptedData() { + return stateDataCase_ == 3; + } + /** + * + * + *
+     * Further data for the accepted state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData accepted_data = 3; + * + * @return The acceptedData. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData getAcceptedData() { + if (acceptedDataBuilder_ == null) { + if (stateDataCase_ == 3) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData.getDefaultInstance(); + } else { + if (stateDataCase_ == 3) { + return acceptedDataBuilder_.getMessage(); + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData.getDefaultInstance(); + } + } + /** + * + * + *
+     * Further data for the accepted state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData accepted_data = 3; + */ + public Builder setAcceptedData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData value) { + if (acceptedDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stateData_ = value; + onChanged(); + } else { + acceptedDataBuilder_.setMessage(value); + } + stateDataCase_ = 3; + return this; + } + /** + * + * + *
+     * Further data for the accepted state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData accepted_data = 3; + */ + public Builder setAcceptedData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData.Builder builderForValue) { + if (acceptedDataBuilder_ == null) { + stateData_ = builderForValue.build(); + onChanged(); + } else { + acceptedDataBuilder_.setMessage(builderForValue.build()); + } + stateDataCase_ = 3; + return this; + } + /** + * + * + *
+     * Further data for the accepted state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData accepted_data = 3; + */ + public Builder mergeAcceptedData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData value) { + if (acceptedDataBuilder_ == null) { + if (stateDataCase_ == 3 + && stateData_ + != com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData + .getDefaultInstance()) { + stateData_ = + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData.newBuilder( + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData) stateData_) + .mergeFrom(value) + .buildPartial(); + } else { + stateData_ = value; + } + onChanged(); + } else { + if (stateDataCase_ == 3) { + acceptedDataBuilder_.mergeFrom(value); + } else { + acceptedDataBuilder_.setMessage(value); + } + } + stateDataCase_ = 3; + return this; + } + /** + * + * + *
+     * Further data for the accepted state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData accepted_data = 3; + */ + public Builder clearAcceptedData() { + if (acceptedDataBuilder_ == null) { + if (stateDataCase_ == 3) { + stateDataCase_ = 0; + stateData_ = null; + onChanged(); + } + } else { + if (stateDataCase_ == 3) { + stateDataCase_ = 0; + stateData_ = null; + } + acceptedDataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Further data for the accepted state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData accepted_data = 3; + */ + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData.Builder + getAcceptedDataBuilder() { + return getAcceptedDataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Further data for the accepted state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData accepted_data = 3; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedDataOrBuilder + getAcceptedDataOrBuilder() { + if ((stateDataCase_ == 3) && (acceptedDataBuilder_ != null)) { + return acceptedDataBuilder_.getMessageOrBuilder(); + } else { + if (stateDataCase_ == 3) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData.getDefaultInstance(); + } + } + /** + * + * + *
+     * Further data for the accepted state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData accepted_data = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedDataOrBuilder> + getAcceptedDataFieldBuilder() { + if (acceptedDataBuilder_ == null) { + if (!(stateDataCase_ == 3)) { + stateData_ = + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData.getDefaultInstance(); + } + acceptedDataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedDataOrBuilder>( + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData) stateData_, + getParentForChildren(), + isClean()); + stateData_ = null; + } + stateDataCase_ = 3; + onChanged(); + ; + return acceptedDataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningDataOrBuilder> + provisioningDataBuilder_; + /** + * + * + *
+     * Further data for the provisioning state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData provisioning_data = 4; + * + * + * @return Whether the provisioningData field is set. + */ + @java.lang.Override + public boolean hasProvisioningData() { + return stateDataCase_ == 4; + } + /** + * + * + *
+     * Further data for the provisioning state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData provisioning_data = 4; + * + * + * @return The provisioningData. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData + getProvisioningData() { + if (provisioningDataBuilder_ == null) { + if (stateDataCase_ == 4) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData + .getDefaultInstance(); + } else { + if (stateDataCase_ == 4) { + return provisioningDataBuilder_.getMessage(); + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Further data for the provisioning state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData provisioning_data = 4; + * + */ + public Builder setProvisioningData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData value) { + if (provisioningDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stateData_ = value; + onChanged(); + } else { + provisioningDataBuilder_.setMessage(value); + } + stateDataCase_ = 4; + return this; + } + /** + * + * + *
+     * Further data for the provisioning state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData provisioning_data = 4; + * + */ + public Builder setProvisioningData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData.Builder + builderForValue) { + if (provisioningDataBuilder_ == null) { + stateData_ = builderForValue.build(); + onChanged(); + } else { + provisioningDataBuilder_.setMessage(builderForValue.build()); + } + stateDataCase_ = 4; + return this; + } + /** + * + * + *
+     * Further data for the provisioning state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData provisioning_data = 4; + * + */ + public Builder mergeProvisioningData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData value) { + if (provisioningDataBuilder_ == null) { + if (stateDataCase_ == 4 + && stateData_ + != com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData + .getDefaultInstance()) { + stateData_ = + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData.newBuilder( + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData) + stateData_) + .mergeFrom(value) + .buildPartial(); + } else { + stateData_ = value; + } + onChanged(); + } else { + if (stateDataCase_ == 4) { + provisioningDataBuilder_.mergeFrom(value); + } else { + provisioningDataBuilder_.setMessage(value); + } + } + stateDataCase_ = 4; + return this; + } + /** + * + * + *
+     * Further data for the provisioning state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData provisioning_data = 4; + * + */ + public Builder clearProvisioningData() { + if (provisioningDataBuilder_ == null) { + if (stateDataCase_ == 4) { + stateDataCase_ = 0; + stateData_ = null; + onChanged(); + } + } else { + if (stateDataCase_ == 4) { + stateDataCase_ = 0; + stateData_ = null; + } + provisioningDataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Further data for the provisioning state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData provisioning_data = 4; + * + */ + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData.Builder + getProvisioningDataBuilder() { + return getProvisioningDataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Further data for the provisioning state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData provisioning_data = 4; + * + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningDataOrBuilder + getProvisioningDataOrBuilder() { + if ((stateDataCase_ == 4) && (provisioningDataBuilder_ != null)) { + return provisioningDataBuilder_.getMessageOrBuilder(); + } else { + if (stateDataCase_ == 4) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Further data for the provisioning state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData provisioning_data = 4; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningDataOrBuilder> + getProvisioningDataFieldBuilder() { + if (provisioningDataBuilder_ == null) { + if (!(stateDataCase_ == 4)) { + stateData_ = + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData + .getDefaultInstance(); + } + provisioningDataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningDataOrBuilder>( + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData) stateData_, + getParentForChildren(), + isClean()); + stateData_ = null; + } + stateDataCase_ = 4; + onChanged(); + ; + return provisioningDataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedDataOrBuilder> + failedDataBuilder_; + /** + * + * + *
+     * Further data for the failed state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData failed_data = 5; + * + * @return Whether the failedData field is set. + */ + @java.lang.Override + public boolean hasFailedData() { + return stateDataCase_ == 5; + } + /** + * + * + *
+     * Further data for the failed state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData failed_data = 5; + * + * @return The failedData. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData getFailedData() { + if (failedDataBuilder_ == null) { + if (stateDataCase_ == 5) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData.getDefaultInstance(); + } else { + if (stateDataCase_ == 5) { + return failedDataBuilder_.getMessage(); + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData.getDefaultInstance(); + } + } + /** + * + * + *
+     * Further data for the failed state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData failed_data = 5; + */ + public Builder setFailedData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData value) { + if (failedDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stateData_ = value; + onChanged(); + } else { + failedDataBuilder_.setMessage(value); + } + stateDataCase_ = 5; + return this; + } + /** + * + * + *
+     * Further data for the failed state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData failed_data = 5; + */ + public Builder setFailedData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData.Builder builderForValue) { + if (failedDataBuilder_ == null) { + stateData_ = builderForValue.build(); + onChanged(); + } else { + failedDataBuilder_.setMessage(builderForValue.build()); + } + stateDataCase_ = 5; + return this; + } + /** + * + * + *
+     * Further data for the failed state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData failed_data = 5; + */ + public Builder mergeFailedData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData value) { + if (failedDataBuilder_ == null) { + if (stateDataCase_ == 5 + && stateData_ + != com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData + .getDefaultInstance()) { + stateData_ = + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData.newBuilder( + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData) stateData_) + .mergeFrom(value) + .buildPartial(); + } else { + stateData_ = value; + } + onChanged(); + } else { + if (stateDataCase_ == 5) { + failedDataBuilder_.mergeFrom(value); + } else { + failedDataBuilder_.setMessage(value); + } + } + stateDataCase_ = 5; + return this; + } + /** + * + * + *
+     * Further data for the failed state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData failed_data = 5; + */ + public Builder clearFailedData() { + if (failedDataBuilder_ == null) { + if (stateDataCase_ == 5) { + stateDataCase_ = 0; + stateData_ = null; + onChanged(); + } + } else { + if (stateDataCase_ == 5) { + stateDataCase_ = 0; + stateData_ = null; + } + failedDataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Further data for the failed state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData failed_data = 5; + */ + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData.Builder + getFailedDataBuilder() { + return getFailedDataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Further data for the failed state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData failed_data = 5; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedDataOrBuilder + getFailedDataOrBuilder() { + if ((stateDataCase_ == 5) && (failedDataBuilder_ != null)) { + return failedDataBuilder_.getMessageOrBuilder(); + } else { + if (stateDataCase_ == 5) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData.getDefaultInstance(); + } + } + /** + * + * + *
+     * Further data for the failed state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData failed_data = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedDataOrBuilder> + getFailedDataFieldBuilder() { + if (failedDataBuilder_ == null) { + if (!(stateDataCase_ == 5)) { + stateData_ = + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData.getDefaultInstance(); + } + failedDataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedDataOrBuilder>( + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData) stateData_, + getParentForChildren(), + isClean()); + stateData_ = null; + } + stateDataCase_ = 5; + onChanged(); + ; + return failedDataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingDataOrBuilder> + deletingDataBuilder_; + /** + * + * + *
+     * Further data for the deleting state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData deleting_data = 6; + * + * @return Whether the deletingData field is set. + */ + @java.lang.Override + public boolean hasDeletingData() { + return stateDataCase_ == 6; + } + /** + * + * + *
+     * Further data for the deleting state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData deleting_data = 6; + * + * @return The deletingData. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData getDeletingData() { + if (deletingDataBuilder_ == null) { + if (stateDataCase_ == 6) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData.getDefaultInstance(); + } else { + if (stateDataCase_ == 6) { + return deletingDataBuilder_.getMessage(); + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData.getDefaultInstance(); + } + } + /** + * + * + *
+     * Further data for the deleting state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData deleting_data = 6; + */ + public Builder setDeletingData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData value) { + if (deletingDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stateData_ = value; + onChanged(); + } else { + deletingDataBuilder_.setMessage(value); + } + stateDataCase_ = 6; + return this; + } + /** + * + * + *
+     * Further data for the deleting state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData deleting_data = 6; + */ + public Builder setDeletingData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData.Builder builderForValue) { + if (deletingDataBuilder_ == null) { + stateData_ = builderForValue.build(); + onChanged(); + } else { + deletingDataBuilder_.setMessage(builderForValue.build()); + } + stateDataCase_ = 6; + return this; + } + /** + * + * + *
+     * Further data for the deleting state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData deleting_data = 6; + */ + public Builder mergeDeletingData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData value) { + if (deletingDataBuilder_ == null) { + if (stateDataCase_ == 6 + && stateData_ + != com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData + .getDefaultInstance()) { + stateData_ = + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData.newBuilder( + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData) stateData_) + .mergeFrom(value) + .buildPartial(); + } else { + stateData_ = value; + } + onChanged(); + } else { + if (stateDataCase_ == 6) { + deletingDataBuilder_.mergeFrom(value); + } else { + deletingDataBuilder_.setMessage(value); + } + } + stateDataCase_ = 6; + return this; + } + /** + * + * + *
+     * Further data for the deleting state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData deleting_data = 6; + */ + public Builder clearDeletingData() { + if (deletingDataBuilder_ == null) { + if (stateDataCase_ == 6) { + stateDataCase_ = 0; + stateData_ = null; + onChanged(); + } + } else { + if (stateDataCase_ == 6) { + stateDataCase_ = 0; + stateData_ = null; + } + deletingDataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Further data for the deleting state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData deleting_data = 6; + */ + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData.Builder + getDeletingDataBuilder() { + return getDeletingDataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Further data for the deleting state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData deleting_data = 6; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingDataOrBuilder + getDeletingDataOrBuilder() { + if ((stateDataCase_ == 6) && (deletingDataBuilder_ != null)) { + return deletingDataBuilder_.getMessageOrBuilder(); + } else { + if (stateDataCase_ == 6) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData.getDefaultInstance(); + } + } + /** + * + * + *
+     * Further data for the deleting state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData deleting_data = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingDataOrBuilder> + getDeletingDataFieldBuilder() { + if (deletingDataBuilder_ == null) { + if (!(stateDataCase_ == 6)) { + stateData_ = + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData.getDefaultInstance(); + } + deletingDataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingDataOrBuilder>( + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData) stateData_, + getParentForChildren(), + isClean()); + stateData_ = null; + } + stateDataCase_ = 6; + onChanged(); + ; + return deletingDataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveDataOrBuilder> + activeDataBuilder_; + /** + * + * + *
+     * Further data for the active state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData active_data = 7; + * + * @return Whether the activeData field is set. + */ + @java.lang.Override + public boolean hasActiveData() { + return stateDataCase_ == 7; + } + /** + * + * + *
+     * Further data for the active state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData active_data = 7; + * + * @return The activeData. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData getActiveData() { + if (activeDataBuilder_ == null) { + if (stateDataCase_ == 7) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData.getDefaultInstance(); + } else { + if (stateDataCase_ == 7) { + return activeDataBuilder_.getMessage(); + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData.getDefaultInstance(); + } + } + /** + * + * + *
+     * Further data for the active state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData active_data = 7; + */ + public Builder setActiveData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData value) { + if (activeDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stateData_ = value; + onChanged(); + } else { + activeDataBuilder_.setMessage(value); + } + stateDataCase_ = 7; + return this; + } + /** + * + * + *
+     * Further data for the active state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData active_data = 7; + */ + public Builder setActiveData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData.Builder builderForValue) { + if (activeDataBuilder_ == null) { + stateData_ = builderForValue.build(); + onChanged(); + } else { + activeDataBuilder_.setMessage(builderForValue.build()); + } + stateDataCase_ = 7; + return this; + } + /** + * + * + *
+     * Further data for the active state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData active_data = 7; + */ + public Builder mergeActiveData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData value) { + if (activeDataBuilder_ == null) { + if (stateDataCase_ == 7 + && stateData_ + != com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData + .getDefaultInstance()) { + stateData_ = + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData.newBuilder( + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData) stateData_) + .mergeFrom(value) + .buildPartial(); + } else { + stateData_ = value; + } + onChanged(); + } else { + if (stateDataCase_ == 7) { + activeDataBuilder_.mergeFrom(value); + } else { + activeDataBuilder_.setMessage(value); + } + } + stateDataCase_ = 7; + return this; + } + /** + * + * + *
+     * Further data for the active state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData active_data = 7; + */ + public Builder clearActiveData() { + if (activeDataBuilder_ == null) { + if (stateDataCase_ == 7) { + stateDataCase_ = 0; + stateData_ = null; + onChanged(); + } + } else { + if (stateDataCase_ == 7) { + stateDataCase_ = 0; + stateData_ = null; + } + activeDataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Further data for the active state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData active_data = 7; + */ + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData.Builder + getActiveDataBuilder() { + return getActiveDataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Further data for the active state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData active_data = 7; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveDataOrBuilder + getActiveDataOrBuilder() { + if ((stateDataCase_ == 7) && (activeDataBuilder_ != null)) { + return activeDataBuilder_.getMessageOrBuilder(); + } else { + if (stateDataCase_ == 7) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData.getDefaultInstance(); + } + } + /** + * + * + *
+     * Further data for the active state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData active_data = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveDataOrBuilder> + getActiveDataFieldBuilder() { + if (activeDataBuilder_ == null) { + if (!(stateDataCase_ == 7)) { + stateData_ = + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData.getDefaultInstance(); + } + activeDataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveDataOrBuilder>( + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData) stateData_, + getParentForChildren(), + isClean()); + stateData_ = null; + } + stateDataCase_ = 7; + onChanged(); + ; + return activeDataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingDataOrBuilder> + suspendingDataBuilder_; + /** + * + * + *
+     * Further data for the suspending state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData suspending_data = 8; + * + * + * @return Whether the suspendingData field is set. + */ + @java.lang.Override + public boolean hasSuspendingData() { + return stateDataCase_ == 8; + } + /** + * + * + *
+     * Further data for the suspending state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData suspending_data = 8; + * + * + * @return The suspendingData. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData getSuspendingData() { + if (suspendingDataBuilder_ == null) { + if (stateDataCase_ == 8) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData + .getDefaultInstance(); + } else { + if (stateDataCase_ == 8) { + return suspendingDataBuilder_.getMessage(); + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Further data for the suspending state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData suspending_data = 8; + * + */ + public Builder setSuspendingData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData value) { + if (suspendingDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stateData_ = value; + onChanged(); + } else { + suspendingDataBuilder_.setMessage(value); + } + stateDataCase_ = 8; + return this; + } + /** + * + * + *
+     * Further data for the suspending state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData suspending_data = 8; + * + */ + public Builder setSuspendingData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData.Builder builderForValue) { + if (suspendingDataBuilder_ == null) { + stateData_ = builderForValue.build(); + onChanged(); + } else { + suspendingDataBuilder_.setMessage(builderForValue.build()); + } + stateDataCase_ = 8; + return this; + } + /** + * + * + *
+     * Further data for the suspending state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData suspending_data = 8; + * + */ + public Builder mergeSuspendingData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData value) { + if (suspendingDataBuilder_ == null) { + if (stateDataCase_ == 8 + && stateData_ + != com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData + .getDefaultInstance()) { + stateData_ = + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData.newBuilder( + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData) stateData_) + .mergeFrom(value) + .buildPartial(); + } else { + stateData_ = value; + } + onChanged(); + } else { + if (stateDataCase_ == 8) { + suspendingDataBuilder_.mergeFrom(value); + } else { + suspendingDataBuilder_.setMessage(value); + } + } + stateDataCase_ = 8; + return this; + } + /** + * + * + *
+     * Further data for the suspending state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData suspending_data = 8; + * + */ + public Builder clearSuspendingData() { + if (suspendingDataBuilder_ == null) { + if (stateDataCase_ == 8) { + stateDataCase_ = 0; + stateData_ = null; + onChanged(); + } + } else { + if (stateDataCase_ == 8) { + stateDataCase_ = 0; + stateData_ = null; + } + suspendingDataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Further data for the suspending state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData suspending_data = 8; + * + */ + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData.Builder + getSuspendingDataBuilder() { + return getSuspendingDataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Further data for the suspending state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData suspending_data = 8; + * + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingDataOrBuilder + getSuspendingDataOrBuilder() { + if ((stateDataCase_ == 8) && (suspendingDataBuilder_ != null)) { + return suspendingDataBuilder_.getMessageOrBuilder(); + } else { + if (stateDataCase_ == 8) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Further data for the suspending state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData suspending_data = 8; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingDataOrBuilder> + getSuspendingDataFieldBuilder() { + if (suspendingDataBuilder_ == null) { + if (!(stateDataCase_ == 8)) { + stateData_ = + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData.getDefaultInstance(); + } + suspendingDataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingDataOrBuilder>( + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData) stateData_, + getParentForChildren(), + isClean()); + stateData_ = null; + } + stateDataCase_ = 8; + onChanged(); + ; + return suspendingDataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedDataOrBuilder> + suspendedDataBuilder_; + /** + * + * + *
+     * Further data for the suspended state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData suspended_data = 9; + * + * @return Whether the suspendedData field is set. + */ + @java.lang.Override + public boolean hasSuspendedData() { + return stateDataCase_ == 9; + } + /** + * + * + *
+     * Further data for the suspended state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData suspended_data = 9; + * + * @return The suspendedData. + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData getSuspendedData() { + if (suspendedDataBuilder_ == null) { + if (stateDataCase_ == 9) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData.getDefaultInstance(); + } else { + if (stateDataCase_ == 9) { + return suspendedDataBuilder_.getMessage(); + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData.getDefaultInstance(); + } + } + /** + * + * + *
+     * Further data for the suspended state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData suspended_data = 9; + */ + public Builder setSuspendedData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData value) { + if (suspendedDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stateData_ = value; + onChanged(); + } else { + suspendedDataBuilder_.setMessage(value); + } + stateDataCase_ = 9; + return this; + } + /** + * + * + *
+     * Further data for the suspended state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData suspended_data = 9; + */ + public Builder setSuspendedData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData.Builder builderForValue) { + if (suspendedDataBuilder_ == null) { + stateData_ = builderForValue.build(); + onChanged(); + } else { + suspendedDataBuilder_.setMessage(builderForValue.build()); + } + stateDataCase_ = 9; + return this; + } + /** + * + * + *
+     * Further data for the suspended state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData suspended_data = 9; + */ + public Builder mergeSuspendedData( + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData value) { + if (suspendedDataBuilder_ == null) { + if (stateDataCase_ == 9 + && stateData_ + != com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData + .getDefaultInstance()) { + stateData_ = + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData.newBuilder( + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData) stateData_) + .mergeFrom(value) + .buildPartial(); + } else { + stateData_ = value; + } + onChanged(); + } else { + if (stateDataCase_ == 9) { + suspendedDataBuilder_.mergeFrom(value); + } else { + suspendedDataBuilder_.setMessage(value); + } + } + stateDataCase_ = 9; + return this; + } + /** + * + * + *
+     * Further data for the suspended state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData suspended_data = 9; + */ + public Builder clearSuspendedData() { + if (suspendedDataBuilder_ == null) { + if (stateDataCase_ == 9) { + stateDataCase_ = 0; + stateData_ = null; + onChanged(); + } + } else { + if (stateDataCase_ == 9) { + stateDataCase_ = 0; + stateData_ = null; + } + suspendedDataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Further data for the suspended state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData suspended_data = 9; + */ + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData.Builder + getSuspendedDataBuilder() { + return getSuspendedDataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Further data for the suspended state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData suspended_data = 9; + */ + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedDataOrBuilder + getSuspendedDataOrBuilder() { + if ((stateDataCase_ == 9) && (suspendedDataBuilder_ != null)) { + return suspendedDataBuilder_.getMessageOrBuilder(); + } else { + if (stateDataCase_ == 9) { + return (com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData) stateData_; + } + return com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData.getDefaultInstance(); + } + } + /** + * + * + *
+     * Further data for the suspended state.
+     * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData suspended_data = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedDataOrBuilder> + getSuspendedDataFieldBuilder() { + if (suspendedDataBuilder_ == null) { + if (!(stateDataCase_ == 9)) { + stateData_ = + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData.getDefaultInstance(); + } + suspendedDataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData.Builder, + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedDataOrBuilder>( + (com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData) stateData_, + getParentForChildren(), + isClean()); + stateData_ = null; + } + stateDataCase_ = 9; + onChanged(); + ; + return suspendedDataBuilder_; + } + + @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.QueuedResourceState) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.QueuedResourceState) + private static final com.google.cloud.tpu.v2alpha1.QueuedResourceState DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.QueuedResourceState(); + } + + public static com.google.cloud.tpu.v2alpha1.QueuedResourceState getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueuedResourceState parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.QueuedResourceState getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/QueuedResourceStateOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/QueuedResourceStateOrBuilder.java new file mode 100644 index 000000000000..a1247577c5e7 --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/QueuedResourceStateOrBuilder.java @@ -0,0 +1,341 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface QueuedResourceStateOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.QueuedResourceState) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * State of the QueuedResource request.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * State of the QueuedResource request.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.State state = 1; + * + * @return The state. + */ + com.google.cloud.tpu.v2alpha1.QueuedResourceState.State getState(); + + /** + * + * + *
+   * Further data for the creating state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData creating_data = 2; + * + * @return Whether the creatingData field is set. + */ + boolean hasCreatingData(); + /** + * + * + *
+   * Further data for the creating state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData creating_data = 2; + * + * @return The creatingData. + */ + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData getCreatingData(); + /** + * + * + *
+   * Further data for the creating state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingData creating_data = 2; + */ + com.google.cloud.tpu.v2alpha1.QueuedResourceState.CreatingDataOrBuilder + getCreatingDataOrBuilder(); + + /** + * + * + *
+   * Further data for the accepted state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData accepted_data = 3; + * + * @return Whether the acceptedData field is set. + */ + boolean hasAcceptedData(); + /** + * + * + *
+   * Further data for the accepted state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData accepted_data = 3; + * + * @return The acceptedData. + */ + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData getAcceptedData(); + /** + * + * + *
+   * Further data for the accepted state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedData accepted_data = 3; + */ + com.google.cloud.tpu.v2alpha1.QueuedResourceState.AcceptedDataOrBuilder + getAcceptedDataOrBuilder(); + + /** + * + * + *
+   * Further data for the provisioning state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData provisioning_data = 4; + * + * + * @return Whether the provisioningData field is set. + */ + boolean hasProvisioningData(); + /** + * + * + *
+   * Further data for the provisioning state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData provisioning_data = 4; + * + * + * @return The provisioningData. + */ + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData getProvisioningData(); + /** + * + * + *
+   * Further data for the provisioning state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningData provisioning_data = 4; + * + */ + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ProvisioningDataOrBuilder + getProvisioningDataOrBuilder(); + + /** + * + * + *
+   * Further data for the failed state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData failed_data = 5; + * + * @return Whether the failedData field is set. + */ + boolean hasFailedData(); + /** + * + * + *
+   * Further data for the failed state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData failed_data = 5; + * + * @return The failedData. + */ + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData getFailedData(); + /** + * + * + *
+   * Further data for the failed state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.FailedData failed_data = 5; + */ + com.google.cloud.tpu.v2alpha1.QueuedResourceState.FailedDataOrBuilder getFailedDataOrBuilder(); + + /** + * + * + *
+   * Further data for the deleting state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData deleting_data = 6; + * + * @return Whether the deletingData field is set. + */ + boolean hasDeletingData(); + /** + * + * + *
+   * Further data for the deleting state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData deleting_data = 6; + * + * @return The deletingData. + */ + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData getDeletingData(); + /** + * + * + *
+   * Further data for the deleting state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingData deleting_data = 6; + */ + com.google.cloud.tpu.v2alpha1.QueuedResourceState.DeletingDataOrBuilder + getDeletingDataOrBuilder(); + + /** + * + * + *
+   * Further data for the active state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData active_data = 7; + * + * @return Whether the activeData field is set. + */ + boolean hasActiveData(); + /** + * + * + *
+   * Further data for the active state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData active_data = 7; + * + * @return The activeData. + */ + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData getActiveData(); + /** + * + * + *
+   * Further data for the active state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveData active_data = 7; + */ + com.google.cloud.tpu.v2alpha1.QueuedResourceState.ActiveDataOrBuilder getActiveDataOrBuilder(); + + /** + * + * + *
+   * Further data for the suspending state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData suspending_data = 8; + * + * @return Whether the suspendingData field is set. + */ + boolean hasSuspendingData(); + /** + * + * + *
+   * Further data for the suspending state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData suspending_data = 8; + * + * @return The suspendingData. + */ + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData getSuspendingData(); + /** + * + * + *
+   * Further data for the suspending state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingData suspending_data = 8; + */ + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendingDataOrBuilder + getSuspendingDataOrBuilder(); + + /** + * + * + *
+   * Further data for the suspended state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData suspended_data = 9; + * + * @return Whether the suspendedData field is set. + */ + boolean hasSuspendedData(); + /** + * + * + *
+   * Further data for the suspended state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData suspended_data = 9; + * + * @return The suspendedData. + */ + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData getSuspendedData(); + /** + * + * + *
+   * Further data for the suspended state.
+   * 
+ * + * .google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedData suspended_data = 9; + */ + com.google.cloud.tpu.v2alpha1.QueuedResourceState.SuspendedDataOrBuilder + getSuspendedDataOrBuilder(); + + public com.google.cloud.tpu.v2alpha1.QueuedResourceState.StateDataCase getStateDataCase(); +} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SimulateMaintenanceEventRequest.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SimulateMaintenanceEventRequest.java new file mode 100644 index 000000000000..8e9a629a0cde --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SimulateMaintenanceEventRequest.java @@ -0,0 +1,946 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +/** + * + * + *
+ * Request for [SimulateMaintenanceEvent][google.cloud.tpu.v2alpha1.Tpu.SimulateMaintenanceEvent].
+ * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest} + */ +public final class SimulateMaintenanceEventRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest) + SimulateMaintenanceEventRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SimulateMaintenanceEventRequest.newBuilder() to construct. + private SimulateMaintenanceEventRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SimulateMaintenanceEventRequest() { + name_ = ""; + workerIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SimulateMaintenanceEventRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_SimulateMaintenanceEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_SimulateMaintenanceEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest.class, + com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest.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 WORKER_IDS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList workerIds_; + /** + * + * + *
+   * The 0-based worker ID. If it is empty, worker ID 0 will be selected for
+   * maintenance event simulation. A maintenance event will only be fired on the
+   * first specified worker ID. Future implementations may support firing on
+   * multiple workers.
+   * 
+ * + * repeated string worker_ids = 2; + * + * @return A list containing the workerIds. + */ + public com.google.protobuf.ProtocolStringList getWorkerIdsList() { + return workerIds_; + } + /** + * + * + *
+   * The 0-based worker ID. If it is empty, worker ID 0 will be selected for
+   * maintenance event simulation. A maintenance event will only be fired on the
+   * first specified worker ID. Future implementations may support firing on
+   * multiple workers.
+   * 
+ * + * repeated string worker_ids = 2; + * + * @return The count of workerIds. + */ + public int getWorkerIdsCount() { + return workerIds_.size(); + } + /** + * + * + *
+   * The 0-based worker ID. If it is empty, worker ID 0 will be selected for
+   * maintenance event simulation. A maintenance event will only be fired on the
+   * first specified worker ID. Future implementations may support firing on
+   * multiple workers.
+   * 
+ * + * repeated string worker_ids = 2; + * + * @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, worker ID 0 will be selected for
+   * maintenance event simulation. A maintenance event will only be fired on the
+   * first specified worker ID. Future implementations may support firing on
+   * multiple workers.
+   * 
+ * + * repeated string worker_ids = 2; + * + * @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_); + } + for (int i = 0; i < workerIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, workerIds_.getRaw(i)); + } + getUnknownFields().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_); + } + { + int dataSize = 0; + for (int i = 0; i < workerIds_.size(); i++) { + dataSize += computeStringSizeNoTag(workerIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getWorkerIdsList().size(); + } + size += getUnknownFields().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.SimulateMaintenanceEventRequest)) { + return super.equals(obj); + } + com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest other = + (com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getWorkerIdsList().equals(other.getWorkerIdsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getWorkerIdsCount() > 0) { + hash = (37 * hash) + WORKER_IDS_FIELD_NUMBER; + hash = (53 * hash) + getWorkerIdsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest 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.SimulateMaintenanceEventRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest 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.SimulateMaintenanceEventRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest 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.SimulateMaintenanceEventRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest 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.SimulateMaintenanceEventRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest 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.SimulateMaintenanceEventRequest 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.SimulateMaintenanceEventRequest 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.SimulateMaintenanceEventRequest 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 [SimulateMaintenanceEvent][google.cloud.tpu.v2alpha1.Tpu.SimulateMaintenanceEvent].
+   * 
+ * + * Protobuf type {@code google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest) + com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_SimulateMaintenanceEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.tpu.v2alpha1.CloudTpuProto + .internal_static_google_cloud_tpu_v2alpha1_SimulateMaintenanceEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest.class, + com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest.Builder.class); + } + + // Construct using com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + 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_SimulateMaintenanceEventRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest + getDefaultInstanceForType() { + return com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest build() { + com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest buildPartial() { + com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest result = + new com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + 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.SimulateMaintenanceEventRequest) { + return mergeFrom((com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest other) { + if (other + == com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.workerIds_.isEmpty()) { + if (workerIds_.isEmpty()) { + workerIds_ = other.workerIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWorkerIdsIsMutable(); + workerIds_.addAll(other.workerIds_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureWorkerIdsIsMutable(); + workerIds_.add(s); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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 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, worker ID 0 will be selected for
+     * maintenance event simulation. A maintenance event will only be fired on the
+     * first specified worker ID. Future implementations may support firing on
+     * multiple workers.
+     * 
+ * + * repeated string worker_ids = 2; + * + * @return A list containing the workerIds. + */ + public com.google.protobuf.ProtocolStringList getWorkerIdsList() { + return workerIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * The 0-based worker ID. If it is empty, worker ID 0 will be selected for
+     * maintenance event simulation. A maintenance event will only be fired on the
+     * first specified worker ID. Future implementations may support firing on
+     * multiple workers.
+     * 
+ * + * repeated string worker_ids = 2; + * + * @return The count of workerIds. + */ + public int getWorkerIdsCount() { + return workerIds_.size(); + } + /** + * + * + *
+     * The 0-based worker ID. If it is empty, worker ID 0 will be selected for
+     * maintenance event simulation. A maintenance event will only be fired on the
+     * first specified worker ID. Future implementations may support firing on
+     * multiple workers.
+     * 
+ * + * repeated string worker_ids = 2; + * + * @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, worker ID 0 will be selected for
+     * maintenance event simulation. A maintenance event will only be fired on the
+     * first specified worker ID. Future implementations may support firing on
+     * multiple workers.
+     * 
+ * + * repeated string worker_ids = 2; + * + * @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, worker ID 0 will be selected for
+     * maintenance event simulation. A maintenance event will only be fired on the
+     * first specified worker ID. Future implementations may support firing on
+     * multiple workers.
+     * 
+ * + * repeated string worker_ids = 2; + * + * @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, worker ID 0 will be selected for
+     * maintenance event simulation. A maintenance event will only be fired on the
+     * first specified worker ID. Future implementations may support firing on
+     * multiple workers.
+     * 
+ * + * repeated string worker_ids = 2; + * + * @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, worker ID 0 will be selected for
+     * maintenance event simulation. A maintenance event will only be fired on the
+     * first specified worker ID. Future implementations may support firing on
+     * multiple workers.
+     * 
+ * + * repeated string worker_ids = 2; + * + * @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, worker ID 0 will be selected for
+     * maintenance event simulation. A maintenance event will only be fired on the
+     * first specified worker ID. Future implementations may support firing on
+     * multiple workers.
+     * 
+ * + * repeated string worker_ids = 2; + * + * @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, worker ID 0 will be selected for
+     * maintenance event simulation. A maintenance event will only be fired on the
+     * first specified worker ID. Future implementations may support firing on
+     * multiple workers.
+     * 
+ * + * repeated string worker_ids = 2; + * + * @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.SimulateMaintenanceEventRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest) + private static final com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest(); + } + + public static com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SimulateMaintenanceEventRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SimulateMaintenanceEventRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SimulateMaintenanceEventRequestOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SimulateMaintenanceEventRequestOrBuilder.java new file mode 100644 index 000000000000..f2d12a2d72ea --- /dev/null +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/SimulateMaintenanceEventRequestOrBuilder.java @@ -0,0 +1,117 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/tpu/v2alpha1/cloud_tpu.proto + +package com.google.cloud.tpu.v2alpha1; + +public interface SimulateMaintenanceEventRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest) + 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 0-based worker ID. If it is empty, worker ID 0 will be selected for
+   * maintenance event simulation. A maintenance event will only be fired on the
+   * first specified worker ID. Future implementations may support firing on
+   * multiple workers.
+   * 
+ * + * repeated string worker_ids = 2; + * + * @return A list containing the workerIds. + */ + java.util.List getWorkerIdsList(); + /** + * + * + *
+   * The 0-based worker ID. If it is empty, worker ID 0 will be selected for
+   * maintenance event simulation. A maintenance event will only be fired on the
+   * first specified worker ID. Future implementations may support firing on
+   * multiple workers.
+   * 
+ * + * repeated string worker_ids = 2; + * + * @return The count of workerIds. + */ + int getWorkerIdsCount(); + /** + * + * + *
+   * The 0-based worker ID. If it is empty, worker ID 0 will be selected for
+   * maintenance event simulation. A maintenance event will only be fired on the
+   * first specified worker ID. Future implementations may support firing on
+   * multiple workers.
+   * 
+ * + * repeated string worker_ids = 2; + * + * @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, worker ID 0 will be selected for
+   * maintenance event simulation. A maintenance event will only be fired on the
+   * first specified worker ID. Future implementations may support firing on
+   * multiple workers.
+   * 
+ * + * repeated string worker_ids = 2; + * + * @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/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StartNodeRequest.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StartNodeRequest.java index a4d6b55275da..4736158d8da4 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StartNodeRequest.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StartNodeRequest.java @@ -73,10 +73,12 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * The resource name.
+   * Required. The resource name.
    * 
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The name. */ @@ -96,10 +98,12 @@ public java.lang.String getName() { * * *
-   * The resource name.
+   * Required. The resource name.
    * 
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for name. */ @@ -450,10 +454,12 @@ public Builder mergeFrom( * * *
-     * The resource name.
+     * Required. The resource name.
      * 
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The name. */ @@ -472,10 +478,12 @@ public java.lang.String getName() { * * *
-     * The resource name.
+     * Required. The resource name.
      * 
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for name. */ @@ -494,10 +502,12 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * The resource name.
+     * Required. The resource name.
      * 
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @param value The name to set. * @return This builder for chaining. @@ -515,10 +525,12 @@ public Builder setName(java.lang.String value) { * * *
-     * The resource name.
+     * Required. The resource name.
      * 
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return This builder for chaining. */ @@ -532,10 +544,12 @@ public Builder clearName() { * * *
-     * The resource name.
+     * Required. The resource name.
      * 
* - * string name = 1; + * + * 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. diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StartNodeRequestOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StartNodeRequestOrBuilder.java index 4621b0d678b8..dd57e32134c3 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StartNodeRequestOrBuilder.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StartNodeRequestOrBuilder.java @@ -27,10 +27,12 @@ public interface StartNodeRequestOrBuilder * * *
-   * The resource name.
+   * Required. The resource name.
    * 
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The name. */ @@ -39,10 +41,12 @@ public interface StartNodeRequestOrBuilder * * *
-   * The resource name.
+   * Required. The resource name.
    * 
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for name. */ diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StopNodeRequest.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StopNodeRequest.java index 4f4701cbe48d..8f1cb269d416 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StopNodeRequest.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StopNodeRequest.java @@ -73,10 +73,12 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * The resource name.
+   * Required. The resource name.
    * 
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The name. */ @@ -96,10 +98,12 @@ public java.lang.String getName() { * * *
-   * The resource name.
+   * Required. The resource name.
    * 
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for name. */ @@ -450,10 +454,12 @@ public Builder mergeFrom( * * *
-     * The resource name.
+     * Required. The resource name.
      * 
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The name. */ @@ -472,10 +478,12 @@ public java.lang.String getName() { * * *
-     * The resource name.
+     * Required. The resource name.
      * 
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for name. */ @@ -494,10 +502,12 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * The resource name.
+     * Required. The resource name.
      * 
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @param value The name to set. * @return This builder for chaining. @@ -515,10 +525,12 @@ public Builder setName(java.lang.String value) { * * *
-     * The resource name.
+     * Required. The resource name.
      * 
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return This builder for chaining. */ @@ -532,10 +544,12 @@ public Builder clearName() { * * *
-     * The resource name.
+     * Required. The resource name.
      * 
* - * string name = 1; + * + * 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. diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StopNodeRequestOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StopNodeRequestOrBuilder.java index 84b166f5ba99..bda150b96734 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StopNodeRequestOrBuilder.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/StopNodeRequestOrBuilder.java @@ -27,10 +27,12 @@ public interface StopNodeRequestOrBuilder * * *
-   * The resource name.
+   * Required. The resource name.
    * 
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The name. */ @@ -39,10 +41,12 @@ public interface StopNodeRequestOrBuilder * * *
-   * The resource name.
+   * Required. The resource name.
    * 
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for name. */ diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequest.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequest.java index d44d082717b9..d00ad88cbfa9 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequest.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequest.java @@ -72,7 +72,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
    * Required. Mask of fields from [Node][Tpu.Node] to update.
-   * Supported fields: None.
+   * Supported fields: [description, tags, labels, metadata,
+   * network_config.enable_external_ips].
    * 
* * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -89,7 +90,8 @@ public boolean hasUpdateMask() { * *
    * Required. Mask of fields from [Node][Tpu.Node] to update.
-   * Supported fields: None.
+   * Supported fields: [description, tags, labels, metadata,
+   * network_config.enable_external_ips].
    * 
* * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -106,7 +108,8 @@ public com.google.protobuf.FieldMask getUpdateMask() { * *
    * Required. Mask of fields from [Node][Tpu.Node] to update.
-   * Supported fields: None.
+   * Supported fields: [description, tags, labels, metadata,
+   * network_config.enable_external_ips].
    * 
* * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -553,7 +556,8 @@ public Builder mergeFrom( * *
      * Required. Mask of fields from [Node][Tpu.Node] to update.
-     * Supported fields: None.
+     * Supported fields: [description, tags, labels, metadata,
+     * network_config.enable_external_ips].
      * 
* * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -569,7 +573,8 @@ public boolean hasUpdateMask() { * *
      * Required. Mask of fields from [Node][Tpu.Node] to update.
-     * Supported fields: None.
+     * Supported fields: [description, tags, labels, metadata,
+     * network_config.enable_external_ips].
      * 
* * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -591,7 +596,8 @@ public com.google.protobuf.FieldMask getUpdateMask() { * *
      * Required. Mask of fields from [Node][Tpu.Node] to update.
-     * Supported fields: None.
+     * Supported fields: [description, tags, labels, metadata,
+     * network_config.enable_external_ips].
      * 
* * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -615,7 +621,8 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { * *
      * Required. Mask of fields from [Node][Tpu.Node] to update.
-     * Supported fields: None.
+     * Supported fields: [description, tags, labels, metadata,
+     * network_config.enable_external_ips].
      * 
* * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -636,7 +643,8 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForVal * *
      * Required. Mask of fields from [Node][Tpu.Node] to update.
-     * Supported fields: None.
+     * Supported fields: [description, tags, labels, metadata,
+     * network_config.enable_external_ips].
      * 
* * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -662,7 +670,8 @@ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { * *
      * Required. Mask of fields from [Node][Tpu.Node] to update.
-     * Supported fields: None.
+     * Supported fields: [description, tags, labels, metadata,
+     * network_config.enable_external_ips].
      * 
* * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -684,7 +693,8 @@ public Builder clearUpdateMask() { * *
      * Required. Mask of fields from [Node][Tpu.Node] to update.
-     * Supported fields: None.
+     * Supported fields: [description, tags, labels, metadata,
+     * network_config.enable_external_ips].
      * 
* * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -700,7 +710,8 @@ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { * *
      * Required. Mask of fields from [Node][Tpu.Node] to update.
-     * Supported fields: None.
+     * Supported fields: [description, tags, labels, metadata,
+     * network_config.enable_external_ips].
      * 
* * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -720,7 +731,8 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { * *
      * Required. Mask of fields from [Node][Tpu.Node] to update.
-     * Supported fields: None.
+     * Supported fields: [description, tags, labels, metadata,
+     * network_config.enable_external_ips].
      * 
* * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequestOrBuilder.java b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequestOrBuilder.java index 8a0ec26a4e6f..f60b96550aad 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequestOrBuilder.java +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/java/com/google/cloud/tpu/v2alpha1/UpdateNodeRequestOrBuilder.java @@ -28,7 +28,8 @@ public interface UpdateNodeRequestOrBuilder * *
    * Required. Mask of fields from [Node][Tpu.Node] to update.
-   * Supported fields: None.
+   * Supported fields: [description, tags, labels, metadata,
+   * network_config.enable_external_ips].
    * 
* * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -42,7 +43,8 @@ public interface UpdateNodeRequestOrBuilder * *
    * Required. Mask of fields from [Node][Tpu.Node] to update.
-   * Supported fields: None.
+   * Supported fields: [description, tags, labels, metadata,
+   * network_config.enable_external_ips].
    * 
* * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -56,7 +58,8 @@ public interface UpdateNodeRequestOrBuilder * *
    * Required. Mask of fields from [Node][Tpu.Node] to update.
-   * Supported fields: None.
+   * Supported fields: [description, tags, labels, metadata,
+   * network_config.enable_external_ips].
    * 
* * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; diff --git a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/proto/google/cloud/tpu/v2alpha1/cloud_tpu.proto b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/proto/google/cloud/tpu/v2alpha1/cloud_tpu.proto index 612e1c4f5ddb..b6f0623b7870 100644 --- a/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/proto/google/cloud/tpu/v2alpha1/cloud_tpu.proto +++ b/java-tpu/proto-google-cloud-tpu-v2alpha1/src/main/proto/google/cloud/tpu/v2alpha1/cloud_tpu.proto @@ -21,8 +21,11 @@ import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/type/interval.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/tpu/v2alpha1;tpu"; option java_multiple_files = true; @@ -34,8 +37,7 @@ option java_package = "com.google.cloud.tpu.v2alpha1"; // 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"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; // Lists nodes. rpc ListNodes(ListNodesRequest) returns (ListNodesResponse) { @@ -73,7 +75,7 @@ service Tpu { }; option (google.api.method_signature) = "name"; option (google.longrunning.operation_info) = { - response_type: "Node" + response_type: "google.protobuf.Empty" metadata_type: "OperationMetadata" }; } @@ -115,9 +117,49 @@ service Tpu { }; } + // Lists queued resources. + rpc ListQueuedResources(ListQueuedResourcesRequest) returns (ListQueuedResourcesResponse) { + option (google.api.http) = { + get: "/v2alpha1/{parent=projects/*/locations/*}/queuedResources" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a queued resource. + rpc GetQueuedResource(GetQueuedResourceRequest) returns (QueuedResource) { + option (google.api.http) = { + get: "/v2alpha1/{name=projects/*/locations/*/queuedResources/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a QueuedResource TPU instance. + rpc CreateQueuedResource(CreateQueuedResourceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2alpha1/{parent=projects/*/locations/*}/queuedResources" + body: "queued_resource" + }; + option (google.api.method_signature) = "parent,queued_resource,queued_resource_id"; + option (google.longrunning.operation_info) = { + response_type: "QueuedResource" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a QueuedResource TPU instance. + rpc DeleteQueuedResource(DeleteQueuedResourceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v2alpha1/{name=projects/*/locations/*/queuedResources/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "QueuedResource" + metadata_type: "OperationMetadata" + }; + } + // Generates the Cloud TPU service identity for the project. - rpc GenerateServiceIdentity(GenerateServiceIdentityRequest) - returns (GenerateServiceIdentityResponse) { + rpc GenerateServiceIdentity(GenerateServiceIdentityRequest) returns (GenerateServiceIdentityResponse) { option (google.api.http) = { post: "/v2alpha1/{parent=projects/*/locations/*}:generateServiceIdentity" body: "*" @@ -125,8 +167,7 @@ service Tpu { } // Lists accelerator types supported by this API. - rpc ListAcceleratorTypes(ListAcceleratorTypesRequest) - returns (ListAcceleratorTypesResponse) { + rpc ListAcceleratorTypes(ListAcceleratorTypesRequest) returns (ListAcceleratorTypesResponse) { option (google.api.http) = { get: "/v2alpha1/{parent=projects/*/locations/*}/acceleratorTypes" }; @@ -142,8 +183,7 @@ service Tpu { } // Lists runtime versions supported by this API. - rpc ListRuntimeVersions(ListRuntimeVersionsRequest) - returns (ListRuntimeVersionsResponse) { + rpc ListRuntimeVersions(ListRuntimeVersionsRequest) returns (ListRuntimeVersionsResponse) { option (google.api.http) = { get: "/v2alpha1/{parent=projects/*/locations/*}/runtimeVersions" }; @@ -159,13 +199,24 @@ service Tpu { } // Retrieves the guest attributes for the node. - rpc GetGuestAttributes(GetGuestAttributesRequest) - returns (GetGuestAttributesResponse) { + rpc GetGuestAttributes(GetGuestAttributesRequest) returns (GetGuestAttributesResponse) { option (google.api.http) = { post: "/v2alpha1/{name=projects/*/locations/*/nodes/*}:getGuestAttributes" body: "*" }; } + + // Simulates a maintenance event. + rpc SimulateMaintenanceEvent(SimulateMaintenanceEventRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2alpha1/{name=projects/*/locations/*/nodes/*}:simulateMaintenanceEvent" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Node" + metadata_type: "OperationMetadata" + }; + } } // A guest attributes. @@ -266,6 +317,11 @@ message NetworkConfig { // workers. If set to false, the specified subnetwork or network should have // Private Google Access enabled. bool enable_external_ips = 3; + + // Allows the TPU node to send and receive packets with non-matching + // destination or source IPs. This is required if you plan to use the TPU + // workers to forward routes. + bool can_ip_forward = 4; } // A service account. @@ -307,7 +363,7 @@ message Node { DELETING = 5; // TPU node is being repaired and may be unusable. Details can be - // found in the `help_description` field. + // found in the 'help_description' field. REPAIRING = 6; // TPU node is stopped. @@ -380,14 +436,14 @@ message Node { // 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]; + // The type of hardware accelerators associated with this node. + string accelerator_type = 5; // 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. + // 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. @@ -411,8 +467,7 @@ message Node { 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]; + google.protobuf.Timestamp create_time = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; // The scheduling options for this node. SchedulingConfig scheduling_config = 17; @@ -420,8 +475,7 @@ message Node { // 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]; + repeated NetworkEndpoint network_endpoints = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; // The health status of the TPU node. Health health = 22; @@ -449,16 +503,241 @@ message Node { // Output only. The Symptoms that have occurred to the TPU Node. repeated Symptom symptoms = 39 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The qualified name of the QueuedResource that requested this Node. + string queued_resource = 43 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Shielded Instance options. ShieldedInstanceConfig shielded_instance_config = 45; } +// A QueuedResource represents a request for resources that will be placed +// in a queue and fulfilled when the necessary resources are available. +message QueuedResource { + option (google.api.resource) = { + type: "tpu.googleapis.com/QueuedResource" + pattern: "projects/{project}/locations/{location}/queuedResources/{queued_resource}" + }; + + // Details of the TPU resource(s) being requested. + message Tpu { + // Details of the TPU node(s) being requested. Users can request either a + // single node or multiple nodes. + // NodeSpec provides the specification for node(s) to be created. + message NodeSpec { + // 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. Should follow the ^[A-Za-z0-9_.~+%-]+$ + // regex format. This is only specified when requesting a single node. + // In case of multi-node requests, multi_node_params must be populated + // instead. It's an error to specify both node_id and multi_node_params. + string node_id = 2; + + // Required. The node. + Node node = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // The TPU node(s) being requested. + repeated NodeSpec node_spec = 1; + } + + // BestEffort tier definition. + message BestEffort { + + } + + // Guaranteed tier definition. + message Guaranteed { + // Optional. Defines the minimum duration of the guarantee. If specified, + // the requested resources will only be provisioned if they can be + // allocated for at least the given duration. + google.protobuf.Duration min_duration = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the request should be scheduled on reserved capacity. + bool reserved = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Defines the policy of the QueuedRequest. + message QueueingPolicy { + // Time flexibility specification. + oneof start_timing_constraints { + // A relative time after which resources should not be created. + // If the request cannot be fulfilled by this time the request will be + // failed. + google.protobuf.Duration valid_until_duration = 1; + + // An absolute time after which resources should not be created. + // If the request cannot be fulfilled by this time the request will be + // failed. + google.protobuf.Timestamp valid_until_time = 2; + + // A relative time after which resources may be created. + google.protobuf.Duration valid_after_duration = 3; + + // An absolute time at which resources may be created. + google.protobuf.Timestamp valid_after_time = 4; + + // An absolute time interval within which resources may be created. + google.type.Interval valid_interval = 5; + } + } + + // Output only. Immutable. The name of the QueuedResource. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Resource specification. + oneof resource { + // Defines a TPU resource. + Tpu tpu = 2; + } + + // Tier specifies the required tier. + oneof tier { + // The BestEffort tier. + BestEffort best_effort = 3; + + // The Guaranteed tier + Guaranteed guaranteed = 4; + } + + // The queueing policy of the QueuedRequest. + QueueingPolicy queueing_policy = 5; + + // Output only. State of the QueuedResource request + QueuedResourceState state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// QueuedResourceState defines the details of the QueuedResource request. +message QueuedResourceState { + // Output only state of the request + enum State { + // State of the QueuedResource request is not known/set. + STATE_UNSPECIFIED = 0; + + // The QueuedResource request has been received. We're still working on + // determining if we will be able to honor this request. + CREATING = 1; + + // The QueuedResource request has passed initial validation/admission + // control and has been persisted in the queue. + ACCEPTED = 2; + + // The QueuedResource request has been selected. The + // associated resources are currently being provisioned (or very soon + // will begin provisioning). + PROVISIONING = 3; + + // The request could not be completed. This may be due to some + // late-discovered problem with the request itself, or due to + // unavailability of resources within the constraints of the request + // (e.g., the 'valid until' start timing constraint expired). + FAILED = 4; + + // The QueuedResource is being deleted. + DELETING = 5; + + // The resources specified in the QueuedResource request have been + // provisioned and are ready for use by the end-user/consumer. + ACTIVE = 6; + + // The resources specified in the QueuedResource request are being + // deleted. This may have been initiated by the user, or + // the Cloud TPU service. Inspect the state data for more details. + SUSPENDING = 7; + + // The resources specified in the QueuedResource request have been + // deleted. + SUSPENDED = 8; + } + + // Further data for the creating state. + message CreatingData { + + } + + // Further data for the accepted state. + message AcceptedData { + + } + + // Further data for the provisioning state. + message ProvisioningData { + + } + + // Further data for the failed state. + message FailedData { + // The error that caused the queued resource to enter the FAILED state. + google.rpc.Status error = 1; + } + + // Further data for the deleting state. + message DeletingData { + + } + + // Further data for the active state. + message ActiveData { + + } + + // Further data for the suspending state. + message SuspendingData { + + } + + // Further data for the suspended state. + message SuspendedData { + + } + + // State of the QueuedResource request. + State state = 1; + + // Further data for the state. + oneof state_data { + // Further data for the creating state. + CreatingData creating_data = 2; + + // Further data for the accepted state. + AcceptedData accepted_data = 3; + + // Further data for the provisioning state. + ProvisioningData provisioning_data = 4; + + // Further data for the failed state. + FailedData failed_data = 5; + + // Further data for the deleting state. + DeletingData deleting_data = 6; + + // Further data for the active state. + ActiveData active_data = 7; + + // Further data for the suspending state. + SuspendingData suspending_data = 8; + + // Further data for the suspended state. + SuspendedData suspended_data = 9; + } +} + // 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" } + (google.api.resource_reference) = { + child_type: "tpu.googleapis.com/Node" + } ]; // The maximum number of items to return. @@ -485,7 +764,9 @@ message GetNodeRequest { // Required. The resource name. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "tpu.googleapis.com/Node" } + (google.api.resource_reference) = { + type: "tpu.googleapis.com/Node" + } ]; } @@ -504,6 +785,9 @@ message CreateNodeRequest { // Required. The node. Node node = 3 [(google.api.field_behavior) = REQUIRED]; + + // Idempotent request UUID. + string request_id = 6; } // Request for [DeleteNode][google.cloud.tpu.v2alpha1.Tpu.DeleteNode]. @@ -511,41 +795,130 @@ message DeleteNodeRequest { // Required. The resource name. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "tpu.googleapis.com/Node" } + (google.api.resource_reference) = { + type: "tpu.googleapis.com/Node" + } ]; + + // Idempotent request UUID. + string request_id = 3; } // Request for [StopNode][google.cloud.tpu.v2alpha1.Tpu.StopNode]. message StopNodeRequest { - // The resource name. - string name = 1; + // Required. The resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "tpu.googleapis.com/Node" + } + ]; } // Request for [StartNode][google.cloud.tpu.v2alpha1.Tpu.StartNode]. message StartNodeRequest { - // The resource name. - string name = 1; + // Required. The resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "tpu.googleapis.com/Node" + } + ]; } // 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]; + // Supported fields: [description, tags, labels, metadata, + // network_config.enable_external_ips]. + 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]; } +// Request for [ListQueuedResources][google.cloud.tpu.v2alpha1.Tpu.ListQueuedResources]. +message ListQueuedResourcesRequest { + // Required. The parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "tpu.googleapis.com/QueuedResource" + } + ]; + + // 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 [ListQueuedResources][google.cloud.tpu.v2alpha1.Tpu.ListQueuedResources]. +message ListQueuedResourcesResponse { + // The listed queued resources. + repeated QueuedResource queued_resources = 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 [GetQueuedResource][google.cloud.tpu.v2alpha1.Tpu.GetQueuedResource] +message GetQueuedResourceRequest { + // Required. The resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "tpu.googleapis.com/QueuedResource" + } + ]; +} + +// Request for [CreateQueuedResource][google.cloud.tpu.v2alpha1.Tpu.CreateQueuedResource]. +message CreateQueuedResourceRequest { + // 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. Should follow the ^[A-Za-z0-9_.~+%-]+$ + // regex format. + string queued_resource_id = 2; + + // Required. The queued resource. + QueuedResource queued_resource = 3 [(google.api.field_behavior) = REQUIRED]; + + // Idempotent request UUID. + string request_id = 4; +} + +// Request for [DeleteQueuedResource][google.cloud.tpu.v2alpha1.Tpu.DeleteQueuedResource]. +message DeleteQueuedResourceRequest { + // Required. The resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "tpu.googleapis.com/QueuedResource" + } + ]; + + // Idempotent request UUID. + string request_id = 2; +} + // 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]. +// Request for [GenerateServiceIdentity][google.cloud.tpu.v2alpha1.Tpu.GenerateServiceIdentity]. message GenerateServiceIdentityRequest { // Required. The parent resource name. string parent = 1 [ @@ -556,8 +929,7 @@ message GenerateServiceIdentityRequest { ]; } -// Response for -// [GenerateServiceIdentity][google.cloud.tpu.v2alpha1.Tpu.GenerateServiceIdentity]. +// Response for [GenerateServiceIdentity][google.cloud.tpu.v2alpha1.Tpu.GenerateServiceIdentity]. message GenerateServiceIdentityResponse { // ServiceIdentity that was created or retrieved. ServiceIdentity identity = 1; @@ -573,12 +945,11 @@ message AcceleratorType { // The resource name. string name = 1; - // the accelerator type. + // The accelerator type. string type = 2; } -// Request for -// [GetAcceleratorType][google.cloud.tpu.v2alpha1.Tpu.GetAcceleratorType]. +// Request for [GetAcceleratorType][google.cloud.tpu.v2alpha1.Tpu.GetAcceleratorType]. message GetAcceleratorTypeRequest { // Required. The resource name. string name = 1 [ @@ -589,14 +960,13 @@ message GetAcceleratorTypeRequest { ]; } -// Request for -// [ListAcceleratorTypes][google.cloud.tpu.v2alpha1.Tpu.ListAcceleratorTypes]. +// 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" + child_type: "tpu.googleapis.com/AcceleratorType" } ]; @@ -613,8 +983,7 @@ message ListAcceleratorTypesRequest { string order_by = 6; } -// Response for -// [ListAcceleratorTypes][google.cloud.tpu.v2alpha1.Tpu.ListAcceleratorTypes]. +// Response for [ListAcceleratorTypes][google.cloud.tpu.v2alpha1.Tpu.ListAcceleratorTypes]. message ListAcceleratorTypesResponse { // The listed nodes. repeated AcceleratorType accelerator_types = 1; @@ -626,36 +995,6 @@ message ListAcceleratorTypesResponse { 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) = { @@ -670,8 +1009,7 @@ message RuntimeVersion { string version = 2; } -// Request for -// [GetRuntimeVersion][google.cloud.tpu.v2alpha1.Tpu.GetRuntimeVersion]. +// Request for [GetRuntimeVersion][google.cloud.tpu.v2alpha1.Tpu.GetRuntimeVersion]. message GetRuntimeVersionRequest { // Required. The resource name. string name = 1 [ @@ -682,14 +1020,13 @@ message GetRuntimeVersionRequest { ]; } -// Request for -// [ListRuntimeVersions][google.cloud.tpu.v2alpha1.Tpu.ListRuntimeVersions]. +// 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" + child_type: "tpu.googleapis.com/RuntimeVersion" } ]; @@ -706,8 +1043,7 @@ message ListRuntimeVersionsRequest { string order_by = 6; } -// Response for -// [ListRuntimeVersions][google.cloud.tpu.v2alpha1.Tpu.ListRuntimeVersions]. +// Response for [ListRuntimeVersions][google.cloud.tpu.v2alpha1.Tpu.ListRuntimeVersions]. message ListRuntimeVersionsResponse { // The listed nodes. repeated RuntimeVersion runtime_versions = 1; @@ -719,6 +1055,31 @@ message ListRuntimeVersionsResponse { repeated string unreachable = 3; } +// 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 @@ -760,13 +1121,14 @@ message Symptom { string worker_id = 4; } -// Request for -// [GetGuestAttributes][google.cloud.tpu.v2alpha1.Tpu.GetGuestAttributes]. +// 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" } + (google.api.resource_reference) = { + type: "tpu.googleapis.com/Node" + } ]; // The guest attributes path to be queried. @@ -777,15 +1139,31 @@ message GetGuestAttributesRequest { repeated string worker_ids = 3; } -// Response for -// [GetGuestAttributes][google.cloud.tpu.v2alpha1.Tpu.GetGuestAttributes]. +// Response for [GetGuestAttributes][google.cloud.tpu.v2alpha1.Tpu.GetGuestAttributes]. message GetGuestAttributesResponse { // The guest attributes for the TPU workers. repeated GuestAttributes guest_attributes = 1; } +// Request for [SimulateMaintenanceEvent][google.cloud.tpu.v2alpha1.Tpu.SimulateMaintenanceEvent]. +message SimulateMaintenanceEventRequest { + // Required. The resource name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "tpu.googleapis.com/Node" + } + ]; + + // The 0-based worker ID. If it is empty, worker ID 0 will be selected for + // maintenance event simulation. A maintenance event will only be fired on the + // first specified worker ID. Future implementations may support firing on + // multiple workers. + repeated string worker_ids = 2; +} + // 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/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v1/tpu/getlocation/AsyncGetLocation.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v1/tpu/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..75b9a8122eb3 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v1/tpu/getlocation/AsyncGetLocation.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_Tpu_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.tpu.v1.TpuClient; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() 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()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = tpuClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END tpu_v1_generated_Tpu_GetLocation_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v1/tpu/getlocation/SyncGetLocation.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v1/tpu/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..1fc3334bd933 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v1/tpu/getlocation/SyncGetLocation.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_Tpu_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() 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()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = tpuClient.getLocation(request); + } + } +} +// [END tpu_v1_generated_Tpu_GetLocation_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v1/tpu/listlocations/AsyncListLocations.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v1/tpu/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..4ceb422a0a3f --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v1/tpu/listlocations/AsyncListLocations.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_Tpu_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.tpu.v1.TpuClient; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() 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()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = tpuClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v1_generated_Tpu_ListLocations_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v1/tpu/listlocations/AsyncListLocationsPaged.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v1/tpu/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..64fb6786e514 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v1/tpu/listlocations/AsyncListLocationsPaged.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_Tpu_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.tpu.v1.TpuClient; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() 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()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = tpuClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END tpu_v1_generated_Tpu_ListLocations_Paged_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v1/tpu/listlocations/SyncListLocations.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v1/tpu/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..30dfe1cf6dcb --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v1/tpu/listlocations/SyncListLocations.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_Tpu_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.tpu.v1.TpuClient; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() 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()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : tpuClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v1_generated_Tpu_ListLocations_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/stub/tpustubsettings/getnode/SyncGetNode.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/stub/tpustubsettings/getnode/SyncGetNode.java new file mode 100644 index 000000000000..925423c230cd --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/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.v2.stub.samples; + +// [START tpu_v2_generated_TpuStubSettings_GetNode_sync] +import com.google.cloud.tpu.v2.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_v2_generated_TpuStubSettings_GetNode_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/create/SyncCreateSetCredentialsProvider.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..8afccd8c9c25 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.tpu.v2.TpuClient; +import com.google.cloud.tpu.v2.TpuSettings; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_Create_SetCredentialsProvider_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/create/SyncCreateSetCredentialsProvider1.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..6c734cb6e053 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,39 @@ +/* + * 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.v2.samples; + +// [START tpu_v2_generated_Tpu_Create_SetCredentialsProvider1_sync] +import com.google.cloud.tpu.v2.TpuClient; +import com.google.cloud.tpu.v2.TpuSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() 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.newHttpJsonBuilder().build(); + TpuClient tpuClient = TpuClient.create(tpuSettings); + } +} +// [END tpu_v2_generated_Tpu_Create_SetCredentialsProvider1_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/create/SyncCreateSetEndpoint.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..7028445dd422 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_Create_SetEndpoint_sync] +import com.google.cloud.tpu.v2.TpuClient; +import com.google.cloud.tpu.v2.TpuSettings; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_Create_SetEndpoint_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/createnode/AsyncCreateNode.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/createnode/AsyncCreateNode.java new file mode 100644 index 000000000000..967e53af6d71 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_CreateNode_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2.CreateNodeRequest; +import com.google.cloud.tpu.v2.LocationName; +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_CreateNode_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/createnode/AsyncCreateNodeLRO.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/createnode/AsyncCreateNodeLRO.java new file mode 100644 index 000000000000..f773b9507e68 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_CreateNode_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.tpu.v2.CreateNodeRequest; +import com.google.cloud.tpu.v2.LocationName; +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.OperationMetadata; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_CreateNode_LRO_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/createnode/SyncCreateNode.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/createnode/SyncCreateNode.java new file mode 100644 index 000000000000..95f3a9121a7f --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_CreateNode_sync] +import com.google.cloud.tpu.v2.CreateNodeRequest; +import com.google.cloud.tpu.v2.LocationName; +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_CreateNode_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/createnode/SyncCreateNodeLocationnameNodeString.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/createnode/SyncCreateNodeLocationnameNodeString.java new file mode 100644 index 000000000000..db38aac335e0 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_CreateNode_LocationnameNodeString_sync] +import com.google.cloud.tpu.v2.LocationName; +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_CreateNode_LocationnameNodeString_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/createnode/SyncCreateNodeStringNodeString.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/createnode/SyncCreateNodeStringNodeString.java new file mode 100644 index 000000000000..0254e9c47f00 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_CreateNode_StringNodeString_sync] +import com.google.cloud.tpu.v2.LocationName; +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_CreateNode_StringNodeString_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/deletenode/AsyncDeleteNode.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/deletenode/AsyncDeleteNode.java new file mode 100644 index 000000000000..8b7bd3f317d8 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_DeleteNode_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2.DeleteNodeRequest; +import com.google.cloud.tpu.v2.NodeName; +import com.google.cloud.tpu.v2.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. + future.get(); + } + } +} +// [END tpu_v2_generated_Tpu_DeleteNode_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/deletenode/AsyncDeleteNodeLRO.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/deletenode/AsyncDeleteNodeLRO.java new file mode 100644 index 000000000000..0a3cfda3c611 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_DeleteNode_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.tpu.v2.DeleteNodeRequest; +import com.google.cloud.tpu.v2.NodeName; +import com.google.cloud.tpu.v2.OperationMetadata; +import com.google.cloud.tpu.v2.TpuClient; +import com.google.protobuf.Empty; + +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. + future.get(); + } + } +} +// [END tpu_v2_generated_Tpu_DeleteNode_LRO_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/deletenode/SyncDeleteNode.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/deletenode/SyncDeleteNode.java new file mode 100644 index 000000000000..dde60561c84f --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_DeleteNode_sync] +import com.google.cloud.tpu.v2.DeleteNodeRequest; +import com.google.cloud.tpu.v2.NodeName; +import com.google.cloud.tpu.v2.TpuClient; +import com.google.protobuf.Empty; + +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(); + tpuClient.deleteNodeAsync(request).get(); + } + } +} +// [END tpu_v2_generated_Tpu_DeleteNode_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/deletenode/SyncDeleteNodeNodename.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/deletenode/SyncDeleteNodeNodename.java new file mode 100644 index 000000000000..c65ef17c74d5 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_DeleteNode_Nodename_sync] +import com.google.cloud.tpu.v2.NodeName; +import com.google.cloud.tpu.v2.TpuClient; +import com.google.protobuf.Empty; + +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]"); + tpuClient.deleteNodeAsync(name).get(); + } + } +} +// [END tpu_v2_generated_Tpu_DeleteNode_Nodename_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/deletenode/SyncDeleteNodeString.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/deletenode/SyncDeleteNodeString.java new file mode 100644 index 000000000000..4da05cb647b4 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_DeleteNode_String_sync] +import com.google.cloud.tpu.v2.NodeName; +import com.google.cloud.tpu.v2.TpuClient; +import com.google.protobuf.Empty; + +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(); + tpuClient.deleteNodeAsync(name).get(); + } + } +} +// [END tpu_v2_generated_Tpu_DeleteNode_String_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/generateserviceidentity/AsyncGenerateServiceIdentity.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/generateserviceidentity/AsyncGenerateServiceIdentity.java new file mode 100644 index 000000000000..1405b83ff675 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_GenerateServiceIdentity_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2.GenerateServiceIdentityRequest; +import com.google.cloud.tpu.v2.GenerateServiceIdentityResponse; +import com.google.cloud.tpu.v2.LocationName; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_GenerateServiceIdentity_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/generateserviceidentity/SyncGenerateServiceIdentity.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/generateserviceidentity/SyncGenerateServiceIdentity.java new file mode 100644 index 000000000000..ae8fdf7aded9 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_GenerateServiceIdentity_sync] +import com.google.cloud.tpu.v2.GenerateServiceIdentityRequest; +import com.google.cloud.tpu.v2.GenerateServiceIdentityResponse; +import com.google.cloud.tpu.v2.LocationName; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_GenerateServiceIdentity_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getacceleratortype/AsyncGetAcceleratorType.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getacceleratortype/AsyncGetAcceleratorType.java new file mode 100644 index 000000000000..0ce384cb544b --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_GetAcceleratorType_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2.AcceleratorType; +import com.google.cloud.tpu.v2.AcceleratorTypeName; +import com.google.cloud.tpu.v2.GetAcceleratorTypeRequest; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_GetAcceleratorType_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getacceleratortype/SyncGetAcceleratorType.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getacceleratortype/SyncGetAcceleratorType.java new file mode 100644 index 000000000000..50c0dbf1ec34 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_GetAcceleratorType_sync] +import com.google.cloud.tpu.v2.AcceleratorType; +import com.google.cloud.tpu.v2.AcceleratorTypeName; +import com.google.cloud.tpu.v2.GetAcceleratorTypeRequest; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_GetAcceleratorType_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getacceleratortype/SyncGetAcceleratorTypeAcceleratortypename.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getacceleratortype/SyncGetAcceleratorTypeAcceleratortypename.java new file mode 100644 index 000000000000..89c8b0e37c7e --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_GetAcceleratorType_Acceleratortypename_sync] +import com.google.cloud.tpu.v2.AcceleratorType; +import com.google.cloud.tpu.v2.AcceleratorTypeName; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_GetAcceleratorType_Acceleratortypename_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getacceleratortype/SyncGetAcceleratorTypeString.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getacceleratortype/SyncGetAcceleratorTypeString.java new file mode 100644 index 000000000000..5934d2cceed6 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_GetAcceleratorType_String_sync] +import com.google.cloud.tpu.v2.AcceleratorType; +import com.google.cloud.tpu.v2.AcceleratorTypeName; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_GetAcceleratorType_String_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getguestattributes/AsyncGetGuestAttributes.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getguestattributes/AsyncGetGuestAttributes.java new file mode 100644 index 000000000000..1bce176f1ba7 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_GetGuestAttributes_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2.GetGuestAttributesRequest; +import com.google.cloud.tpu.v2.GetGuestAttributesResponse; +import com.google.cloud.tpu.v2.NodeName; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_GetGuestAttributes_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getguestattributes/SyncGetGuestAttributes.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getguestattributes/SyncGetGuestAttributes.java new file mode 100644 index 000000000000..7c31c6bb798a --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_GetGuestAttributes_sync] +import com.google.cloud.tpu.v2.GetGuestAttributesRequest; +import com.google.cloud.tpu.v2.GetGuestAttributesResponse; +import com.google.cloud.tpu.v2.NodeName; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_GetGuestAttributes_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getlocation/AsyncGetLocation.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..2c7b1cffd8c1 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getlocation/AsyncGetLocation.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.v2.samples; + +// [START tpu_v2_generated_Tpu_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.tpu.v2.TpuClient; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() 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()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = tpuClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END tpu_v2_generated_Tpu_GetLocation_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getlocation/SyncGetLocation.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..57ae91067837 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getlocation/SyncGetLocation.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.v2.samples; + +// [START tpu_v2_generated_Tpu_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.tpu.v2.TpuClient; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() 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()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = tpuClient.getLocation(request); + } + } +} +// [END tpu_v2_generated_Tpu_GetLocation_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getnode/AsyncGetNode.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getnode/AsyncGetNode.java new file mode 100644 index 000000000000..c95ea658fe3d --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_GetNode_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2.GetNodeRequest; +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.NodeName; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_GetNode_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getnode/SyncGetNode.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getnode/SyncGetNode.java new file mode 100644 index 000000000000..613ec74ff463 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_GetNode_sync] +import com.google.cloud.tpu.v2.GetNodeRequest; +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.NodeName; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_GetNode_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getnode/SyncGetNodeNodename.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getnode/SyncGetNodeNodename.java new file mode 100644 index 000000000000..5d54c71fb4d1 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_GetNode_Nodename_sync] +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.NodeName; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_GetNode_Nodename_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getnode/SyncGetNodeString.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getnode/SyncGetNodeString.java new file mode 100644 index 000000000000..cb28eec38200 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_GetNode_String_sync] +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.NodeName; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_GetNode_String_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getruntimeversion/AsyncGetRuntimeVersion.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getruntimeversion/AsyncGetRuntimeVersion.java new file mode 100644 index 000000000000..bd17c04490a7 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_GetRuntimeVersion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2.GetRuntimeVersionRequest; +import com.google.cloud.tpu.v2.RuntimeVersion; +import com.google.cloud.tpu.v2.RuntimeVersionName; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_GetRuntimeVersion_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getruntimeversion/SyncGetRuntimeVersion.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getruntimeversion/SyncGetRuntimeVersion.java new file mode 100644 index 000000000000..d3b4cbf79cd6 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_GetRuntimeVersion_sync] +import com.google.cloud.tpu.v2.GetRuntimeVersionRequest; +import com.google.cloud.tpu.v2.RuntimeVersion; +import com.google.cloud.tpu.v2.RuntimeVersionName; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_GetRuntimeVersion_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getruntimeversion/SyncGetRuntimeVersionRuntimeversionname.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getruntimeversion/SyncGetRuntimeVersionRuntimeversionname.java new file mode 100644 index 000000000000..bb9536e1e2a5 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_GetRuntimeVersion_Runtimeversionname_sync] +import com.google.cloud.tpu.v2.RuntimeVersion; +import com.google.cloud.tpu.v2.RuntimeVersionName; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_GetRuntimeVersion_Runtimeversionname_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getruntimeversion/SyncGetRuntimeVersionString.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/getruntimeversion/SyncGetRuntimeVersionString.java new file mode 100644 index 000000000000..b5eee77a8908 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_GetRuntimeVersion_String_sync] +import com.google.cloud.tpu.v2.RuntimeVersion; +import com.google.cloud.tpu.v2.RuntimeVersionName; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_GetRuntimeVersion_String_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listacceleratortypes/AsyncListAcceleratorTypes.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listacceleratortypes/AsyncListAcceleratorTypes.java new file mode 100644 index 000000000000..38691c4a6bd0 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listacceleratortypes/AsyncListAcceleratorTypes.java @@ -0,0 +1,56 @@ +/* + * 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.v2.samples; + +// [START tpu_v2_generated_Tpu_ListAcceleratorTypes_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2.AcceleratorType; +import com.google.cloud.tpu.v2.ListAcceleratorTypesRequest; +import com.google.cloud.tpu.v2.LocationName; +import com.google.cloud.tpu.v2.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(LocationName.of("[PROJECT]", "[LOCATION]").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_v2_generated_Tpu_ListAcceleratorTypes_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listacceleratortypes/AsyncListAcceleratorTypesPaged.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listacceleratortypes/AsyncListAcceleratorTypesPaged.java new file mode 100644 index 000000000000..3be7cf72751c --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listacceleratortypes/AsyncListAcceleratorTypesPaged.java @@ -0,0 +1,64 @@ +/* + * 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.v2.samples; + +// [START tpu_v2_generated_Tpu_ListAcceleratorTypes_Paged_async] +import com.google.cloud.tpu.v2.AcceleratorType; +import com.google.cloud.tpu.v2.ListAcceleratorTypesRequest; +import com.google.cloud.tpu.v2.ListAcceleratorTypesResponse; +import com.google.cloud.tpu.v2.LocationName; +import com.google.cloud.tpu.v2.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(LocationName.of("[PROJECT]", "[LOCATION]").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_v2_generated_Tpu_ListAcceleratorTypes_Paged_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listacceleratortypes/SyncListAcceleratorTypes.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listacceleratortypes/SyncListAcceleratorTypes.java new file mode 100644 index 000000000000..7be3443f6f47 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listacceleratortypes/SyncListAcceleratorTypes.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.v2.samples; + +// [START tpu_v2_generated_Tpu_ListAcceleratorTypes_sync] +import com.google.cloud.tpu.v2.AcceleratorType; +import com.google.cloud.tpu.v2.ListAcceleratorTypesRequest; +import com.google.cloud.tpu.v2.LocationName; +import com.google.cloud.tpu.v2.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(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (AcceleratorType element : tpuClient.listAcceleratorTypes(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v2_generated_Tpu_ListAcceleratorTypes_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listacceleratortypes/SyncListAcceleratorTypesLocationname.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listacceleratortypes/SyncListAcceleratorTypesLocationname.java new file mode 100644 index 000000000000..cba03bb0e6b2 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listacceleratortypes/SyncListAcceleratorTypesLocationname.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.v2.samples; + +// [START tpu_v2_generated_Tpu_ListAcceleratorTypes_Locationname_sync] +import com.google.cloud.tpu.v2.AcceleratorType; +import com.google.cloud.tpu.v2.LocationName; +import com.google.cloud.tpu.v2.TpuClient; + +public class SyncListAcceleratorTypesLocationname { + + public static void main(String[] args) throws Exception { + syncListAcceleratorTypesLocationname(); + } + + public static void syncListAcceleratorTypesLocationname() 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 (AcceleratorType element : tpuClient.listAcceleratorTypes(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v2_generated_Tpu_ListAcceleratorTypes_Locationname_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listacceleratortypes/SyncListAcceleratorTypesString.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listacceleratortypes/SyncListAcceleratorTypesString.java new file mode 100644 index 000000000000..948b7d29eea9 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listacceleratortypes/SyncListAcceleratorTypesString.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.v2.samples; + +// [START tpu_v2_generated_Tpu_ListAcceleratorTypes_String_sync] +import com.google.cloud.tpu.v2.AcceleratorType; +import com.google.cloud.tpu.v2.LocationName; +import com.google.cloud.tpu.v2.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 = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (AcceleratorType element : tpuClient.listAcceleratorTypes(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v2_generated_Tpu_ListAcceleratorTypes_String_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listlocations/AsyncListLocations.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..e7db43742214 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listlocations/AsyncListLocations.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.v2.samples; + +// [START tpu_v2_generated_Tpu_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.tpu.v2.TpuClient; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() 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()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = tpuClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v2_generated_Tpu_ListLocations_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listlocations/AsyncListLocationsPaged.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..df914a476164 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listlocations/AsyncListLocationsPaged.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.v2.samples; + +// [START tpu_v2_generated_Tpu_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.tpu.v2.TpuClient; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() 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()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = tpuClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END tpu_v2_generated_Tpu_ListLocations_Paged_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listlocations/SyncListLocations.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..5fe9083f8e15 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listlocations/SyncListLocations.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.v2.samples; + +// [START tpu_v2_generated_Tpu_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.tpu.v2.TpuClient; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() 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()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : tpuClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v2_generated_Tpu_ListLocations_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listnodes/AsyncListNodes.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listnodes/AsyncListNodes.java new file mode 100644 index 000000000000..122c3a42a44f --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_ListNodes_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2.ListNodesRequest; +import com.google.cloud.tpu.v2.LocationName; +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_ListNodes_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listnodes/AsyncListNodesPaged.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listnodes/AsyncListNodesPaged.java new file mode 100644 index 000000000000..624802597874 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_ListNodes_Paged_async] +import com.google.cloud.tpu.v2.ListNodesRequest; +import com.google.cloud.tpu.v2.ListNodesResponse; +import com.google.cloud.tpu.v2.LocationName; +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_ListNodes_Paged_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listnodes/SyncListNodes.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listnodes/SyncListNodes.java new file mode 100644 index 000000000000..9298bfe2ad0d --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_ListNodes_sync] +import com.google.cloud.tpu.v2.ListNodesRequest; +import com.google.cloud.tpu.v2.LocationName; +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_ListNodes_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listnodes/SyncListNodesLocationname.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listnodes/SyncListNodesLocationname.java new file mode 100644 index 000000000000..386e24e55a66 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_ListNodes_Locationname_sync] +import com.google.cloud.tpu.v2.LocationName; +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_ListNodes_Locationname_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listnodes/SyncListNodesString.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listnodes/SyncListNodesString.java new file mode 100644 index 000000000000..1af658e49c25 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_ListNodes_String_sync] +import com.google.cloud.tpu.v2.LocationName; +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_ListNodes_String_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listruntimeversions/AsyncListRuntimeVersions.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listruntimeversions/AsyncListRuntimeVersions.java new file mode 100644 index 000000000000..20c891561e29 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listruntimeversions/AsyncListRuntimeVersions.java @@ -0,0 +1,56 @@ +/* + * 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.v2.samples; + +// [START tpu_v2_generated_Tpu_ListRuntimeVersions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2.ListRuntimeVersionsRequest; +import com.google.cloud.tpu.v2.LocationName; +import com.google.cloud.tpu.v2.RuntimeVersion; +import com.google.cloud.tpu.v2.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(LocationName.of("[PROJECT]", "[LOCATION]").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_v2_generated_Tpu_ListRuntimeVersions_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listruntimeversions/AsyncListRuntimeVersionsPaged.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listruntimeversions/AsyncListRuntimeVersionsPaged.java new file mode 100644 index 000000000000..c6edd9ad20e4 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listruntimeversions/AsyncListRuntimeVersionsPaged.java @@ -0,0 +1,64 @@ +/* + * 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.v2.samples; + +// [START tpu_v2_generated_Tpu_ListRuntimeVersions_Paged_async] +import com.google.cloud.tpu.v2.ListRuntimeVersionsRequest; +import com.google.cloud.tpu.v2.ListRuntimeVersionsResponse; +import com.google.cloud.tpu.v2.LocationName; +import com.google.cloud.tpu.v2.RuntimeVersion; +import com.google.cloud.tpu.v2.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(LocationName.of("[PROJECT]", "[LOCATION]").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_v2_generated_Tpu_ListRuntimeVersions_Paged_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listruntimeversions/SyncListRuntimeVersions.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listruntimeversions/SyncListRuntimeVersions.java new file mode 100644 index 000000000000..ff664f78531b --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listruntimeversions/SyncListRuntimeVersions.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.v2.samples; + +// [START tpu_v2_generated_Tpu_ListRuntimeVersions_sync] +import com.google.cloud.tpu.v2.ListRuntimeVersionsRequest; +import com.google.cloud.tpu.v2.LocationName; +import com.google.cloud.tpu.v2.RuntimeVersion; +import com.google.cloud.tpu.v2.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(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (RuntimeVersion element : tpuClient.listRuntimeVersions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v2_generated_Tpu_ListRuntimeVersions_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listruntimeversions/SyncListRuntimeVersionsLocationname.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listruntimeversions/SyncListRuntimeVersionsLocationname.java new file mode 100644 index 000000000000..8210d1a23574 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listruntimeversions/SyncListRuntimeVersionsLocationname.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.v2.samples; + +// [START tpu_v2_generated_Tpu_ListRuntimeVersions_Locationname_sync] +import com.google.cloud.tpu.v2.LocationName; +import com.google.cloud.tpu.v2.RuntimeVersion; +import com.google.cloud.tpu.v2.TpuClient; + +public class SyncListRuntimeVersionsLocationname { + + public static void main(String[] args) throws Exception { + syncListRuntimeVersionsLocationname(); + } + + public static void syncListRuntimeVersionsLocationname() 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 (RuntimeVersion element : tpuClient.listRuntimeVersions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v2_generated_Tpu_ListRuntimeVersions_Locationname_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listruntimeversions/SyncListRuntimeVersionsString.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listruntimeversions/SyncListRuntimeVersionsString.java new file mode 100644 index 000000000000..f3cccb1e0507 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/listruntimeversions/SyncListRuntimeVersionsString.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.v2.samples; + +// [START tpu_v2_generated_Tpu_ListRuntimeVersions_String_sync] +import com.google.cloud.tpu.v2.LocationName; +import com.google.cloud.tpu.v2.RuntimeVersion; +import com.google.cloud.tpu.v2.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 = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (RuntimeVersion element : tpuClient.listRuntimeVersions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v2_generated_Tpu_ListRuntimeVersions_String_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/startnode/AsyncStartNode.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/startnode/AsyncStartNode.java new file mode 100644 index 000000000000..9abea00d0718 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/startnode/AsyncStartNode.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.v2.samples; + +// [START tpu_v2_generated_Tpu_StartNode_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2.NodeName; +import com.google.cloud.tpu.v2.StartNodeRequest; +import com.google.cloud.tpu.v2.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(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); + ApiFuture future = tpuClient.startNodeCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END tpu_v2_generated_Tpu_StartNode_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/startnode/AsyncStartNodeLRO.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/startnode/AsyncStartNodeLRO.java new file mode 100644 index 000000000000..c40a0e961a01 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/startnode/AsyncStartNodeLRO.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.v2.samples; + +// [START tpu_v2_generated_Tpu_StartNode_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.NodeName; +import com.google.cloud.tpu.v2.OperationMetadata; +import com.google.cloud.tpu.v2.StartNodeRequest; +import com.google.cloud.tpu.v2.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(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); + OperationFuture future = + tpuClient.startNodeOperationCallable().futureCall(request); + // Do something. + Node response = future.get(); + } + } +} +// [END tpu_v2_generated_Tpu_StartNode_LRO_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/startnode/SyncStartNode.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/startnode/SyncStartNode.java new file mode 100644 index 000000000000..7b4d7875200e --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/startnode/SyncStartNode.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.v2.samples; + +// [START tpu_v2_generated_Tpu_StartNode_sync] +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.NodeName; +import com.google.cloud.tpu.v2.StartNodeRequest; +import com.google.cloud.tpu.v2.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(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); + Node response = tpuClient.startNodeAsync(request).get(); + } + } +} +// [END tpu_v2_generated_Tpu_StartNode_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/stopnode/AsyncStopNode.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/stopnode/AsyncStopNode.java new file mode 100644 index 000000000000..111caf4ae40b --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/stopnode/AsyncStopNode.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.v2.samples; + +// [START tpu_v2_generated_Tpu_StopNode_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2.NodeName; +import com.google.cloud.tpu.v2.StopNodeRequest; +import com.google.cloud.tpu.v2.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(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); + ApiFuture future = tpuClient.stopNodeCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END tpu_v2_generated_Tpu_StopNode_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/stopnode/AsyncStopNodeLRO.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/stopnode/AsyncStopNodeLRO.java new file mode 100644 index 000000000000..5ef4fd26a0eb --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/stopnode/AsyncStopNodeLRO.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.v2.samples; + +// [START tpu_v2_generated_Tpu_StopNode_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.NodeName; +import com.google.cloud.tpu.v2.OperationMetadata; +import com.google.cloud.tpu.v2.StopNodeRequest; +import com.google.cloud.tpu.v2.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(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); + OperationFuture future = + tpuClient.stopNodeOperationCallable().futureCall(request); + // Do something. + Node response = future.get(); + } + } +} +// [END tpu_v2_generated_Tpu_StopNode_LRO_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/stopnode/SyncStopNode.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/stopnode/SyncStopNode.java new file mode 100644 index 000000000000..c2ea538b5252 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/stopnode/SyncStopNode.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.v2.samples; + +// [START tpu_v2_generated_Tpu_StopNode_sync] +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.NodeName; +import com.google.cloud.tpu.v2.StopNodeRequest; +import com.google.cloud.tpu.v2.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(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); + Node response = tpuClient.stopNodeAsync(request).get(); + } + } +} +// [END tpu_v2_generated_Tpu_StopNode_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/updatenode/AsyncUpdateNode.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/updatenode/AsyncUpdateNode.java new file mode 100644 index 000000000000..74bebd56b9ad --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_UpdateNode_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.TpuClient; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_UpdateNode_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/updatenode/AsyncUpdateNodeLRO.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/updatenode/AsyncUpdateNodeLRO.java new file mode 100644 index 000000000000..80e3cb2049e6 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_UpdateNode_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.OperationMetadata; +import com.google.cloud.tpu.v2.TpuClient; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_UpdateNode_LRO_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/updatenode/SyncUpdateNode.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/updatenode/SyncUpdateNode.java new file mode 100644 index 000000000000..a18df080d118 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_UpdateNode_sync] +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.TpuClient; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_UpdateNode_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/updatenode/SyncUpdateNodeNodeFieldmask.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/updatenode/SyncUpdateNodeNodeFieldmask.java new file mode 100644 index 000000000000..4e0d5a145a51 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/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.v2.samples; + +// [START tpu_v2_generated_Tpu_UpdateNode_NodeFieldmask_sync] +import com.google.cloud.tpu.v2.Node; +import com.google.cloud.tpu.v2.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_v2_generated_Tpu_UpdateNode_NodeFieldmask_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpusettings/getnode/SyncGetNode.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/tpusettings/getnode/SyncGetNode.java new file mode 100644 index 000000000000..a6683ccac7bf --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2/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.v2.samples; + +// [START tpu_v2_generated_TpuSettings_GetNode_sync] +import com.google.cloud.tpu.v2.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_v2_generated_TpuSettings_GetNode_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createnode/AsyncCreateNode.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createnode/AsyncCreateNode.java index 34e7a466e490..41ac0d2eca61 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createnode/AsyncCreateNode.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createnode/AsyncCreateNode.java @@ -42,6 +42,7 @@ public static void asyncCreateNode() throws Exception { .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setNodeId("nodeId-1040171331") .setNode(Node.newBuilder().build()) + .setRequestId("requestId693933066") .build(); ApiFuture future = tpuClient.createNodeCallable().futureCall(request); // Do something. diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createnode/AsyncCreateNodeLRO.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createnode/AsyncCreateNodeLRO.java index bd246636e65d..b351ca202b83 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createnode/AsyncCreateNodeLRO.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createnode/AsyncCreateNodeLRO.java @@ -42,6 +42,7 @@ public static void asyncCreateNodeLRO() throws Exception { .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setNodeId("nodeId-1040171331") .setNode(Node.newBuilder().build()) + .setRequestId("requestId693933066") .build(); OperationFuture future = tpuClient.createNodeOperationCallable().futureCall(request); diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createnode/SyncCreateNode.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createnode/SyncCreateNode.java index 130532da3ec1..29ea3e4ebe87 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createnode/SyncCreateNode.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createnode/SyncCreateNode.java @@ -40,6 +40,7 @@ public static void syncCreateNode() throws Exception { .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setNodeId("nodeId-1040171331") .setNode(Node.newBuilder().build()) + .setRequestId("requestId693933066") .build(); Node response = tpuClient.createNodeAsync(request).get(); } diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createqueuedresource/AsyncCreateQueuedResource.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createqueuedresource/AsyncCreateQueuedResource.java new file mode 100644 index 000000000000..e0c32f9216d2 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createqueuedresource/AsyncCreateQueuedResource.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_Tpu_CreateQueuedResource_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest; +import com.google.cloud.tpu.v2alpha1.LocationName; +import com.google.cloud.tpu.v2alpha1.QueuedResource; +import com.google.cloud.tpu.v2alpha1.TpuClient; +import com.google.longrunning.Operation; + +public class AsyncCreateQueuedResource { + + public static void main(String[] args) throws Exception { + asyncCreateQueuedResource(); + } + + public static void asyncCreateQueuedResource() 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()) { + CreateQueuedResourceRequest request = + CreateQueuedResourceRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setQueuedResourceId("queuedResourceId437646236") + .setQueuedResource(QueuedResource.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = tpuClient.createQueuedResourceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END tpu_v2alpha1_generated_Tpu_CreateQueuedResource_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createqueuedresource/AsyncCreateQueuedResourceLRO.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createqueuedresource/AsyncCreateQueuedResourceLRO.java new file mode 100644 index 000000000000..49c9bb39d92b --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createqueuedresource/AsyncCreateQueuedResourceLRO.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_Tpu_CreateQueuedResource_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest; +import com.google.cloud.tpu.v2alpha1.LocationName; +import com.google.cloud.tpu.v2alpha1.OperationMetadata; +import com.google.cloud.tpu.v2alpha1.QueuedResource; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class AsyncCreateQueuedResourceLRO { + + public static void main(String[] args) throws Exception { + asyncCreateQueuedResourceLRO(); + } + + public static void asyncCreateQueuedResourceLRO() 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()) { + CreateQueuedResourceRequest request = + CreateQueuedResourceRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setQueuedResourceId("queuedResourceId437646236") + .setQueuedResource(QueuedResource.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + tpuClient.createQueuedResourceOperationCallable().futureCall(request); + // Do something. + QueuedResource response = future.get(); + } + } +} +// [END tpu_v2alpha1_generated_Tpu_CreateQueuedResource_LRO_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createqueuedresource/SyncCreateQueuedResource.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createqueuedresource/SyncCreateQueuedResource.java new file mode 100644 index 000000000000..1c2d5ea5614c --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createqueuedresource/SyncCreateQueuedResource.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_Tpu_CreateQueuedResource_sync] +import com.google.cloud.tpu.v2alpha1.CreateQueuedResourceRequest; +import com.google.cloud.tpu.v2alpha1.LocationName; +import com.google.cloud.tpu.v2alpha1.QueuedResource; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncCreateQueuedResource { + + public static void main(String[] args) throws Exception { + syncCreateQueuedResource(); + } + + public static void syncCreateQueuedResource() 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()) { + CreateQueuedResourceRequest request = + CreateQueuedResourceRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setQueuedResourceId("queuedResourceId437646236") + .setQueuedResource(QueuedResource.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + QueuedResource response = tpuClient.createQueuedResourceAsync(request).get(); + } + } +} +// [END tpu_v2alpha1_generated_Tpu_CreateQueuedResource_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createqueuedresource/SyncCreateQueuedResourceLocationnameQueuedresourceString.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createqueuedresource/SyncCreateQueuedResourceLocationnameQueuedresourceString.java new file mode 100644 index 000000000000..3a1c22d610c0 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createqueuedresource/SyncCreateQueuedResourceLocationnameQueuedresourceString.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_Tpu_CreateQueuedResource_LocationnameQueuedresourceString_sync] +import com.google.cloud.tpu.v2alpha1.LocationName; +import com.google.cloud.tpu.v2alpha1.QueuedResource; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncCreateQueuedResourceLocationnameQueuedresourceString { + + public static void main(String[] args) throws Exception { + syncCreateQueuedResourceLocationnameQueuedresourceString(); + } + + public static void syncCreateQueuedResourceLocationnameQueuedresourceString() 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]"); + QueuedResource queuedResource = QueuedResource.newBuilder().build(); + String queuedResourceId = "queuedResourceId437646236"; + QueuedResource response = + tpuClient.createQueuedResourceAsync(parent, queuedResource, queuedResourceId).get(); + } + } +} +// [END tpu_v2alpha1_generated_Tpu_CreateQueuedResource_LocationnameQueuedresourceString_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createqueuedresource/SyncCreateQueuedResourceStringQueuedresourceString.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createqueuedresource/SyncCreateQueuedResourceStringQueuedresourceString.java new file mode 100644 index 000000000000..5481f7bd33c0 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/createqueuedresource/SyncCreateQueuedResourceStringQueuedresourceString.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_Tpu_CreateQueuedResource_StringQueuedresourceString_sync] +import com.google.cloud.tpu.v2alpha1.LocationName; +import com.google.cloud.tpu.v2alpha1.QueuedResource; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncCreateQueuedResourceStringQueuedresourceString { + + public static void main(String[] args) throws Exception { + syncCreateQueuedResourceStringQueuedresourceString(); + } + + public static void syncCreateQueuedResourceStringQueuedresourceString() 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(); + QueuedResource queuedResource = QueuedResource.newBuilder().build(); + String queuedResourceId = "queuedResourceId437646236"; + QueuedResource response = + tpuClient.createQueuedResourceAsync(parent, queuedResource, queuedResourceId).get(); + } + } +} +// [END tpu_v2alpha1_generated_Tpu_CreateQueuedResource_StringQueuedresourceString_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletenode/AsyncDeleteNode.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletenode/AsyncDeleteNode.java index 16cbceab9499..c28b3aab2e25 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletenode/AsyncDeleteNode.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletenode/AsyncDeleteNode.java @@ -39,10 +39,11 @@ public static void asyncDeleteNode() throws Exception { DeleteNodeRequest request = DeleteNodeRequest.newBuilder() .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setRequestId("requestId693933066") .build(); ApiFuture future = tpuClient.deleteNodeCallable().futureCall(request); // Do something. - Operation response = future.get(); + future.get(); } } } diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletenode/AsyncDeleteNodeLRO.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletenode/AsyncDeleteNodeLRO.java index 476cfb272726..435c3fbb58b0 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletenode/AsyncDeleteNodeLRO.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletenode/AsyncDeleteNodeLRO.java @@ -19,10 +19,10 @@ // [START tpu_v2alpha1_generated_Tpu_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; +import com.google.protobuf.Empty; public class AsyncDeleteNodeLRO { @@ -40,11 +40,12 @@ public static void asyncDeleteNodeLRO() throws Exception { DeleteNodeRequest request = DeleteNodeRequest.newBuilder() .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setRequestId("requestId693933066") .build(); - OperationFuture future = + OperationFuture future = tpuClient.deleteNodeOperationCallable().futureCall(request); // Do something. - Node response = future.get(); + future.get(); } } } diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletenode/SyncDeleteNode.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletenode/SyncDeleteNode.java index f40e11359b72..19724d629ab7 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletenode/SyncDeleteNode.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletenode/SyncDeleteNode.java @@ -18,9 +18,9 @@ // [START tpu_v2alpha1_generated_Tpu_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; +import com.google.protobuf.Empty; public class SyncDeleteNode { @@ -38,8 +38,9 @@ public static void syncDeleteNode() throws Exception { DeleteNodeRequest request = DeleteNodeRequest.newBuilder() .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setRequestId("requestId693933066") .build(); - Node response = tpuClient.deleteNodeAsync(request).get(); + tpuClient.deleteNodeAsync(request).get(); } } } diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletenode/SyncDeleteNodeNodename.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletenode/SyncDeleteNodeNodename.java index 1bf705ef08ea..ff17001a610d 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletenode/SyncDeleteNodeNodename.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletenode/SyncDeleteNodeNodename.java @@ -17,9 +17,9 @@ package com.google.cloud.tpu.v2alpha1.samples; // [START tpu_v2alpha1_generated_Tpu_DeleteNode_Nodename_sync] -import com.google.cloud.tpu.v2alpha1.Node; import com.google.cloud.tpu.v2alpha1.NodeName; import com.google.cloud.tpu.v2alpha1.TpuClient; +import com.google.protobuf.Empty; public class SyncDeleteNodeNodename { @@ -35,7 +35,7 @@ public static void syncDeleteNodeNodename() throws Exception { // 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(); + tpuClient.deleteNodeAsync(name).get(); } } } diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletenode/SyncDeleteNodeString.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletenode/SyncDeleteNodeString.java index 8effa2ea0484..457e447331cf 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletenode/SyncDeleteNodeString.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletenode/SyncDeleteNodeString.java @@ -17,9 +17,9 @@ package com.google.cloud.tpu.v2alpha1.samples; // [START tpu_v2alpha1_generated_Tpu_DeleteNode_String_sync] -import com.google.cloud.tpu.v2alpha1.Node; import com.google.cloud.tpu.v2alpha1.NodeName; import com.google.cloud.tpu.v2alpha1.TpuClient; +import com.google.protobuf.Empty; public class SyncDeleteNodeString { @@ -35,7 +35,7 @@ public static void syncDeleteNodeString() throws Exception { // 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(); + tpuClient.deleteNodeAsync(name).get(); } } } diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletequeuedresource/AsyncDeleteQueuedResource.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletequeuedresource/AsyncDeleteQueuedResource.java new file mode 100644 index 000000000000..c254e61e3b8b --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletequeuedresource/AsyncDeleteQueuedResource.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_Tpu_DeleteQueuedResource_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest; +import com.google.cloud.tpu.v2alpha1.QueuedResourceName; +import com.google.cloud.tpu.v2alpha1.TpuClient; +import com.google.longrunning.Operation; + +public class AsyncDeleteQueuedResource { + + public static void main(String[] args) throws Exception { + asyncDeleteQueuedResource(); + } + + public static void asyncDeleteQueuedResource() 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()) { + DeleteQueuedResourceRequest request = + DeleteQueuedResourceRequest.newBuilder() + .setName( + QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = tpuClient.deleteQueuedResourceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END tpu_v2alpha1_generated_Tpu_DeleteQueuedResource_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletequeuedresource/AsyncDeleteQueuedResourceLRO.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletequeuedresource/AsyncDeleteQueuedResourceLRO.java new file mode 100644 index 000000000000..5af90a78c77a --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletequeuedresource/AsyncDeleteQueuedResourceLRO.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_Tpu_DeleteQueuedResource_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest; +import com.google.cloud.tpu.v2alpha1.OperationMetadata; +import com.google.cloud.tpu.v2alpha1.QueuedResource; +import com.google.cloud.tpu.v2alpha1.QueuedResourceName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class AsyncDeleteQueuedResourceLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteQueuedResourceLRO(); + } + + public static void asyncDeleteQueuedResourceLRO() 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()) { + DeleteQueuedResourceRequest request = + DeleteQueuedResourceRequest.newBuilder() + .setName( + QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + tpuClient.deleteQueuedResourceOperationCallable().futureCall(request); + // Do something. + QueuedResource response = future.get(); + } + } +} +// [END tpu_v2alpha1_generated_Tpu_DeleteQueuedResource_LRO_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletequeuedresource/SyncDeleteQueuedResource.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletequeuedresource/SyncDeleteQueuedResource.java new file mode 100644 index 000000000000..ffb73af73a9c --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletequeuedresource/SyncDeleteQueuedResource.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_Tpu_DeleteQueuedResource_sync] +import com.google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest; +import com.google.cloud.tpu.v2alpha1.QueuedResource; +import com.google.cloud.tpu.v2alpha1.QueuedResourceName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncDeleteQueuedResource { + + public static void main(String[] args) throws Exception { + syncDeleteQueuedResource(); + } + + public static void syncDeleteQueuedResource() 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()) { + DeleteQueuedResourceRequest request = + DeleteQueuedResourceRequest.newBuilder() + .setName( + QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString()) + .setRequestId("requestId693933066") + .build(); + QueuedResource response = tpuClient.deleteQueuedResourceAsync(request).get(); + } + } +} +// [END tpu_v2alpha1_generated_Tpu_DeleteQueuedResource_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletequeuedresource/SyncDeleteQueuedResourceQueuedresourcename.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletequeuedresource/SyncDeleteQueuedResourceQueuedresourcename.java new file mode 100644 index 000000000000..869d0121b9a4 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletequeuedresource/SyncDeleteQueuedResourceQueuedresourcename.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_Tpu_DeleteQueuedResource_Queuedresourcename_sync] +import com.google.cloud.tpu.v2alpha1.QueuedResource; +import com.google.cloud.tpu.v2alpha1.QueuedResourceName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncDeleteQueuedResourceQueuedresourcename { + + public static void main(String[] args) throws Exception { + syncDeleteQueuedResourceQueuedresourcename(); + } + + public static void syncDeleteQueuedResourceQueuedresourcename() 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()) { + QueuedResourceName name = + QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]"); + QueuedResource response = tpuClient.deleteQueuedResourceAsync(name).get(); + } + } +} +// [END tpu_v2alpha1_generated_Tpu_DeleteQueuedResource_Queuedresourcename_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletequeuedresource/SyncDeleteQueuedResourceString.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletequeuedresource/SyncDeleteQueuedResourceString.java new file mode 100644 index 000000000000..f3b01d6e7867 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/deletequeuedresource/SyncDeleteQueuedResourceString.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_Tpu_DeleteQueuedResource_String_sync] +import com.google.cloud.tpu.v2alpha1.QueuedResource; +import com.google.cloud.tpu.v2alpha1.QueuedResourceName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncDeleteQueuedResourceString { + + public static void main(String[] args) throws Exception { + syncDeleteQueuedResourceString(); + } + + public static void syncDeleteQueuedResourceString() 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 = + QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString(); + QueuedResource response = tpuClient.deleteQueuedResourceAsync(name).get(); + } + } +} +// [END tpu_v2alpha1_generated_Tpu_DeleteQueuedResource_String_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getlocation/AsyncGetLocation.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..4edb7fc987e0 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getlocation/AsyncGetLocation.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_Tpu_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() 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()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = tpuClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END tpu_v2alpha1_generated_Tpu_GetLocation_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getlocation/SyncGetLocation.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..5f7bfb2bef9a --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getlocation/SyncGetLocation.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_Tpu_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() 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()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = tpuClient.getLocation(request); + } + } +} +// [END tpu_v2alpha1_generated_Tpu_GetLocation_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getqueuedresource/AsyncGetQueuedResource.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getqueuedresource/AsyncGetQueuedResource.java new file mode 100644 index 000000000000..890701e1ba2a --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getqueuedresource/AsyncGetQueuedResource.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_Tpu_GetQueuedResource_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest; +import com.google.cloud.tpu.v2alpha1.QueuedResource; +import com.google.cloud.tpu.v2alpha1.QueuedResourceName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class AsyncGetQueuedResource { + + public static void main(String[] args) throws Exception { + asyncGetQueuedResource(); + } + + public static void asyncGetQueuedResource() 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()) { + GetQueuedResourceRequest request = + GetQueuedResourceRequest.newBuilder() + .setName( + QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString()) + .build(); + ApiFuture future = tpuClient.getQueuedResourceCallable().futureCall(request); + // Do something. + QueuedResource response = future.get(); + } + } +} +// [END tpu_v2alpha1_generated_Tpu_GetQueuedResource_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getqueuedresource/SyncGetQueuedResource.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getqueuedresource/SyncGetQueuedResource.java new file mode 100644 index 000000000000..c779b3f762ce --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getqueuedresource/SyncGetQueuedResource.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_Tpu_GetQueuedResource_sync] +import com.google.cloud.tpu.v2alpha1.GetQueuedResourceRequest; +import com.google.cloud.tpu.v2alpha1.QueuedResource; +import com.google.cloud.tpu.v2alpha1.QueuedResourceName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncGetQueuedResource { + + public static void main(String[] args) throws Exception { + syncGetQueuedResource(); + } + + public static void syncGetQueuedResource() 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()) { + GetQueuedResourceRequest request = + GetQueuedResourceRequest.newBuilder() + .setName( + QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString()) + .build(); + QueuedResource response = tpuClient.getQueuedResource(request); + } + } +} +// [END tpu_v2alpha1_generated_Tpu_GetQueuedResource_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getqueuedresource/SyncGetQueuedResourceQueuedresourcename.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getqueuedresource/SyncGetQueuedResourceQueuedresourcename.java new file mode 100644 index 000000000000..59b766c50891 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getqueuedresource/SyncGetQueuedResourceQueuedresourcename.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_Tpu_GetQueuedResource_Queuedresourcename_sync] +import com.google.cloud.tpu.v2alpha1.QueuedResource; +import com.google.cloud.tpu.v2alpha1.QueuedResourceName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncGetQueuedResourceQueuedresourcename { + + public static void main(String[] args) throws Exception { + syncGetQueuedResourceQueuedresourcename(); + } + + public static void syncGetQueuedResourceQueuedresourcename() 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()) { + QueuedResourceName name = + QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]"); + QueuedResource response = tpuClient.getQueuedResource(name); + } + } +} +// [END tpu_v2alpha1_generated_Tpu_GetQueuedResource_Queuedresourcename_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getqueuedresource/SyncGetQueuedResourceString.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getqueuedresource/SyncGetQueuedResourceString.java new file mode 100644 index 000000000000..1bdd0460e4fe --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/getqueuedresource/SyncGetQueuedResourceString.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_Tpu_GetQueuedResource_String_sync] +import com.google.cloud.tpu.v2alpha1.QueuedResource; +import com.google.cloud.tpu.v2alpha1.QueuedResourceName; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncGetQueuedResourceString { + + public static void main(String[] args) throws Exception { + syncGetQueuedResourceString(); + } + + public static void syncGetQueuedResourceString() 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 = + QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString(); + QueuedResource response = tpuClient.getQueuedResource(name); + } + } +} +// [END tpu_v2alpha1_generated_Tpu_GetQueuedResource_String_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listacceleratortypes/AsyncListAcceleratorTypes.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listacceleratortypes/AsyncListAcceleratorTypes.java index 8a4e39f603b5..91eb55771f18 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listacceleratortypes/AsyncListAcceleratorTypes.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listacceleratortypes/AsyncListAcceleratorTypes.java @@ -19,8 +19,8 @@ // [START tpu_v2alpha1_generated_Tpu_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.LocationName; import com.google.cloud.tpu.v2alpha1.TpuClient; public class AsyncListAcceleratorTypes { @@ -38,9 +38,7 @@ public static void asyncListAcceleratorTypes() throws Exception { try (TpuClient tpuClient = TpuClient.create()) { ListAcceleratorTypesRequest request = ListAcceleratorTypesRequest.newBuilder() - .setParent( - AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]") - .toString()) + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listacceleratortypes/AsyncListAcceleratorTypesPaged.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listacceleratortypes/AsyncListAcceleratorTypesPaged.java index 324d85d1cb25..ea92aa546c10 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listacceleratortypes/AsyncListAcceleratorTypesPaged.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listacceleratortypes/AsyncListAcceleratorTypesPaged.java @@ -18,9 +18,9 @@ // [START tpu_v2alpha1_generated_Tpu_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.LocationName; import com.google.cloud.tpu.v2alpha1.TpuClient; import com.google.common.base.Strings; @@ -39,9 +39,7 @@ public static void asyncListAcceleratorTypesPaged() throws Exception { try (TpuClient tpuClient = TpuClient.create()) { ListAcceleratorTypesRequest request = ListAcceleratorTypesRequest.newBuilder() - .setParent( - AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]") - .toString()) + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listacceleratortypes/SyncListAcceleratorTypes.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listacceleratortypes/SyncListAcceleratorTypes.java index 7c25b9368e47..38a74fef5481 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listacceleratortypes/SyncListAcceleratorTypes.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listacceleratortypes/SyncListAcceleratorTypes.java @@ -18,8 +18,8 @@ // [START tpu_v2alpha1_generated_Tpu_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.LocationName; import com.google.cloud.tpu.v2alpha1.TpuClient; public class SyncListAcceleratorTypes { @@ -37,9 +37,7 @@ public static void syncListAcceleratorTypes() throws Exception { try (TpuClient tpuClient = TpuClient.create()) { ListAcceleratorTypesRequest request = ListAcceleratorTypesRequest.newBuilder() - .setParent( - AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]") - .toString()) + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listacceleratortypes/SyncListAcceleratorTypesAcceleratortypename.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listacceleratortypes/SyncListAcceleratorTypesLocationname.java similarity index 72% rename from java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listacceleratortypes/SyncListAcceleratorTypesAcceleratortypename.java rename to java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listacceleratortypes/SyncListAcceleratorTypesLocationname.java index ae2c0509c9ee..da94f509e556 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listacceleratortypes/SyncListAcceleratorTypesAcceleratortypename.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listacceleratortypes/SyncListAcceleratorTypesLocationname.java @@ -16,30 +16,29 @@ package com.google.cloud.tpu.v2alpha1.samples; -// [START tpu_v2alpha1_generated_Tpu_ListAcceleratorTypes_Acceleratortypename_sync] +// [START tpu_v2alpha1_generated_Tpu_ListAcceleratorTypes_Locationname_sync] import com.google.cloud.tpu.v2alpha1.AcceleratorType; -import com.google.cloud.tpu.v2alpha1.AcceleratorTypeName; +import com.google.cloud.tpu.v2alpha1.LocationName; import com.google.cloud.tpu.v2alpha1.TpuClient; -public class SyncListAcceleratorTypesAcceleratortypename { +public class SyncListAcceleratorTypesLocationname { public static void main(String[] args) throws Exception { - syncListAcceleratorTypesAcceleratortypename(); + syncListAcceleratorTypesLocationname(); } - public static void syncListAcceleratorTypesAcceleratortypename() throws Exception { + public static void syncListAcceleratorTypesLocationname() 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]"); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (AcceleratorType element : tpuClient.listAcceleratorTypes(parent).iterateAll()) { // doThingsWith(element); } } } } -// [END tpu_v2alpha1_generated_Tpu_ListAcceleratorTypes_Acceleratortypename_sync] +// [END tpu_v2alpha1_generated_Tpu_ListAcceleratorTypes_Locationname_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listacceleratortypes/SyncListAcceleratorTypesString.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listacceleratortypes/SyncListAcceleratorTypesString.java index b376efc9d39b..287c5a58be89 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listacceleratortypes/SyncListAcceleratorTypesString.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listacceleratortypes/SyncListAcceleratorTypesString.java @@ -18,7 +18,7 @@ // [START tpu_v2alpha1_generated_Tpu_ListAcceleratorTypes_String_sync] import com.google.cloud.tpu.v2alpha1.AcceleratorType; -import com.google.cloud.tpu.v2alpha1.AcceleratorTypeName; +import com.google.cloud.tpu.v2alpha1.LocationName; import com.google.cloud.tpu.v2alpha1.TpuClient; public class SyncListAcceleratorTypesString { @@ -34,8 +34,7 @@ public static void syncListAcceleratorTypesString() throws Exception { // - 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(); + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (AcceleratorType element : tpuClient.listAcceleratorTypes(parent).iterateAll()) { // doThingsWith(element); } diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listlocations/AsyncListLocations.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..6fd6bebc4fdd --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listlocations/AsyncListLocations.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_Tpu_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() 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()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = tpuClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v2alpha1_generated_Tpu_ListLocations_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listlocations/AsyncListLocationsPaged.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..a0717826e70e --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listlocations/AsyncListLocationsPaged.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_Tpu_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.tpu.v2alpha1.TpuClient; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() 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()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = tpuClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END tpu_v2alpha1_generated_Tpu_ListLocations_Paged_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listlocations/SyncListLocations.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..9a707a074537 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listlocations/SyncListLocations.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_Tpu_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() 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()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : tpuClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v2alpha1_generated_Tpu_ListLocations_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listnodes/AsyncListNodes.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listnodes/AsyncListNodes.java index 4e556032923e..e8dfc5219fe6 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listnodes/AsyncListNodes.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listnodes/AsyncListNodes.java @@ -19,8 +19,8 @@ // [START tpu_v2alpha1_generated_Tpu_ListNodes_async] import com.google.api.core.ApiFuture; import com.google.cloud.tpu.v2alpha1.ListNodesRequest; +import com.google.cloud.tpu.v2alpha1.LocationName; import com.google.cloud.tpu.v2alpha1.Node; -import com.google.cloud.tpu.v2alpha1.NodeName; import com.google.cloud.tpu.v2alpha1.TpuClient; public class AsyncListNodes { @@ -38,7 +38,7 @@ public static void asyncListNodes() throws Exception { try (TpuClient tpuClient = TpuClient.create()) { ListNodesRequest request = ListNodesRequest.newBuilder() - .setParent(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listnodes/AsyncListNodesPaged.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listnodes/AsyncListNodesPaged.java index fcef34a90800..0a74cb9bc106 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listnodes/AsyncListNodesPaged.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listnodes/AsyncListNodesPaged.java @@ -19,8 +19,8 @@ // [START tpu_v2alpha1_generated_Tpu_ListNodes_Paged_async] import com.google.cloud.tpu.v2alpha1.ListNodesRequest; import com.google.cloud.tpu.v2alpha1.ListNodesResponse; +import com.google.cloud.tpu.v2alpha1.LocationName; 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; @@ -39,7 +39,7 @@ public static void asyncListNodesPaged() throws Exception { try (TpuClient tpuClient = TpuClient.create()) { ListNodesRequest request = ListNodesRequest.newBuilder() - .setParent(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listnodes/SyncListNodes.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listnodes/SyncListNodes.java index 6e78a8343a3e..6559f840f73b 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listnodes/SyncListNodes.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listnodes/SyncListNodes.java @@ -18,8 +18,8 @@ // [START tpu_v2alpha1_generated_Tpu_ListNodes_sync] import com.google.cloud.tpu.v2alpha1.ListNodesRequest; +import com.google.cloud.tpu.v2alpha1.LocationName; import com.google.cloud.tpu.v2alpha1.Node; -import com.google.cloud.tpu.v2alpha1.NodeName; import com.google.cloud.tpu.v2alpha1.TpuClient; public class SyncListNodes { @@ -37,7 +37,7 @@ public static void syncListNodes() throws Exception { try (TpuClient tpuClient = TpuClient.create()) { ListNodesRequest request = ListNodesRequest.newBuilder() - .setParent(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listnodes/SyncListNodesNodename.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listnodes/SyncListNodesLocationname.java similarity index 77% rename from java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listnodes/SyncListNodesNodename.java rename to java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listnodes/SyncListNodesLocationname.java index e9bde97e7794..180f257eb691 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listnodes/SyncListNodesNodename.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listnodes/SyncListNodesLocationname.java @@ -16,29 +16,29 @@ package com.google.cloud.tpu.v2alpha1.samples; -// [START tpu_v2alpha1_generated_Tpu_ListNodes_Nodename_sync] +// [START tpu_v2alpha1_generated_Tpu_ListNodes_Locationname_sync] +import com.google.cloud.tpu.v2alpha1.LocationName; 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 class SyncListNodesLocationname { public static void main(String[] args) throws Exception { - syncListNodesNodename(); + syncListNodesLocationname(); } - public static void syncListNodesNodename() throws Exception { + 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()) { - NodeName parent = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Node element : tpuClient.listNodes(parent).iterateAll()) { // doThingsWith(element); } } } } -// [END tpu_v2alpha1_generated_Tpu_ListNodes_Nodename_sync] +// [END tpu_v2alpha1_generated_Tpu_ListNodes_Locationname_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listnodes/SyncListNodesString.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listnodes/SyncListNodesString.java index 8bf2ea6b17f8..68fc5ac19797 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listnodes/SyncListNodesString.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listnodes/SyncListNodesString.java @@ -17,8 +17,8 @@ package com.google.cloud.tpu.v2alpha1.samples; // [START tpu_v2alpha1_generated_Tpu_ListNodes_String_sync] +import com.google.cloud.tpu.v2alpha1.LocationName; import com.google.cloud.tpu.v2alpha1.Node; -import com.google.cloud.tpu.v2alpha1.NodeName; import com.google.cloud.tpu.v2alpha1.TpuClient; public class SyncListNodesString { @@ -34,7 +34,7 @@ public static void syncListNodesString() throws Exception { // - 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(); + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Node element : tpuClient.listNodes(parent).iterateAll()) { // doThingsWith(element); } diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listqueuedresources/AsyncListQueuedResources.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listqueuedresources/AsyncListQueuedResources.java new file mode 100644 index 000000000000..988f8dc88180 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listqueuedresources/AsyncListQueuedResources.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_Tpu_ListQueuedResources_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest; +import com.google.cloud.tpu.v2alpha1.LocationName; +import com.google.cloud.tpu.v2alpha1.QueuedResource; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class AsyncListQueuedResources { + + public static void main(String[] args) throws Exception { + asyncListQueuedResources(); + } + + public static void asyncListQueuedResources() 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()) { + ListQueuedResourcesRequest request = + ListQueuedResourcesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + tpuClient.listQueuedResourcesPagedCallable().futureCall(request); + // Do something. + for (QueuedResource element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v2alpha1_generated_Tpu_ListQueuedResources_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listqueuedresources/AsyncListQueuedResourcesPaged.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listqueuedresources/AsyncListQueuedResourcesPaged.java new file mode 100644 index 000000000000..1ea91583c7e5 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listqueuedresources/AsyncListQueuedResourcesPaged.java @@ -0,0 +1,62 @@ +/* + * 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_Tpu_ListQueuedResources_Paged_async] +import com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest; +import com.google.cloud.tpu.v2alpha1.ListQueuedResourcesResponse; +import com.google.cloud.tpu.v2alpha1.LocationName; +import com.google.cloud.tpu.v2alpha1.QueuedResource; +import com.google.cloud.tpu.v2alpha1.TpuClient; +import com.google.common.base.Strings; + +public class AsyncListQueuedResourcesPaged { + + public static void main(String[] args) throws Exception { + asyncListQueuedResourcesPaged(); + } + + public static void asyncListQueuedResourcesPaged() 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()) { + ListQueuedResourcesRequest request = + ListQueuedResourcesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListQueuedResourcesResponse response = + tpuClient.listQueuedResourcesCallable().call(request); + for (QueuedResource element : response.getQueuedResourcesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END tpu_v2alpha1_generated_Tpu_ListQueuedResources_Paged_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listqueuedresources/SyncListQueuedResources.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listqueuedresources/SyncListQueuedResources.java new file mode 100644 index 000000000000..9549ede72782 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listqueuedresources/SyncListQueuedResources.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_Tpu_ListQueuedResources_sync] +import com.google.cloud.tpu.v2alpha1.ListQueuedResourcesRequest; +import com.google.cloud.tpu.v2alpha1.LocationName; +import com.google.cloud.tpu.v2alpha1.QueuedResource; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncListQueuedResources { + + public static void main(String[] args) throws Exception { + syncListQueuedResources(); + } + + public static void syncListQueuedResources() 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()) { + ListQueuedResourcesRequest request = + ListQueuedResourcesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (QueuedResource element : tpuClient.listQueuedResources(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v2alpha1_generated_Tpu_ListQueuedResources_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listqueuedresources/SyncListQueuedResourcesLocationname.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listqueuedresources/SyncListQueuedResourcesLocationname.java new file mode 100644 index 000000000000..d806ca892d75 --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listqueuedresources/SyncListQueuedResourcesLocationname.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_Tpu_ListQueuedResources_Locationname_sync] +import com.google.cloud.tpu.v2alpha1.LocationName; +import com.google.cloud.tpu.v2alpha1.QueuedResource; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncListQueuedResourcesLocationname { + + public static void main(String[] args) throws Exception { + syncListQueuedResourcesLocationname(); + } + + public static void syncListQueuedResourcesLocationname() 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 (QueuedResource element : tpuClient.listQueuedResources(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v2alpha1_generated_Tpu_ListQueuedResources_Locationname_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listqueuedresources/SyncListQueuedResourcesString.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listqueuedresources/SyncListQueuedResourcesString.java new file mode 100644 index 000000000000..9cafd9f86abf --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listqueuedresources/SyncListQueuedResourcesString.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_Tpu_ListQueuedResources_String_sync] +import com.google.cloud.tpu.v2alpha1.LocationName; +import com.google.cloud.tpu.v2alpha1.QueuedResource; +import com.google.cloud.tpu.v2alpha1.TpuClient; + +public class SyncListQueuedResourcesString { + + public static void main(String[] args) throws Exception { + syncListQueuedResourcesString(); + } + + public static void syncListQueuedResourcesString() 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 (QueuedResource element : tpuClient.listQueuedResources(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END tpu_v2alpha1_generated_Tpu_ListQueuedResources_String_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listruntimeversions/AsyncListRuntimeVersions.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listruntimeversions/AsyncListRuntimeVersions.java index d0c02b8051df..9edc96c7bcfd 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listruntimeversions/AsyncListRuntimeVersions.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listruntimeversions/AsyncListRuntimeVersions.java @@ -19,8 +19,8 @@ // [START tpu_v2alpha1_generated_Tpu_ListRuntimeVersions_async] import com.google.api.core.ApiFuture; import com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest; +import com.google.cloud.tpu.v2alpha1.LocationName; import com.google.cloud.tpu.v2alpha1.RuntimeVersion; -import com.google.cloud.tpu.v2alpha1.RuntimeVersionName; import com.google.cloud.tpu.v2alpha1.TpuClient; public class AsyncListRuntimeVersions { @@ -38,8 +38,7 @@ public static void asyncListRuntimeVersions() throws Exception { try (TpuClient tpuClient = TpuClient.create()) { ListRuntimeVersionsRequest request = ListRuntimeVersionsRequest.newBuilder() - .setParent( - RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]").toString()) + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listruntimeversions/AsyncListRuntimeVersionsPaged.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listruntimeversions/AsyncListRuntimeVersionsPaged.java index 9cea1243b636..8e35e7ea1199 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listruntimeversions/AsyncListRuntimeVersionsPaged.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listruntimeversions/AsyncListRuntimeVersionsPaged.java @@ -19,8 +19,8 @@ // [START tpu_v2alpha1_generated_Tpu_ListRuntimeVersions_Paged_async] import com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest; import com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse; +import com.google.cloud.tpu.v2alpha1.LocationName; 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; @@ -39,8 +39,7 @@ public static void asyncListRuntimeVersionsPaged() throws Exception { try (TpuClient tpuClient = TpuClient.create()) { ListRuntimeVersionsRequest request = ListRuntimeVersionsRequest.newBuilder() - .setParent( - RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]").toString()) + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listruntimeversions/SyncListRuntimeVersions.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listruntimeversions/SyncListRuntimeVersions.java index 72970f7a978f..abf47a694b78 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listruntimeversions/SyncListRuntimeVersions.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listruntimeversions/SyncListRuntimeVersions.java @@ -18,8 +18,8 @@ // [START tpu_v2alpha1_generated_Tpu_ListRuntimeVersions_sync] import com.google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest; +import com.google.cloud.tpu.v2alpha1.LocationName; import com.google.cloud.tpu.v2alpha1.RuntimeVersion; -import com.google.cloud.tpu.v2alpha1.RuntimeVersionName; import com.google.cloud.tpu.v2alpha1.TpuClient; public class SyncListRuntimeVersions { @@ -37,8 +37,7 @@ public static void syncListRuntimeVersions() throws Exception { try (TpuClient tpuClient = TpuClient.create()) { ListRuntimeVersionsRequest request = ListRuntimeVersionsRequest.newBuilder() - .setParent( - RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]").toString()) + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listruntimeversions/SyncListRuntimeVersionsRuntimeversionname.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listruntimeversions/SyncListRuntimeVersionsLocationname.java similarity index 73% rename from java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listruntimeversions/SyncListRuntimeVersionsRuntimeversionname.java rename to java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listruntimeversions/SyncListRuntimeVersionsLocationname.java index e2a5b06a8f91..d2ff5d986f61 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listruntimeversions/SyncListRuntimeVersionsRuntimeversionname.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listruntimeversions/SyncListRuntimeVersionsLocationname.java @@ -16,30 +16,29 @@ package com.google.cloud.tpu.v2alpha1.samples; -// [START tpu_v2alpha1_generated_Tpu_ListRuntimeVersions_Runtimeversionname_sync] +// [START tpu_v2alpha1_generated_Tpu_ListRuntimeVersions_Locationname_sync] +import com.google.cloud.tpu.v2alpha1.LocationName; 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 class SyncListRuntimeVersionsLocationname { public static void main(String[] args) throws Exception { - syncListRuntimeVersionsRuntimeversionname(); + syncListRuntimeVersionsLocationname(); } - public static void syncListRuntimeVersionsRuntimeversionname() throws Exception { + public static void syncListRuntimeVersionsLocationname() 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]"); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (RuntimeVersion element : tpuClient.listRuntimeVersions(parent).iterateAll()) { // doThingsWith(element); } } } } -// [END tpu_v2alpha1_generated_Tpu_ListRuntimeVersions_Runtimeversionname_sync] +// [END tpu_v2alpha1_generated_Tpu_ListRuntimeVersions_Locationname_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listruntimeversions/SyncListRuntimeVersionsString.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listruntimeversions/SyncListRuntimeVersionsString.java index abe1466d56ad..629cdbba48fe 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listruntimeversions/SyncListRuntimeVersionsString.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/listruntimeversions/SyncListRuntimeVersionsString.java @@ -17,8 +17,8 @@ package com.google.cloud.tpu.v2alpha1.samples; // [START tpu_v2alpha1_generated_Tpu_ListRuntimeVersions_String_sync] +import com.google.cloud.tpu.v2alpha1.LocationName; import com.google.cloud.tpu.v2alpha1.RuntimeVersion; -import com.google.cloud.tpu.v2alpha1.RuntimeVersionName; import com.google.cloud.tpu.v2alpha1.TpuClient; public class SyncListRuntimeVersionsString { @@ -34,8 +34,7 @@ public static void syncListRuntimeVersionsString() throws Exception { // - 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(); + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (RuntimeVersion element : tpuClient.listRuntimeVersions(parent).iterateAll()) { // doThingsWith(element); } diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/simulatemaintenanceevent/AsyncSimulateMaintenanceEvent.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/simulatemaintenanceevent/AsyncSimulateMaintenanceEvent.java new file mode 100644 index 000000000000..81d94b775f3a --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/simulatemaintenanceevent/AsyncSimulateMaintenanceEvent.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_Tpu_SimulateMaintenanceEvent_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2alpha1.NodeName; +import com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest; +import com.google.cloud.tpu.v2alpha1.TpuClient; +import com.google.longrunning.Operation; +import java.util.ArrayList; + +public class AsyncSimulateMaintenanceEvent { + + public static void main(String[] args) throws Exception { + asyncSimulateMaintenanceEvent(); + } + + public static void asyncSimulateMaintenanceEvent() 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()) { + SimulateMaintenanceEventRequest request = + SimulateMaintenanceEventRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .addAllWorkerIds(new ArrayList()) + .build(); + ApiFuture future = + tpuClient.simulateMaintenanceEventCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END tpu_v2alpha1_generated_Tpu_SimulateMaintenanceEvent_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/simulatemaintenanceevent/AsyncSimulateMaintenanceEventLRO.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/simulatemaintenanceevent/AsyncSimulateMaintenanceEventLRO.java new file mode 100644 index 000000000000..f12d740e45ee --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/simulatemaintenanceevent/AsyncSimulateMaintenanceEventLRO.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_Tpu_SimulateMaintenanceEvent_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +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.SimulateMaintenanceEventRequest; +import com.google.cloud.tpu.v2alpha1.TpuClient; +import java.util.ArrayList; + +public class AsyncSimulateMaintenanceEventLRO { + + public static void main(String[] args) throws Exception { + asyncSimulateMaintenanceEventLRO(); + } + + public static void asyncSimulateMaintenanceEventLRO() 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()) { + SimulateMaintenanceEventRequest request = + SimulateMaintenanceEventRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .addAllWorkerIds(new ArrayList()) + .build(); + OperationFuture future = + tpuClient.simulateMaintenanceEventOperationCallable().futureCall(request); + // Do something. + Node response = future.get(); + } + } +} +// [END tpu_v2alpha1_generated_Tpu_SimulateMaintenanceEvent_LRO_async] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/simulatemaintenanceevent/SyncSimulateMaintenanceEvent.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/simulatemaintenanceevent/SyncSimulateMaintenanceEvent.java new file mode 100644 index 000000000000..8b832bb4ad9e --- /dev/null +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/simulatemaintenanceevent/SyncSimulateMaintenanceEvent.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_Tpu_SimulateMaintenanceEvent_sync] +import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.NodeName; +import com.google.cloud.tpu.v2alpha1.SimulateMaintenanceEventRequest; +import com.google.cloud.tpu.v2alpha1.TpuClient; +import java.util.ArrayList; + +public class SyncSimulateMaintenanceEvent { + + public static void main(String[] args) throws Exception { + syncSimulateMaintenanceEvent(); + } + + public static void syncSimulateMaintenanceEvent() 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()) { + SimulateMaintenanceEventRequest request = + SimulateMaintenanceEventRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .addAllWorkerIds(new ArrayList()) + .build(); + Node response = tpuClient.simulateMaintenanceEventAsync(request).get(); + } + } +} +// [END tpu_v2alpha1_generated_Tpu_SimulateMaintenanceEvent_sync] diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/startnode/AsyncStartNode.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/startnode/AsyncStartNode.java index d33d7ae9ac20..b290a6f19048 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/startnode/AsyncStartNode.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/startnode/AsyncStartNode.java @@ -18,6 +18,7 @@ // [START tpu_v2alpha1_generated_Tpu_StartNode_async] import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2alpha1.NodeName; import com.google.cloud.tpu.v2alpha1.StartNodeRequest; import com.google.cloud.tpu.v2alpha1.TpuClient; import com.google.longrunning.Operation; @@ -35,7 +36,10 @@ public static void asyncStartNode() throws Exception { // - 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(); + StartNodeRequest request = + StartNodeRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); ApiFuture future = tpuClient.startNodeCallable().futureCall(request); // Do something. Operation response = future.get(); diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/startnode/AsyncStartNodeLRO.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/startnode/AsyncStartNodeLRO.java index 5f9cb56ff40c..98ef81b501f1 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/startnode/AsyncStartNodeLRO.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/startnode/AsyncStartNodeLRO.java @@ -19,6 +19,7 @@ // [START tpu_v2alpha1_generated_Tpu_StartNode_LRO_async] import com.google.api.gax.longrunning.OperationFuture; 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.StartNodeRequest; import com.google.cloud.tpu.v2alpha1.TpuClient; @@ -36,7 +37,10 @@ public static void asyncStartNodeLRO() throws Exception { // - 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(); + StartNodeRequest request = + StartNodeRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); OperationFuture future = tpuClient.startNodeOperationCallable().futureCall(request); // Do something. diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/startnode/SyncStartNode.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/startnode/SyncStartNode.java index 29dbe1ca8222..5fe04ef186e0 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/startnode/SyncStartNode.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/startnode/SyncStartNode.java @@ -18,6 +18,7 @@ // [START tpu_v2alpha1_generated_Tpu_StartNode_sync] import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.NodeName; import com.google.cloud.tpu.v2alpha1.StartNodeRequest; import com.google.cloud.tpu.v2alpha1.TpuClient; @@ -34,7 +35,10 @@ public static void syncStartNode() throws Exception { // - 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(); + StartNodeRequest request = + StartNodeRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); Node response = tpuClient.startNodeAsync(request).get(); } } diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/stopnode/AsyncStopNode.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/stopnode/AsyncStopNode.java index 4da002d7f3a6..d9b5fc6ac85a 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/stopnode/AsyncStopNode.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/stopnode/AsyncStopNode.java @@ -18,6 +18,7 @@ // [START tpu_v2alpha1_generated_Tpu_StopNode_async] import com.google.api.core.ApiFuture; +import com.google.cloud.tpu.v2alpha1.NodeName; import com.google.cloud.tpu.v2alpha1.StopNodeRequest; import com.google.cloud.tpu.v2alpha1.TpuClient; import com.google.longrunning.Operation; @@ -35,7 +36,10 @@ public static void asyncStopNode() throws Exception { // - 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(); + StopNodeRequest request = + StopNodeRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); ApiFuture future = tpuClient.stopNodeCallable().futureCall(request); // Do something. Operation response = future.get(); diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/stopnode/AsyncStopNodeLRO.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/stopnode/AsyncStopNodeLRO.java index 32e2df51b220..54814fd3fd7f 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/stopnode/AsyncStopNodeLRO.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/stopnode/AsyncStopNodeLRO.java @@ -19,6 +19,7 @@ // [START tpu_v2alpha1_generated_Tpu_StopNode_LRO_async] import com.google.api.gax.longrunning.OperationFuture; 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.StopNodeRequest; import com.google.cloud.tpu.v2alpha1.TpuClient; @@ -36,7 +37,10 @@ public static void asyncStopNodeLRO() throws Exception { // - 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(); + StopNodeRequest request = + StopNodeRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); OperationFuture future = tpuClient.stopNodeOperationCallable().futureCall(request); // Do something. diff --git a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/stopnode/SyncStopNode.java b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/stopnode/SyncStopNode.java index 56b23b6b24b8..05987adb887b 100644 --- a/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/stopnode/SyncStopNode.java +++ b/java-tpu/samples/snippets/generated/com/google/cloud/tpu/v2alpha1/tpu/stopnode/SyncStopNode.java @@ -18,6 +18,7 @@ // [START tpu_v2alpha1_generated_Tpu_StopNode_sync] import com.google.cloud.tpu.v2alpha1.Node; +import com.google.cloud.tpu.v2alpha1.NodeName; import com.google.cloud.tpu.v2alpha1.StopNodeRequest; import com.google.cloud.tpu.v2alpha1.TpuClient; @@ -34,7 +35,10 @@ public static void syncStopNode() throws Exception { // - 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(); + StopNodeRequest request = + StopNodeRequest.newBuilder() + .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) + .build(); Node response = tpuClient.stopNodeAsync(request).get(); } } diff --git a/versions.txt b/versions.txt index 560b10968664..ab898554fcc5 100644 --- a/versions.txt +++ b/versions.txt @@ -596,3 +596,5 @@ grpc-google-maps-addressvalidation-v1:0.0.0:0.0.1-SNAPSHOT google-cloud-monitoring-metricsscope:0.0.0:0.0.1-SNAPSHOT proto-google-cloud-monitoring-metricsscope-v1:0.0.0:0.0.1-SNAPSHOT grpc-google-cloud-monitoring-metricsscope-v1:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-tpu-v2:2.7.0:2.8.0-SNAPSHOT +grpc-google-cloud-tpu-v2:2.7.0:2.8.0-SNAPSHOT